LEDに運行情報を表示するように変更
This commit is contained in:
6
App.js
6
App.js
@@ -69,7 +69,7 @@ export default function App() {
|
||||
|
||||
const [currentTrain, setCurrentTrain] = useState([]); //現在在線中の全列車 { num: 列車番号, delay: 遅延時分(状態), Pos: 位置情報 }
|
||||
const [currentTrainLoading, setCurrentTrainLoading] = useState("loading"); // success, error, loading
|
||||
|
||||
|
||||
const getCurrentTrain = () =>
|
||||
fetch(
|
||||
"https://script.google.com/macros/s/AKfycby9Y2-Bm75J_WkbZimi7iS8v5r9wMa9wtzpdwES9sOGF4i6HIYEJOM60W6gM1gXzt1o/exec",
|
||||
@@ -104,7 +104,6 @@ export default function App() {
|
||||
|
||||
return (
|
||||
<NavigationContainer name="Root" style={{ flex: 1 }}>
|
||||
{areaInfo != "" && <Text onPress={() => alert(areaInfo)}>{areaInfo}</Text>}
|
||||
<Tab.Navigator detachInactiveScreens={false}>
|
||||
<Tab.Screen
|
||||
name="login"
|
||||
@@ -151,6 +150,7 @@ export default function App() {
|
||||
setCurrentTrainLoading,
|
||||
}}
|
||||
getCurrentTrain={getCurrentTrain}
|
||||
areaInfo={areaInfo}
|
||||
/>
|
||||
)}
|
||||
</Tab.Screen>
|
||||
@@ -293,6 +293,7 @@ function MenuPage({
|
||||
currentTrainState,
|
||||
currentTrainLoadingState,
|
||||
getCurrentTrain,
|
||||
areaInfo,
|
||||
}) {
|
||||
useEffect(() => {
|
||||
const unsubscribe = navigation.addListener("tabPress", (e) => {
|
||||
@@ -327,6 +328,7 @@ function MenuPage({
|
||||
currentTrainState={currentTrainState}
|
||||
currentTrainLoadingState={currentTrainLoadingState}
|
||||
getCurrentTrain={getCurrentTrain}
|
||||
areaInfo={areaInfo}
|
||||
/>
|
||||
)}
|
||||
</Stack.Screen>
|
||||
|
Reference in New Issue
Block a user