SafeAreaContextを適用

This commit is contained in:
harukin-OneMix4 2024-01-09 17:16:20 +09:00
parent b54f2f6f7e
commit 263cb750ce
2 changed files with 23 additions and 16 deletions

3
App.js
View File

@ -29,6 +29,7 @@ import { AllTrainDiagramProvider } from "./stateBox/useAllTrainDiagram.js";
import { SheetProvider } from "react-native-actions-sheet"; import { SheetProvider } from "react-native-actions-sheet";
import "./components/ActionSheetComponents/sheets.js"; import "./components/ActionSheetComponents/sheets.js";
import { TrainDelayDataProvider } from "./stateBox/useTrainDelayData.js"; import { TrainDelayDataProvider } from "./stateBox/useTrainDelayData.js";
import { SafeAreaProvider } from "react-native-safe-area-context";
LogBox.ignoreLogs([ LogBox.ignoreLogs([
"ViewPropTypes will be removed", "ViewPropTypes will be removed",
"ColorPropType will be removed", "ColorPropType will be removed",
@ -43,6 +44,7 @@ if (Platform.OS === "android") {
export default function App() { export default function App() {
useEffect(() => UpdateAsync(), []); useEffect(() => UpdateAsync(), []);
return ( return (
<SafeAreaProvider>
<FavoriteStationProvider> <FavoriteStationProvider>
<TrainDelayDataProvider> <TrainDelayDataProvider>
<CurrentTrainProvider> <CurrentTrainProvider>
@ -58,6 +60,7 @@ export default function App() {
</CurrentTrainProvider> </CurrentTrainProvider>
</TrainDelayDataProvider> </TrainDelayDataProvider>
</FavoriteStationProvider> </FavoriteStationProvider>
</SafeAreaProvider>
); );
} }
export function AppContainer() { export function AppContainer() {

View File

@ -15,6 +15,7 @@ import ActionSheet, {
SheetManager, SheetManager,
useScrollHandlers, useScrollHandlers,
} from "react-native-actions-sheet"; } from "react-native-actions-sheet";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { AS } from "../../storageControl"; import { AS } from "../../storageControl";
import LottieView from "lottie-react-native"; import LottieView from "lottie-react-native";
import trainList from "../../assets/originData/trainList"; import trainList from "../../assets/originData/trainList";
@ -65,7 +66,7 @@ export const EachTrainInfo = (props) => {
}) })
.catch((d) => AS.setItem("trainPositionSwitch", "false")); .catch((d) => AS.setItem("trainPositionSwitch", "false"));
}, []); }, []);
const insets = useSafeAreaInsets();
const getStationData = (stationName) => { const getStationData = (stationName) => {
const Stations = stationList.map((a) => const Stations = stationList.map((a) =>
a.filter((d) => d.StationName == stationName) a.filter((d) => d.StationName == stationName)
@ -264,6 +265,9 @@ export const EachTrainInfo = (props) => {
CustomHeaderComponent={<></>} CustomHeaderComponent={<></>}
ref={actionSheetRef} ref={actionSheetRef}
drawUnderStatusBar={false} drawUnderStatusBar={false}
containerStyle={{
paddingBottom: insets.bottom,
}}
> >
<View <View
style={{ style={{