最後の駅リスト選択を維持するように変更
This commit is contained in:
parent
7ca4cf95e6
commit
6a58263e94
@ -1,3 +1,4 @@
|
|||||||
|
import { AS } from "@/storageControl";
|
||||||
import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs";
|
import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs";
|
||||||
import React, { useEffect, useRef } from "react";
|
import React, { useEffect, useRef } from "react";
|
||||||
import { View, TouchableOpacity, Text, LayoutAnimation } from "react-native";
|
import { View, TouchableOpacity, Text, LayoutAnimation } from "react-native";
|
||||||
@ -49,11 +50,15 @@ export const CarouselTypeChanger = ({
|
|||||||
if (!position) return;
|
if (!position) return;
|
||||||
returnToDefaultMode();
|
returnToDefaultMode();
|
||||||
setStationListMode("position");
|
setStationListMode("position");
|
||||||
|
AS.setItem("stationListMode", "position");
|
||||||
|
setSelectedCurrentStation(0);
|
||||||
}}
|
}}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
if (!position) return;
|
if (!position) return;
|
||||||
returnToDefaultMode();
|
returnToDefaultMode();
|
||||||
setStationListMode("position");
|
setStationListMode("position");
|
||||||
|
AS.setItem("stationListMode", "position");
|
||||||
|
setSelectedCurrentStation(0);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Ionicons
|
<Ionicons
|
||||||
@ -108,12 +113,14 @@ export const CarouselTypeChanger = ({
|
|||||||
returnToDefaultMode();
|
returnToDefaultMode();
|
||||||
// お気に入りリスト更新
|
// お気に入りリスト更新
|
||||||
setStationListMode("favorite");
|
setStationListMode("favorite");
|
||||||
|
AS.setItem("stationListMode", "favorite");
|
||||||
setSelectedCurrentStation(0);
|
setSelectedCurrentStation(0);
|
||||||
}}
|
}}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
returnToDefaultMode();
|
returnToDefaultMode();
|
||||||
// お気に入りリスト更新
|
// お気に入りリスト更新
|
||||||
setStationListMode("favorite");
|
setStationListMode("favorite");
|
||||||
|
AS.setItem("stationListMode", "favorite");
|
||||||
setSelectedCurrentStation(0);
|
setSelectedCurrentStation(0);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
8
menu.js
8
menu.js
@ -29,6 +29,7 @@ import { useBottomTabBarHeight } from "@react-navigation/bottom-tabs";
|
|||||||
import { CarouselBox } from "./components/Menu/Carousel/CarouselBox";
|
import { CarouselBox } from "./components/Menu/Carousel/CarouselBox";
|
||||||
import { CarouselTypeChanger } from "./components/Menu/Carousel/CarouselTypeChanger";
|
import { CarouselTypeChanger } from "./components/Menu/Carousel/CarouselTypeChanger";
|
||||||
import { useUserPosition } from "./stateBox/useUserPosition";
|
import { useUserPosition } from "./stateBox/useUserPosition";
|
||||||
|
import { AS } from "./storageControl";
|
||||||
configureReanimatedLogger({
|
configureReanimatedLogger({
|
||||||
level: ReanimatedLogLevel.error, // Set the log level to error
|
level: ReanimatedLogLevel.error, // Set the log level to error
|
||||||
strict: true, // Reanimated runs in strict mode by default
|
strict: true, // Reanimated runs in strict mode by default
|
||||||
@ -49,6 +50,13 @@ export default function Menu({
|
|||||||
const [stationListMode, setStationListMode] = useState(
|
const [stationListMode, setStationListMode] = useState(
|
||||||
/*<"position"|"favorite">*/ "position"
|
/*<"position"|"favorite">*/ "position"
|
||||||
);
|
);
|
||||||
|
useEffect(()=>{
|
||||||
|
AS.getItem("stationListMode").then((res) => {
|
||||||
|
setStationListMode(res);
|
||||||
|
}).catch((e) => {
|
||||||
|
// AS.setItem("stationListMode", "position");
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
const mapsRef = useRef(null);
|
const mapsRef = useRef(null);
|
||||||
const returnToTop = (bool = true) => {
|
const returnToTop = (bool = true) => {
|
||||||
scrollRef.current.scrollTo({
|
scrollRef.current.scrollTo({
|
||||||
|
Loading…
Reference in New Issue
Block a user