From 473f3a1dbad647e72c10417d21309d060b960f67 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Thu, 28 Mar 2024 07:49:01 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=82=A2=E3=82=A6=E3=83=88?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=AE=E3=83=87=E3=82=B6=E3=82=A4=E3=83=B3?= =?UTF-8?q?=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Settings/LayoutSettings.js | 72 +++++++++++++-------------- components/atom/SimpleSwitch.js | 6 ++- components/atom/SwitchArea.js | 13 ++++- components/atom/TripleSwitchArea.js | 2 +- 4 files changed, 52 insertions(+), 41 deletions(-) diff --git a/components/Settings/LayoutSettings.js b/components/Settings/LayoutSettings.js index 09e0547..44b36bb 100644 --- a/components/Settings/LayoutSettings.js +++ b/components/Settings/LayoutSettings.js @@ -58,7 +58,7 @@ export const LayoutSettings = ({ padding: 10, }} > - 設定画面 + レイアウト設定 @@ -90,15 +90,14 @@ export const LayoutSettings = ({ trueText={"オリジナル\n(駅名標)"} falseImage={require("../../assets/configuration/station_default.jpg")} trueImage={require("../../assets/configuration/station_original.jpg")} - /> - {stationMenu == "true" && ( + > - )} + - {trainMenu == "true" && ( - <> - - - - )} + > + + + @@ -151,12 +147,12 @@ const SimpleSwitch = ({ bool, setBool, str }) => ( checkedColor="red" onPress={() => setBool(bool == "true" ? "false" : "true")} containerStyle={{ - width: "100%", - backgroundColor: "white", + flex: 1, + backgroundColor: "#00000000", borderColor: "white", alignContent: "center", }} - textStyle={{ fontSize: 20 }} + textStyle={{ fontSize: 20, fontWeight: "normal" }} title={str} /> diff --git a/components/atom/SimpleSwitch.js b/components/atom/SimpleSwitch.js index da04c97..536226a 100644 --- a/components/atom/SimpleSwitch.js +++ b/components/atom/SimpleSwitch.js @@ -4,6 +4,7 @@ import { TouchableOpacity, Text, Image, + LayoutAnimation, } from "react-native"; export const SimpleSwitch = ({ bool, @@ -27,7 +28,10 @@ export const SimpleSwitch = ({ flexDirection: "row", flex: 1, }} - onPress={() => setBool(value.toString())} + onPress={() => { + LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); + setBool(value.toString()); + }} > { return ( - + {str} @@ -40,6 +50,7 @@ export const SwitchArea = ({ subText={trueText} /> + {bool == "true" && children} ); }; diff --git a/components/atom/TripleSwitchArea.js b/components/atom/TripleSwitchArea.js index 026b454..5f8c99f 100644 --- a/components/atom/TripleSwitchArea.js +++ b/components/atom/TripleSwitchArea.js @@ -12,7 +12,7 @@ export const TripleSwitchArea = ({