ふぁぼ駅を表示するように変更(現在地が表示されない)
This commit is contained in:
parent
f580e319cf
commit
12f23bef16
6
App.js
6
App.js
@ -19,6 +19,12 @@ import News from "./components/news.js";
|
||||
import Setting from "./components/settings.js";
|
||||
import TrainMenu from "./components/trainMenu.js";
|
||||
import FavoriteList from "./components/FavoriteList.js";
|
||||
import { LogBox } from "react-native";
|
||||
|
||||
LogBox.ignoreLogs([
|
||||
"ViewPropTypes will be removed",
|
||||
"ColorPropType will be removed",
|
||||
]);
|
||||
const Stack = createStackNavigator();
|
||||
const Tab = createBottomTabNavigator();
|
||||
if (Platform.OS === "android") {
|
||||
|
@ -5,6 +5,10 @@ import ActionSheet from "react-native-actions-sheet";
|
||||
import Sign from "../../components/駅名表/Sign";
|
||||
|
||||
import { TicketBox } from "../atom/TicketBox";
|
||||
import {
|
||||
widthPercentageToDP as wp,
|
||||
heightPercentageToDP as hp,
|
||||
} from "react-native-responsive-screen";
|
||||
|
||||
export const StationDeteilView = (props) => {
|
||||
const {
|
||||
@ -44,13 +48,20 @@ export const StationDeteilView = (props) => {
|
||||
</View>
|
||||
<View>
|
||||
{currentStation && (
|
||||
<Sign
|
||||
currentStation={currentStation}
|
||||
originalStationList={originalStationList}
|
||||
favoriteStation={favoriteStation}
|
||||
setFavoriteStation={setFavoriteStation}
|
||||
oP={() => Linking.openURL(currentStation[0].StationTimeTable)}
|
||||
/>
|
||||
<View
|
||||
style={{
|
||||
margin: 10,
|
||||
marginHorizontal: wp("10%"),
|
||||
}}
|
||||
>
|
||||
<Sign
|
||||
currentStation={currentStation}
|
||||
originalStationList={originalStationList}
|
||||
favoriteStation={favoriteStation}
|
||||
setFavoriteStation={setFavoriteStation}
|
||||
oP={() => Linking.openURL(currentStation[0].StationTimeTable)}
|
||||
/>
|
||||
</View>
|
||||
)}
|
||||
{currentStation && (
|
||||
<View style={{ flexDirection: "row" }}>
|
||||
|
@ -40,7 +40,6 @@ export default function Sign(props) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
console.log(isFavorite.length);
|
||||
setTestButtonStatus(isFavorite.length != 0);
|
||||
}, [favoriteStation, currentStation]);
|
||||
|
||||
@ -260,8 +259,6 @@ const styleSheet = {
|
||||
height: (wp("80%") / 20) * 9,
|
||||
borderColor: "#2E94BB",
|
||||
borderWidth: 1,
|
||||
margin: 10,
|
||||
marginHorizontal: wp("10%"),
|
||||
backgroundColor: "white",
|
||||
},
|
||||
下帯: {
|
||||
|
39
menu.js
39
menu.js
@ -1,4 +1,5 @@
|
||||
import React, { useRef, useState, useEffect } from "react";
|
||||
import Carousel from "react-native-snap-carousel";
|
||||
import {
|
||||
Platform,
|
||||
View,
|
||||
@ -119,6 +120,9 @@ export default function Menu(props) {
|
||||
const [delayData, setDelayData] = useState(undefined);
|
||||
const [getTime, setGetTime] = useState(new Date());
|
||||
const [loadingDelayData, setLoadingDelayData] = useState(true);
|
||||
const carouselRef = useRef();
|
||||
const scrollRef = useRef();
|
||||
const [isScroll, setIsScroll] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
fetch(
|
||||
@ -141,7 +145,7 @@ export default function Menu(props) {
|
||||
>
|
||||
<StatusbarDetect />
|
||||
<TitleBar />
|
||||
<ScrollView>
|
||||
<ScrollView ref={scrollRef} scrollEnabled={isScroll}>
|
||||
<TopMenuButton />
|
||||
<TextBox
|
||||
backgroundColor="#0099CC"
|
||||
@ -159,17 +163,30 @@ export default function Menu(props) {
|
||||
列車の運行計画・混雑状況・感染症対策への取り組み
|
||||
</Text>
|
||||
</TextBox>
|
||||
<Carousel
|
||||
ref={carouselRef}
|
||||
layout={"default"}
|
||||
data={originalStationList && favoriteStation}
|
||||
sliderWidth={wp("100%")}
|
||||
itemWidth={wp("80%")}
|
||||
enableMomentum
|
||||
callbackOffsetMargin={1000}
|
||||
renderItem={({ item, index }) => {
|
||||
return (
|
||||
<View style={{ marginVertical: 10 }} key={item[0].StationNumber}>
|
||||
<Sign
|
||||
currentStation={item}
|
||||
originalStationList={originalStationList}
|
||||
favoriteStation={favoriteStation}
|
||||
setFavoriteStation={setFavoriteStation}
|
||||
oP={StationBoardAcSR.current?.setModalVisible}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
{currentStation && (
|
||||
<>
|
||||
<Sign
|
||||
currentStation={currentStation}
|
||||
originalStationList={originalStationList}
|
||||
favoriteStation={favoriteStation}
|
||||
setFavoriteStation={setFavoriteStation}
|
||||
oP={StationBoardAcSR.current?.setModalVisible}
|
||||
/>
|
||||
<LED_vision station={currentStation[0]} navigate={navigate} />
|
||||
</>
|
||||
<LED_vision station={currentStation[0]} navigate={navigate} />
|
||||
)}
|
||||
<JRSTraInfoBox
|
||||
JRSTraInfoEXAcSR={JRSTraInfoEXAcSR}
|
||||
|
Loading…
Reference in New Issue
Block a user