また最適化

This commit is contained in:
harukin-OneMix4 2024-01-09 18:31:24 +09:00
parent 87129c6815
commit 65080e68f2
3 changed files with 33 additions and 5 deletions

View File

@ -266,10 +266,14 @@ export const EachTrainInfo = (props) => {
ref={actionSheetRef} ref={actionSheetRef}
drawUnderStatusBar={false} drawUnderStatusBar={false}
isModal={Platform.OS == "ios"} isModal={Platform.OS == "ios"}
containerStyle={{ containerStyle={
Platform.OS == "android"
? {
paddingBottom: insets.bottom, paddingBottom: insets.bottom,
}} }
useBottomSafeAreaPadding={true} : {}
}
useBottomSafeAreaPadding={Platform.OS == "android"}
> >
<View <View
style={{ style={{

View File

@ -11,18 +11,28 @@ import {
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons"; import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
import ActionSheet, { useScrollHandlers } from "react-native-actions-sheet"; import ActionSheet, { useScrollHandlers } from "react-native-actions-sheet";
import LottieView from "lottie-react-native"; import LottieView from "lottie-react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { useTrainDelayData } from "../../stateBox/useTrainDelayData"; import { useTrainDelayData } from "../../stateBox/useTrainDelayData";
export const JRSTraInfo = () => { export const JRSTraInfo = () => {
const { getTime, delayData, loadingDelayData, setLoadingDelayData } = const { getTime, delayData, loadingDelayData, setLoadingDelayData } =
useTrainDelayData(); useTrainDelayData();
const actionSheetRef = useRef(null); const actionSheetRef = useRef(null);
const scrollHandlers = useScrollHandlers("scrollview-1", actionSheetRef); const scrollHandlers = useScrollHandlers("scrollview-1", actionSheetRef);
const insets = useSafeAreaInsets();
return ( return (
<ActionSheet <ActionSheet
gestureEnabled gestureEnabled
CustomHeaderComponent={<></>} CustomHeaderComponent={<></>}
ref={actionSheetRef} ref={actionSheetRef}
isModal={Platform.OS == "ios"} isModal={Platform.OS == "ios"}
containerStyle={
Platform.OS == "android"
? {
paddingBottom: insets.bottom,
}
: {}
}
useBottomSafeAreaPadding={Platform.OS == "android"}
> >
<View <View
style={{ style={{

View File

@ -2,6 +2,7 @@ import React, { useState, useEffect } from "react";
import { View, Linking, Text, TouchableOpacity, Platform } from "react-native"; import { View, Linking, Text, TouchableOpacity, Platform } from "react-native";
import AutoHeightImage from "react-native-auto-height-image"; import AutoHeightImage from "react-native-auto-height-image";
import { FontAwesome, Foundation, Ionicons } from "@expo/vector-icons"; import { FontAwesome, Foundation, Ionicons } from "@expo/vector-icons";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import ActionSheet from "react-native-actions-sheet"; import ActionSheet from "react-native-actions-sheet";
import Sign from "../../components/駅名表/Sign"; import Sign from "../../components/駅名表/Sign";
@ -44,8 +45,21 @@ export const StationDeteilView = (props) => {
(currentStation[0].StationTimeTable.match(".pdf") (currentStation[0].StationTimeTable.match(".pdf")
? getPDFViewURL(currentStation[0].StationTimeTable) ? getPDFViewURL(currentStation[0].StationTimeTable)
: currentStation[0].StationTimeTable); : currentStation[0].StationTimeTable);
const insets = useSafeAreaInsets();
return ( return (
<ActionSheet gestureEnabled CustomHeaderComponent={<></>} isModal={false}> <ActionSheet
gestureEnabled
CustomHeaderComponent={<></>}
isModal={Platform.OS == "ios"}
containerStyle={
Platform.OS == "android"
? {
paddingBottom: insets.bottom,
}
: {}
}
useBottomSafeAreaPadding={Platform.OS == "android"}
>
<View <View
key={currentStation} key={currentStation}
style={{ style={{