Files
jrshikoku/components/trainbaseview.tsx
harukin-expo-dev-env 10df37d0a2 feat: Expo SDK 52→53 upgrade + full dark mode support
- Upgrade Expo SDK 52→53 (React 18→19, RN 0.76→0.79)
- Remove deprecated packages (native-base, react-native-elements)
- Migrate to @rneui/themed 5.0.0 + modular vector icons
- Fix breaking changes: defaultProps, BackHandler, notifications, key props
- Add Babel plugin for font scaling (replaces Text.defaultProps)
- Configure expo-font for native font preloading
- Add complete dark mode theme system (lib/theme/)
  - AppThemeProvider + useThemeColors hook
  - Light/dark/fixed color token definitions
  - Migrate ~60 files across all screens to use theme colors
- Set userInterfaceStyle to "automatic" for system dark mode
2026-03-17 22:19:46 +00:00

53 lines
1.6 KiB
TypeScript

import React from "react";
import { StatusBar, Platform, View } from "react-native";
import { WebView } from "react-native-webview";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import { useNavigation } from "@react-navigation/native";
import { useThemeColors } from "@/lib/theme";
import { BigButton } from "./atom/BigButton";
export default function TrainBase({ route }) {
if (!route.params) {
return null;
}
const { info } = route.params;
const { goBack } = useNavigation();
const { colors } = useThemeColors();
const jss = `
document.getElementById('Footer').style.display = 'none';
${
Platform.OS == "ios"
? `document.getElementsByTagName("html")[0].style['font-size'] = '11px';`
: ""
}
true;`;
return (
<View style={{ height: "100%" }}>
{Platform.OS == "ios" && <StatusBar barStyle="dark-content" />}
<WebView
useWebKit
source={{ uri: "https://train.jr-shikoku.co.jp/" + info }}
originWhitelist={[
"https://train.jr-shikoku.co.jp",
"https://train.jr-shikoku.co.jp/sp.html",
]}
onMessage={() => {
// 必要に応じてメッセージ処理を実装
}}
mixedContentMode={"compatibility"}
javaScriptEnabled
injectedJavaScript={jss}
setSupportMultipleWindows
/>
<BigButton
style={{ borderColor: colors.border }}
tS={{ color: colors.text }}
string="閉じる"
onPress={goBack}
>
<MaterialCommunityIcons name="close" color={colors.text} size={30} />
</BigButton>
</View>
);
}