From 837bd6eb4f2a32bedb1591800155f9d7408b92c6 Mon Sep 17 00:00:00 2001 From: harukin-expo-dev-env Date: Wed, 22 Jan 2025 13:20:45 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=90=E3=82=B0=E3=81=A8=E3=83=AC=E3=82=A4?= =?UTF-8?q?=E3=82=A2=E3=82=A6=E3=83=88=E3=81=AE=E5=B4=A9=E5=A3=8A=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MenuPage.js | 5 +- components/Menu/FixedContentBottom.js | 27 ++- components/Settings/SettingTopPage.js | 211 ++++++------------ components/Settings/WidgetSettings.js | 4 +- package.json | 5 +- ...oriteStation.js => useFavoriteStation.tsx} | 14 +- yarn.lock | 99 ++++++-- 7 files changed, 185 insertions(+), 180 deletions(-) rename stateBox/{useFavoriteStation.js => useFavoriteStation.tsx} (77%) diff --git a/MenuPage.js b/MenuPage.js index 421d73e..9668b95 100644 --- a/MenuPage.js +++ b/MenuPage.js @@ -18,12 +18,11 @@ export function MenuPage() { const { favoriteStation, setFavoriteStation } = useFavoriteStation(); const { getCurrentTrain } = useCurrentTrain(); const navigation = useNavigation(); - const { addListener, dispatch } = navigation; - dispatch(CommonActions.preload("positions")); + const { addListener } = navigation; useEffect(() => { AS.getItem("startPage") .then((res) => { - if (res == "true") navigation.navigate("login"); + if (res == "true") navigation.navigate("positions"); }) .catch((e) => { //6.0以降false diff --git a/components/Menu/FixedContentBottom.js b/components/Menu/FixedContentBottom.js index 00e1e56..de3735e 100644 --- a/components/Menu/FixedContentBottom.js +++ b/components/Menu/FixedContentBottom.js @@ -5,6 +5,8 @@ import { Ionicons, MaterialCommunityIcons, } from "@expo/vector-icons"; +import { ListItem } from "@rneui/themed"; +import TouchableScale from 'react-native-touchable-scale'; import Icon from "react-native-vector-icons/Entypo"; import { TextBox } from "../atom/TextBox"; import { TicketBox } from "../atom/TicketBox"; @@ -248,20 +250,17 @@ export const FixedContentBottom = (props) => { name: "しこくたぬきのぽんちゃん 【四国家サポーターズクラブ】", }, ].map((d) => ( - Linking.openURL(d.url)} - style={{ - flexDirection: "row", - padding: 5, - alignItems: "center", - borderBottomWidth: 1, - borderBottomColor: "white", - }} - > - {d.name} - - - + Linking.openURL(d.url)} + key={d.url}friction={90} // + tension={100} // These props are passed to the parent component (here TouchableScale) + activeScale={0.95} // + Component={TouchableScale} + > + + {d.name} + + + ))} diff --git a/components/Settings/SettingTopPage.js b/components/Settings/SettingTopPage.js index 1dc80c6..4b9776a 100644 --- a/components/Settings/SettingTopPage.js +++ b/components/Settings/SettingTopPage.js @@ -11,7 +11,8 @@ import { import * as Updates from "expo-updates"; import { useWindowDimensions } from "react-native"; import { useNavigation } from "@react-navigation/native"; -import { ListItem } from "native-base"; +import { ListItem } from "@rneui/themed"; +import TouchableScale from "react-native-touchable-scale"; import { SwitchArea } from "../atom/SwitchArea"; import { useNotification } from "../../stateBox/useNotifications"; @@ -120,178 +121,106 @@ export const SettingTopPage = ({ trueText={"列車位置情報"} /> navigation.navigate("setting",{screen:"FavoriteSettings"})} + activeScale={0.95} + Component={TouchableScale} + bottomDivider + onPress={() => + navigation.navigate("setting", { screen: "FavoriteSettings" }) + } > - - お気に入り登録の並び替え - - - - {">"} - + + お気に入り登録の並び替え + + navigation.navigate("setting",{screen:"NotificationSettings"})} + activeScale={0.95} + Component={TouchableScale} + bottomDivider + onPress={() => + navigation.navigate("setting", { screen: "NotificationSettings" }) + } disabled={expoPushToken == ""} > - - 通知設定{expoPushToken == "" ? "(通知設定をオンにしてください)" : "(β)"} - - - - {">"} - + + + 通知設定 + {expoPushToken == "" ? "(通知設定をオンにしてください)" : "(β)"} + + + + navigation.navigate("setting",{screen:"LayoutSettings"})} + activeScale={0.95} + Component={TouchableScale} + bottomDivider + onPress={() => + navigation.navigate("setting", { screen: "LayoutSettings" }) + } > - - レイアウト設定 - - - - {">"} - + + レイアウト設定 + + {Platform.OS === "android" ? ( navigation.navigate("setting",{screen:"WidgetSettings"})} + activeScale={0.95} + Component={TouchableScale} + bottomDivider + onPress={() => + navigation.navigate("setting", { screen: "WidgetSettings" }) + } > - - ウィジェット設定 - - - - {">"} - + + ウィジェット設定 + + ) : null} Linking.openURL( "https://nexcloud.haruk.in/sites/press-harukin/JRShikokuApps/policy" ) } > - - プライバシーポリシー - - + + プライバシーポリシー + + + Linking.openURL("https://nexcloud.haruk.in/s/2WFEN5oLPGtrRqT") } > - - 開発情報 - - - + + 開発情報 + + + Linking.openURL("https://twitter.com/Xprocess_main")} > - - 運営Twitter - - + + 運営Twitter + + + {/* testNFC()}> { setWidgetList(d); }; - useEffect(reload, []); + useEffect(() => { + reload(); + }, []); useEffect(() => { getDelayData().then(({ time, delayString }) => { diff --git a/package.json b/package.json index 0bbd205..70f34e0 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,8 @@ "@react-navigation/bottom-tabs": "^7.2.0", "@react-navigation/native": "^7.0.14", "@react-navigation/stack": "^7.1.1", + "@rneui/base": "^0.0.0-edge.2", + "@rneui/themed": "^0.0.0-edge.2", "dayjs": "^1.11.9", "expo": "^52.0.0", "expo-alternate-app-icons": "^1.3.0", @@ -58,7 +60,8 @@ "react-native-storage": "^1.0.1", "react-native-svg": "15.8.0", "react-native-svg-uri": "^1.2.3", - "react-native-vector-icons": "^8.1.0", + "react-native-touchable-scale": "^2.2.0", + "react-native-vector-icons": "^10.2.0", "react-native-view-shot": "~4.0.3", "react-native-webview": "13.12.5", "typescript": "^5.3.0" diff --git a/stateBox/useFavoriteStation.js b/stateBox/useFavoriteStation.tsx similarity index 77% rename from stateBox/useFavoriteStation.js rename to stateBox/useFavoriteStation.tsx index f8899bc..dbc09d2 100644 --- a/stateBox/useFavoriteStation.js +++ b/stateBox/useFavoriteStation.tsx @@ -4,6 +4,7 @@ import React, { useState, useEffect, useLayoutEffect, + FC, } from "react"; import { AS } from "../storageControl"; import { useStationList } from "./useStationList"; @@ -13,13 +14,20 @@ const initialState = { lodAddMigration: () => {}, }; -const FavoriteStationContext = createContext(initialState); +type initialStateType = { + favoriteStation: any[]; + setFavoriteStation: (d:any)=>void; + lodAddMigration: ()=>void; +}; +const FavoriteStationContext = createContext(initialState); export const useFavoriteStation = () => { return useContext(FavoriteStationContext); }; - -export const FavoriteStationProvider = ({ children }) => { +type Props = { + children: React.ReactNode; +}; +export const FavoriteStationProvider:FC = ({ children }) => { const [favoriteStation, setFavoriteStation] = useState([]); const { getStationData } = useStationList(); const lodAddMigration = () => { diff --git a/yarn.lock b/yarn.lock index cf787b1..9f791f1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2356,6 +2356,11 @@ hermes-parser "0.23.1" nullthrows "^1.1.1" +"@react-native/normalize-color@*": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@react-native/normalize-color/-/normalize-color-2.1.0.tgz#939b87a9849e81687d3640c5efa2a486ac266f91" + integrity sha512-Z1jQI2NpdFJCVgpY+8Dq/Bt3d+YUi1928Q+/CZm/oh66fzM0RUl54vvuXlPJKybH4pdCZey1eDTPaLHkMPNgWA== + "@react-native/normalize-colors@0.76.6": version "0.76.6" resolved "https://registry.yarnpkg.com/@react-native/normalize-colors/-/normalize-colors-0.76.6.tgz#c2688aee5a824ad5331bb2b01791b024cd6643ea" @@ -2441,6 +2446,35 @@ "@react-navigation/elements" "^2.2.5" color "^4.2.3" +"@rneui/base-edge@github:react-native-elements/react-native-elements#base": + version "4.0.0-rc.7" + resolved "https://codeload.github.com/react-native-elements/react-native-elements/tar.gz/d42432d9581b3c1d4a3413e2861ff8be12c700b6" + dependencies: + "@types/react-native-vector-icons" "^6.4.10" + color "^3.2.1" + deepmerge "^4.2.2" + hoist-non-react-statics "^3.3.2" + react-native-ratings "^8.1.0" + react-native-size-matters "^0.4.0" + +"@rneui/base@^0.0.0-edge.2": + version "0.0.0-edge.2" + resolved "https://registry.yarnpkg.com/@rneui/base/-/base-0.0.0-edge.2.tgz#ff251ac010c71e9e5b917273fa69401e16b0a9ad" + integrity sha512-MFyiK0Kz23v5mwOUotZdD8cudREa0t9lFwb2+6MyyG1SN2I8CUyqqsZBBwUMInXbspeOtJGtWOPv61TM/2esFQ== + dependencies: + "@rneui/base-edge" "github:react-native-elements/react-native-elements#base" + +"@rneui/themed-edge@github:react-native-elements/react-native-elements#themed": + version "4.0.0-rc.7" + resolved "https://codeload.github.com/react-native-elements/react-native-elements/tar.gz/bda83f52e80b644de8e684475a6e15fd895ab43e" + +"@rneui/themed@^0.0.0-edge.2": + version "0.0.0-edge.2" + resolved "https://registry.yarnpkg.com/@rneui/themed/-/themed-0.0.0-edge.2.tgz#a9cdc4501e5d046f7c6f886a8f6e0824af0f731d" + integrity sha512-MnsZarge+2V1//ov9jCAxkKzjS5RejZf/eRpE9tVOmvDZeEO1Q/9LIV00ZJxEHnjJHpozs5UvBkwb8KAwFL/0Q== + dependencies: + "@rneui/themed-edge" "github:react-native-elements/react-native-elements#themed" + "@segment/loosely-validate-event@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@segment/loosely-validate-event/-/loosely-validate-event-2.0.0.tgz#87dfc979e5b4e7b82c5f1d8b722dfd5d77644681" @@ -2593,6 +2627,14 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w== +"@types/react-native-vector-icons@^6.4.10": + version "6.4.18" + resolved "https://registry.yarnpkg.com/@types/react-native-vector-icons/-/react-native-vector-icons-6.4.18.tgz#18671c617b9d0958747bc959903470dde91a8c79" + integrity sha512-YGlNWb+k5laTBHd7+uZowB9DpIK3SXUneZqAiKQaj1jnJCZM0x71GDim5JCTMi4IFkhc9m8H/Gm28T5BjyivUw== + dependencies: + "@types/react" "*" + "@types/react-native" "^0.70" + "@types/react-native-vector-icons@^6.4.6": version "6.4.13" resolved "https://registry.yarnpkg.com/@types/react-native-vector-icons/-/react-native-vector-icons-6.4.13.tgz#28b34d15094e040718beefb67cb3eff0c4994cb6" @@ -3483,7 +3525,7 @@ color-string@^1.6.0, color-string@^1.9.0: color-name "^1.0.0" simple-swizzle "^0.2.2" -color@^3.1.2, color@^3.1.3: +color@^3.1.2, color@^3.1.3, color@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/color/-/color-3.2.1.tgz#3544dc198caf4490c3ecc9a790b54fe9ff45e164" integrity sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA== @@ -3848,6 +3890,15 @@ depd@2.0.0: resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== +deprecated-react-native-prop-types@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/deprecated-react-native-prop-types/-/deprecated-react-native-prop-types-2.3.0.tgz#c10c6ee75ff2b6de94bb127f142b814e6e08d9ab" + integrity sha512-pWD0voFtNYxrVqvBMYf5gq3NA2GCpfodS1yNynTPc93AYA/KEMGeWDqqeUB6R2Z9ZofVhks2aeJXiuQqKNpesA== + dependencies: + "@react-native/normalize-color" "*" + invariant "*" + prop-types "*" + destroy@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" @@ -5093,7 +5144,7 @@ internal-ip@^4.3.0: default-gateway "^4.2.0" ipaddr.js "^1.9.0" -invariant@2.2.4, invariant@^2.2.4: +invariant@*, invariant@2.2.4, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== @@ -6819,7 +6870,7 @@ prompts@^2.3.2: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: +prop-types@*, prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== @@ -7063,6 +7114,13 @@ react-native-ratings@8.0.4: dependencies: lodash "^4.17.15" +react-native-ratings@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/react-native-ratings/-/react-native-ratings-8.1.0.tgz#3fa9ad29128dc3a88e59518ba151e61c59dd0647" + integrity sha512-+QOJ4G3NjVkI1D+tk4EGx1dCvVfbD2nQdkrj9cXrcAoEiwmbep4z4bZbCKmWMpQ5h2dqbxABU8/eBnbDmvAc3g== + dependencies: + lodash "^4.17.15" + react-native-reanimated-carousel@^3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/react-native-reanimated-carousel/-/react-native-reanimated-carousel-3.5.1.tgz#3605b9959ffc0aa1c6b8b8736d98f91f46e36b17" @@ -7137,6 +7195,11 @@ react-native-size-matters@^0.3.1: resolved "https://registry.yarnpkg.com/react-native-size-matters/-/react-native-size-matters-0.3.1.tgz#24d0cfc335a2c730f6d58bd7b43ea5a41be4b49f" integrity sha512-mKOfBLIBFBcs9br1rlZDvxD5+mAl8Gfr5CounwJtxI6Z82rGrMO+Kgl9EIg3RMVf3G855a85YVqHJL2f5EDRlw== +react-native-size-matters@^0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/react-native-size-matters/-/react-native-size-matters-0.4.2.tgz#4348bdd6fc47383f60326d58ad69870c998a5f9a" + integrity sha512-DKE3f/sdcozd24oASgkP1iGg+YU3HoajRa5k3a4wkRzpiqREq8SGX12Y5zBgAt/8IivLQoTMYkyQu1/Giuy+zQ== + react-native-snap-carousel@^3.9.1: version "3.9.1" resolved "https://registry.yarnpkg.com/react-native-snap-carousel/-/react-native-snap-carousel-3.9.1.tgz#6fd9bd8839546c2c6043a41d2035afbc6fe0443e" @@ -7174,6 +7237,22 @@ react-native-tab-view@^2.15.2: resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-2.16.0.tgz#cae72c7084394bd328fac5fefb86cd966df37a86" integrity sha512-ac2DmT7+l13wzIFqtbfXn4wwfgtPoKzWjjZyrK1t+T8sdemuUvD4zIt+UImg03fu3s3VD8Wh/fBrIdcqQyZJWg== +react-native-touchable-scale@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/react-native-touchable-scale/-/react-native-touchable-scale-2.2.0.tgz#b12723014a66ba14af3e55c1925e4d7c77ef7209" + integrity sha512-EKWOpvqFKKvw4FsaMqoIqqALQbhEcEYeyd5iIctub4lA+6nUfQ472NeQzDLtXMJD65JUYxsC8XEKz/Ttj5+b/Q== + dependencies: + deprecated-react-native-prop-types "^2.3.0" + prop-types "^15.6.0" + +react-native-vector-icons@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-10.2.0.tgz#f438f2ca16f7d6be658fd6ec8f0d2b7e2132b91c" + integrity sha512-n5HGcxUuVaTf9QJPs/W22xQpC2Z9u0nb0KgLPnVltP8vdUvOp6+R26gF55kilP/fV4eL4vsAHUqUjewppJMBOQ== + dependencies: + prop-types "^15.7.2" + yargs "^16.1.1" + react-native-vector-icons@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-7.1.0.tgz#145487d617b2a81d395d2cf64e6e065fcab3a454" @@ -7188,20 +7267,6 @@ react-native-vector-icons@^7.0.0: prop-types "^15.7.2" yargs "^15.0.2" -react-native-vector-icons@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/react-native-vector-icons/-/react-native-vector-icons-8.1.0.tgz#e8ee2b17bc4d9f636da1c6f67feee8e2a850c3d8" - integrity sha512-sHIdBB6Y0dHaot2fMXgy5J/hhCn5YuyN7SKDNFgPzL8KA1oF2/v7mgYMavnK7LIIs2dJoGnDANKf61dsU+TZlg== - dependencies: - lodash.frompairs "^4.0.1" - lodash.isequal "^4.5.0" - lodash.isstring "^4.0.1" - lodash.omit "^4.5.0" - lodash.pick "^4.4.0" - lodash.template "^4.5.0" - prop-types "^15.7.2" - yargs "^16.1.1" - react-native-view-shot@~4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/react-native-view-shot/-/react-native-view-shot-4.0.3.tgz#9b98388fcc5228073cb66ac98ca339eda35767ac"