move modal options to container

This commit is contained in:
ppc
2025-01-13 21:17:51 +00:00
parent 9c8c4fd286
commit b33670d849
2 changed files with 4 additions and 9 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import React from "react";
import {StatusBar} from "expo-status-bar";
import {useColorScheme, View} from "react-native";
import {Server, WalletCards} from "lucide-react-native";
import {Platform, useColorScheme, View} from "react-native";
import {NavigationContainer} from "@react-navigation/native";
import {SafeAreaProvider} from "react-native-safe-area-context";
import {MD3Colors} from "react-native-paper/lib/typescript/types";
@@ -121,7 +121,7 @@ export default function AppRoot() {
<Stack.Group screenOptions={{presentation: "modal"}}>
<Stack.Screen name="add-server" component={ServerAddModal} options={{title: "Add Server"}}/>
<Stack.Screen name="add-card" component={CardAddModal} options={{title: "Add Card"}}/>
<Stack.Screen name="add-card" component={CardAddModal} options={{title: "Add Card", headerShown: Platform.OS !== 'ios'}}/>
<Stack.Screen name="edit-card" component={CardEditorModal} options={{title: "Edit Card"}}/>
</Stack.Group>
</Stack.Navigator>
+2 -7
View File
@@ -1,6 +1,7 @@
import NfcManager from "react-native-nfc-manager";
import React, {useEffect, useState} from "react";
import {Platform, TouchableOpacity, View} from "react-native";
import React, {useEffect, useLayoutEffect, useState} from "react";
import {createNativeStackNavigator} from "@react-navigation/native-stack";
import {Card, Paragraph, Text, Title, useTheme} from "react-native-paper";
@@ -26,12 +27,6 @@ function CardAddMethodSelector({navigation}) {
const theme = useTheme();
const [nfcSupported, setNfcSupported] = useState<boolean | null>(null);
useLayoutEffect(() => {
navigation.setOptions({
headerShown: false
});
}, []);
useEffect(() => {
NfcManager.isSupported().then(setNfcSupported);
}, []);