From bc3aca8c4183b4b7740bcbcacce8dfd9c9142e24 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Mon, 10 Mar 2025 17:48:51 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E3=81=AE=E3=83=98=E3=83=83=E3=83=80=E3=83=BC=E3=82=92=E4=B8=80?= =?UTF-8?q?=E6=96=89=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Settings/FavoriteSettings.js | 44 +------- components/Settings/LauncherIconSettings.js | 41 +------ components/Settings/LayoutSettings.js | 41 +------ components/Settings/NotificationSettings.js | 115 +++++--------------- components/Settings/SettingTopPage.js | 44 +------- components/Settings/WidgetSettings.js | 44 +------- components/atom/SheetHeaderItem.tsx | 48 ++++++++ 7 files changed, 97 insertions(+), 280 deletions(-) create mode 100644 components/atom/SheetHeaderItem.tsx diff --git a/components/Settings/FavoriteSettings.js b/components/Settings/FavoriteSettings.js index 4c4e0ec..9a08d43 100644 --- a/components/Settings/FavoriteSettings.js +++ b/components/Settings/FavoriteSettings.js @@ -4,51 +4,17 @@ import { useNavigation } from "@react-navigation/native"; import { useFavoriteStation } from "../../stateBox/useFavoriteStation"; import { CheckBox } from "react-native-elements"; import { FavoriteSettingsItem } from "./FavoliteSettings/FavoiliteSettingsItem"; +import { SheetHeaderItem } from "@/components/atom/SheetHeaderItem"; export const FavoriteSettings = () => { const { favoriteStation, setFavoriteStation } = useFavoriteStation(); const { goBack } = useNavigation(); return ( - - - - - - < 設定 - - - - - - - お気に入り設定 - - - + {favoriteStation.map((currentStation, index, array) => ( { const { goBack } = useNavigation(); @@ -21,45 +22,7 @@ export const LauncherIconSettings = ({ navigate }) => { const [currentIcon] = useState(getAppIconName()); return ( - - - - - - < 設定 - - - - - - - アイコン設定 - - - + {currentIcon ? ( <> diff --git a/components/Settings/LayoutSettings.js b/components/Settings/LayoutSettings.js index e92af7b..4020857 100644 --- a/components/Settings/LayoutSettings.js +++ b/components/Settings/LayoutSettings.js @@ -4,6 +4,7 @@ import { useNavigation } from "@react-navigation/native"; import { SwitchArea } from "../atom/SwitchArea"; import { CheckBox } from "react-native-elements"; import { TripleSwitchArea } from "../atom/TripleSwitchArea"; +import { SheetHeaderItem } from "../atom/SheetHeaderItem"; export const LayoutSettings = ({ navigate, @@ -25,45 +26,7 @@ export const LayoutSettings = ({ const { goBack } = useNavigation(); return ( - - - - - - < 設定 - - - - - - - レイアウト設定 - - - + { const { expoPushToken } = useNotification(); @@ -19,92 +20,36 @@ export const NotificationSettings = () => { AS.getItem("strangeTrain").then(setStrangeTrain); }, []); + const setRegister = () => { + fetch( + "https://n8n.haruk.in/webhook/jr-shikoku-notification-configurations", + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + token: expoPushToken, + traInfoEX, + informations, + strangeTrain, + }), + } + ).then(() => { + Promise.all([ + AS.setItem("traInfoEX", traInfoEX.toString()), + AS.setItem("informations", informations.toString()), + AS.setItem("strangeTrain", strangeTrain.toString()), + ]).then(() => alert("通知の設定を保存、登録しました")); + }); + }; return ( - - - - - - < 設定 - - - - - - - 通知設定(β) - - - { - fetch( - "https://n8n.haruk.in/webhook/jr-shikoku-notification-configurations", - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ - token: expoPushToken, - traInfoEX, - informations, - strangeTrain, - }), - } - ).then(() => { - Promise.all([ - AS.setItem("traInfoEX", traInfoEX.toString()), - AS.setItem("informations", informations.toString()), - AS.setItem("strangeTrain", strangeTrain.toString()), - ]).then(() => alert("通知の設定を保存、登録しました")); - }); - }} - style={{ - flexDirection: "column", - flex: 1, - }} - > - - - 登録実行 - - - - - + - - - navigation.goBack()} - style={{ - flexDirection: "column", - flex: 1, - }} - > - - - 閉じる - - - - - - - アプリの設定画面 - - - + navigation.goBack(), + }} /> diff --git a/components/Settings/WidgetSettings.js b/components/Settings/WidgetSettings.js index 25b2628..f5213e5 100644 --- a/components/Settings/WidgetSettings.js +++ b/components/Settings/WidgetSettings.js @@ -8,6 +8,7 @@ import { getInfoString } from "../AndroidWidget/InfoWidget"; import { AS } from "../../storageControl"; import { nameToWidget } from "../AndroidWidget/widget-task-handler"; import { ListItem } from "native-base"; +import { SheetHeaderItem } from "../atom/SheetHeaderItem"; export const WidgetSettings = ({ navigate }) => { const { JR_shikoku_train_info, Info_Widget } = nameToWidget; @@ -41,45 +42,10 @@ export const WidgetSettings = ({ navigate }) => { }, []); return ( - - - - - - < 設定 - - - - - - - ウィジェット設定 - - - + = (props) => { + const { LeftItem, RightItem, title } = props; + return ( + + + {LeftItem ? : <>} + + {title} + + {RightItem ? : <>} + + + ); +}; + +type SideItemProps = { + onPress: () => void; + title: string; + position: "left" | "right"; +}; +const SideItem: FC = ({ onPress, title, position }) => { + return ( + + + {title} + + + ); +}; From 5d89747c03e01228f9306e82702c54b3046e143d Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Tue, 11 Mar 2025 05:16:35 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9A=AB=E5=AE=9A=E5=9E=8B=E7=A7=BB?= =?UTF-8?q?=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/{FavoriteList.js => FavoriteList.tsx} | 6 +++--- .../{FavoriteListItem.js => FavoriteListItem.tsx} | 13 +++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) rename components/{FavoriteList.js => FavoriteList.tsx} (97%) rename components/atom/{FavoriteListItem.js => FavoriteListItem.tsx} (87%) diff --git a/components/FavoriteList.js b/components/FavoriteList.tsx similarity index 97% rename from components/FavoriteList.js rename to components/FavoriteList.tsx index 40ac5cf..814da0f 100644 --- a/components/FavoriteList.js +++ b/components/FavoriteList.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from "react"; +import React, { FC, useEffect } from "react"; import { View, Text, ScrollView } from "react-native"; import Icon from "react-native-vector-icons/Entypo"; @@ -8,7 +8,7 @@ import { useNavigation } from "@react-navigation/native"; import { useTrainMenu } from "../stateBox/useTrainMenu"; import { FavoriteListItem } from "./atom/FavoriteListItem"; import { BigButton } from "./atom/BigButton"; -export default function FavoriteList() { +export const FavoriteList: FC = () => { const { favoriteStation } = useFavoriteStation(); const { webview } = useCurrentTrain(); const { navigate, addListener, goBack, canGoBack } = useNavigation(); @@ -92,4 +92,4 @@ export default function FavoriteList() { goBack()} string="閉じる" /> ); -} +}; diff --git a/components/atom/FavoriteListItem.js b/components/atom/FavoriteListItem.tsx similarity index 87% rename from components/atom/FavoriteListItem.js rename to components/atom/FavoriteListItem.tsx index 2d9aaa9..d3b9bb2 100644 --- a/components/atom/FavoriteListItem.js +++ b/components/atom/FavoriteListItem.tsx @@ -1,8 +1,17 @@ -import React from "react"; +import React, { FC } from "react"; import { View, Text, TouchableOpacity } from "react-native"; import lineColorList from "../../assets/originData/lineColorList"; -export const FavoriteListItem = ({ currentStation, children, onPress }) => { + +type Props = { + currentStation: { + Station_JP: string; + StationNumber: string; + }[]; + onPress: () => void; + children: React.ReactNode; +} +export const FavoriteListItem:FC = ({ currentStation, children, onPress }) => { const lineIDs = []; const EachIDs = []; currentStation.forEach((d) => { From d15d4b39107634db525a93cded1585ecd24e0d1d Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Tue, 11 Mar 2025 05:22:31 +0000 Subject: [PATCH 3/3] =?UTF-8?q?7200=E7=B3=BB=E3=81=AE=E3=83=90=E3=82=B0?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=BC=8F=E3=82=8C=E3=81=8C=E3=81=A3=E3=81=9F?= =?UTF-8?q?=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.json b/app.json index 2833d11..5fe6feb 100644 --- a/app.json +++ b/app.json @@ -300,7 +300,7 @@ } }, { - "name": "s7200", + "name": "7200", "ios": "./assets/icons/s7200.png", "android": { "foregroundImage": "./assets/icons/s7200.png",