diff --git a/App.js b/App.js index d25b83c..ffc9ddf 100644 --- a/App.js +++ b/App.js @@ -14,7 +14,6 @@ import trainbase from "./trainbaseview"; import howto from "./howto"; import menu from "./menu"; import News from "./components/news.js"; -import TestArea from "./TestArea.js"; import Setting from "./components/settings.js"; import trainMenu from "./components/trainMenu.js"; const Stack = createStackNavigator(); @@ -26,7 +25,6 @@ if (Platform.OS === "android") { } export default function App() { const navigationRef = useRef(); - var platform = Platform.OS === "android" ? 70 : 50; useEffect(() => UpdateAsync(), []); return ( @@ -38,9 +36,7 @@ export default function App() { tabBarLabel: "位置情報", headerTransparent: true, gestureEnabled: true, - tabBarIcon: ({ color, size }) => ( - - ), + tabBarIcon: () => , }} /> ( - - ), + tabBarIcon: () => , }} /> ( - - ), + tabBarIcon: () => , }} /> @@ -97,35 +89,14 @@ function top() { component={howto} options={{ title: "使い方", - gestureEnabled: true, - ...TransitionPresets.ModalPresentationIOS, - cardOverlayEnabled: true, - headerTransparent: true, - headerShown: false, - }} - /> - - + ); @@ -142,17 +113,14 @@ function menuPage() { headerTransparent: true, }} /> - + ); } +const optionData = { + gestureEnabled: true, + ...TransitionPresets.ModalPresentationIOS, + cardOverlayEnabled: true, + headerTransparent: true, + headerShown: false, +}; diff --git a/Apps.js b/Apps.js index f95a933..ae40bf8 100644 --- a/Apps.js +++ b/Apps.js @@ -201,11 +201,8 @@ export default function Apps(props) { injectedJavaScript={injectJavascript} /> navigate("trainMenu", { webview, stationData: mapsStationData }) - /* { - setSelectedStation("松山"); - } */ + onPress={() => + navigate("trainMenu", { webview, stationData: mapsStationData }) } style={{ position: "absolute", diff --git a/TestArea.js b/TestArea.js deleted file mode 100644 index 3d56eb3..0000000 --- a/TestArea.js +++ /dev/null @@ -1,72 +0,0 @@ -import React, { Component, useEffect, useState } from "react"; -import { StatusBar, View, ScrollView, Linking, Text } from "react-native"; -import Constants from "expo-constants"; -import { ListItem } from "react-native-elements"; -import Icon from "react-native-vector-icons/Entypo"; -import StatusbarDetect from "./StatusbarDetect"; -var Status = StatusbarDetect(); -let a = []; -export default function TestArea(props) { - const [data, setdata] = useState(null); - useEffect(() => { - data == null - ? test().then((res) => { - setdata(res); - }) - : null; - }, [data]); - return ( - - {Status} - - TEST AREA!! - {data} - - - ); -} - -async function test() { - return fetch("https://train.jr-shikoku.co.jp/g?arg1=train&arg2=train", { - headers: { - authority: "train.jr-shikoku.co.jp", - "cache-control": "no-cache", - pragma: "no-cache", - "if-modified-since": "Thu, 01 Jun 1970 00:00:00 GMT", - accept: "*/*", - "sec-fetch-site": "same-origin", - "sec-fetch-mode": "cors", - referer: "https://train.jr-shikoku.co.jp/sp.html", - }, - }) - .then((res) => res.json()) - .then((D) => { - let d = []; - D.forEach((element) => { - d.push( - - ); - }); - a = d; - return d; - }); -} diff --git a/components/駅名表/Sign.js b/components/駅名表/Sign.js index 6f57011..ccbc20a 100644 --- a/components/駅名表/Sign.js +++ b/components/駅名表/Sign.js @@ -58,252 +58,61 @@ export default function Sign(props) { } }, [currentStation]); return ( - !stationName.今.JrHpUrl || Linking.openURL(stationName.今.JrHpUrl)} */ - onPress={oP} - > - - - JR - - {currentStation - .filter((d) => (d.StationNumber != " " ? true : false)) - .map((d, index, array) => ( - { - if (array.length == 1) return 20; - else if (index == 0) return 5; - else if (index == 1) return 35; - else return 20; - })() + "%", - right: "10%", - width: wp("10%"), - height: wp("10%"), - borderColor: "#2E94BB", - borderWidth: parseInt("2%"), - borderRadius: parseInt("100%"), - }} - > - - {d.StationNumber} - - - ))} - - - - {/* {stationName.今.LineName} */} - - {currentStation[0].Station_JP} - - - {currentStation[0].Station_EN} - - - - - + + + + JR + + { currentStation.map((currentStation) => { let [preStation, nexStation] = getPreNextStation(currentStation); return ( - - - {preStation && [ - - ◀ - , - preStation.StationNumber != " " && ( - + + + {preStation && ( + <> + + {preStation.StationNumber != " " && ( + + + + {preStation.StationNumber} + + + + )} + + + )} + + + {nexStation && ( + <> + + - {preStation.StationNumber} + {nexStation.StationNumber} - ), - - - {preStation.Station_JP} - - - {preStation.Station_EN} - - , - ]} - - - {nexStation && [ - - - {nexStation.Station_JP} - - - {nexStation.Station_EN} - - , - - - - {nexStation.StationNumber} - - - , - - ▶ - , - ]} + + + )} ); @@ -313,3 +122,143 @@ export default function Sign(props) { ); } + +const StationNumberMaker = (props) => { + return props.currentStation + .filter((d) => (d.StationNumber != " " ? true : false)) + .map((d, index, array) => ( + { + if (array.length == 1) return 20; + else if (index == 0) return 5; + else if (index == 1) return 35; + else return 20; + })() + "%", + right: "10%", + width: wp("10%"), + height: wp("10%"), + borderColor: "#2E94BB", + borderWidth: parseInt("2%"), + borderRadius: parseInt("100%"), + }} + > + + {d.StationNumber} + + + )); +}; + +const StationNameArea = (props) => { + const { currentStation } = props; + return ( + + + + {/* {stationName.今.LineName} */} + + {currentStation[0].Station_JP} + + + {currentStation[0].Station_EN} + + + + + ); +}; + +const StationName = (props) => { + const { stringData, ss } = props; + return ( + + {stringData.Station_JP} + {stringData.Station_EN} + + ); +}; + +const styleSheet = { + 外枠: { + width: wp("80%"), + height: (wp("80%") / 20) * 9, + borderColor: "#2E94BB", + borderWidth: 1, + margin: 10, + marginHorizontal: wp("10%"), + }, + 下帯: { + position: "absolute", + bottom: "0%", + left: "0%", + width: "100%", + height: "30%", + backgroundColor: "#2E94BB", + }, + JRStyle: { + position: "absolute", + top: "2%", + left: "2%", + fontWeight: "bold", + fontSize: parseInt("30%"), + color: "#2E94BB", + }, + stationNameAreaOverWrap: { + position: "absolute", + top: "10%", + alignContent: "center", + flexDirection: "row", + }, + Station_JP: { + fontWeight: "bold", + fontSize: parseInt("40%"), + color: "#005170", + }, + Station_EN: { + fontWeight: "bold", + fontSize: parseInt("15%"), + color: "#005170", + }, + 下帯内容: { + position: "absolute", + bottom: "0%", + height: "30%", + width: "100%", + alignItems: "center", + flexDirection: "column", + }, + 下枠フレーム: { + flex: 1, + flexDirection: "row", + alignContent: "center", + }, + 下枠左右マーク: { + fontWeight: "bold", + fontSize: parseInt("20%"), + color: "white", + paddingHorizontal: 10, + textAlignVertical: "center", + }, + 下枠駅ナンバー: { + alignContent: "center", + alignItems: "center", + width: wp("8%"), + height: wp("8%"), + margin: wp("1%"), + borderColor: "white", + borderWidth: parseInt("2%"), + borderRadius: parseInt("100%"), + }, + 下枠駅名: { + fontWeight: "bold", + fontSize: parseInt("15%"), + color: "white", + flex: 1, + textAlignVertical: "center", + }, +};