This commit is contained in:
harukin-expo-dev-env 2025-01-22 12:03:50 +00:00
parent 294b95967f
commit 892d567991
8 changed files with 26 additions and 27 deletions

View File

@ -1,4 +1,4 @@
import { ToastAndroid } from "react-native";
import { Platform, ToastAndroid } from "react-native";
import * as Updates from "expo-updates";
export const UpdateAsync = () => {

View File

@ -1,5 +1,5 @@
// 種別判定
export const getType = (string) => {
export const getType = (string:string) => {
switch (string) {
case "express":
return "特急";

View File

@ -1,6 +1,6 @@
// Description: 電車名の変換を行う。
// マリンライナーやマリン表記をマリンライナーに変換する。
export const migrateTrainName = (string) => {
export const migrateTrainName = (string:string) => {
return string
.replace("マリン", "マリンライナー")
.replace("ライナーライナー", "ライナー");

View File

@ -1,7 +1,7 @@
// S列番の列車からDやMの列車を検索する
export const searchSpecialTrain = (trainNum, trainList) => {
export const searchSpecialTrain = (trainNum: string, trainList: any[]) => {
const searchBase = trainNum.replace("S", "").replace("X", "");
const search = (text) => {
const search = (text: string) => {
const TD = trainList[searchBase + text];
if (TD) {
return true;

View File

@ -1,6 +1,6 @@
import { Platform } from "react-native";
export const getPDFViewURL = (url) => {
export const getPDFViewURL = (url:string) => {
if (Platform.OS == "ios") return url;
else
return `https://mozilla.github.io/pdf.js/web/viewer.html?file=${encodeURI(url)}`;

View File

@ -41,7 +41,7 @@ export const lineListPair = {
M: "瀬戸大橋線(児島-宇多津間)[M]",
};
export const getStationList = async (props) => {
export const getStationList = async () => {
if (status) return status;
//駅リストイニシャライズ
return await Promise.all([
@ -68,8 +68,8 @@ export const getStationList = async (props) => {
stationList["徳島線(徳島-阿波池田間)[B]"],
stationList["鳴門線(池谷-鳴門間)[N]"],
stationList["瀬戸大橋線(児島-宇多津間)[M]"],
stationList.,
stationList.,
stationList["駅間リスト"],
stationList["日英対応表"],
] = values;
const concatBetweenStations = (eachRouteData) => {
let additional = [];
@ -82,7 +82,7 @@ export const getStationList = async (props) => {
eachRouteData[routeIndex + 1].StationNumber.replace(/[A-Z]/g, "")
);
if (nextStationID - currentStationID != 1) {
stationList..forEach((betweenList) => {
stationList["駅間リスト"].forEach((betweenList) => {
if (
betweenList.BetweenStation ==
routeData.Station_JP +
@ -125,12 +125,12 @@ export const getStationList = async (props) => {
stationList["予讃線(高松-松山間)[Y]"] = addStationPosition(
concatBetweenStations(stationList["予讃線(高松-松山間)[Y]"]),
,
stationList.
stationList["日英対応表"]
);
stationList["予讃線(松山-宇和島間)[U]"] = addStationPosition(
concatBetweenStations(stationList["予讃線(松山-宇和島間)[U]"]),
,
stationList.
stationList["日英対応表"]
);
stationList["予讃線/愛ある伊予灘線(向井原-伊予大洲間)[S]"] =
addStationPosition(
@ -138,32 +138,32 @@ export const getStationList = async (props) => {
stationList["予讃線/愛ある伊予灘線(向井原-伊予大洲間)[S]"]
),
,
stationList.
stationList["日英対応表"]
);
stationList["土讃線(多度津-高知間)[D]"] = addStationPosition(
concatBetweenStations(stationList["土讃線(多度津-高知間)[D]"]),
,
stationList.
stationList["日英対応表"]
);
stationList["土讃線(高知-窪川間)[K]"] = addStationPosition(
concatBetweenStations(stationList["土讃線(高知-窪川間)[K]"]),
,
stationList.
stationList["日英対応表"]
);
stationList["高徳線(高松-徳島間)[T]"] = addStationPosition(
concatBetweenStations(stationList["高徳線(高松-徳島間)[T]"]),
,
stationList.
stationList["日英対応表"]
);
stationList["鳴門線(池谷-鳴門間)[N]"] = addStationPosition(
concatBetweenStations(stationList["鳴門線(池谷-鳴門間)[N]"]),
,
stationList.
stationList["日英対応表"]
);
const tokushimaCurrent = addStationPosition(
concatBetweenStations(stationList["徳島線(徳島-阿波池田間)[B]"]),
,
stationList.
stationList["日英対応表"]
);
stationList["徳島線(徳島-阿波池田間)[B]"] = [
tokushimaCurrent[tokushimaCurrent.length - 1],

View File

@ -1,4 +1,5 @@
export const buildProvidersTree = (providers) => {
import React, { FC } from "react";
export const buildProvidersTree:FC<any> = (providers) => {
// 基本ケースContextProviderが1つしか残っていない場合、それを返して終了する
if (providers.length === 1) {
return providers[0];

View File

@ -1,10 +1,10 @@
import React, { useRef, useState } from "react";
import { View, Platform, TouchableOpacity } from "react-native";
import React, { Ref, useRef, useState } from "react";
import { View, Platform, TouchableOpacity, StyleProp, ViewStyle } from "react-native";
import { WebView } from "react-native-webview";
import Constants from "expo-constants";
import { Ionicons } from "@expo/vector-icons";
export default function tndView() {
const webview = useRef();
const webview = useRef<WebView>(null);
const jsa = `
document.querySelector('.sitettl').style.display = 'none';
document.querySelector('.attention').style.display = 'none';
@ -18,7 +18,6 @@ export default function tndView() {
}}
>
<WebView
useWebKit={true}
ref={webview}
source={{ uri: "https://www.jr-shikoku.co.jp/info/" }}
originWhitelist={["https://www.jr-shikoku.co.jp"]}
@ -29,15 +28,15 @@ export default function tndView() {
onError={() => this.webView?.reload()}
/>
<ReloadButton
onPress={() => webview.current?.reload()}
onPress={() => webview.current.reload()}
top={Platform.OS == "ios" ? Constants.statusBarHeight : 0}
/>
</View>
);
}
const ReloadButton = ({ onPress, top, mapSwitch, LoadError = false }) => {
const styles = {
const ReloadButton = ({ onPress, top, LoadError = false }) => {
const styles:StyleProp<ViewStyle> = {
position: "absolute",
top,
right: 10,
@ -51,7 +50,6 @@ const ReloadButton = ({ onPress, top, mapSwitch, LoadError = false }) => {
alignContent: "center",
alignSelf: "center",
alignItems: "center",
display: mapSwitch,
};
return (
<TouchableOpacity onPress={onPress} style={styles}>