diff --git a/apps/src/tests/Test2231.tsx b/apps/src/tests/Test2231.tsx deleted file mode 100644 index 9449ffc3ff..0000000000 --- a/apps/src/tests/Test2231.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { createNativeStackNavigator } from '@react-navigation/native-stack'; -import React, { useLayoutEffect, useState } from 'react'; -import { View } from 'react-native'; - -import { SettingsSwitch, Square } from '../shared'; -import { NavigationContainer } from '@react-navigation/native'; - -const SettingsScreen = ({ navigation }: any) => { - const [hasLeftItem, setHasLeftItem] = useState(false); - - const square1 = (props: { tintColor?: string }) => ( - - {hasLeftItem && } - - - ); - - const square2 = (props: { tintColor?: string }) => ( - - ); - - useLayoutEffect(() => { - navigation.setOptions({ - headerRight: square1, - headerTitle: undefined, - headerLeft: hasLeftItem ? square2 : undefined, - headerBackTitleVisible: false, - }); - }, [navigation, hasLeftItem]); - - return ( - - ); -}; - -const Stack = createNativeStackNavigator(); - -const App = () => ( - - - - - -); - -export default App; diff --git a/apps/src/tests/Test432.tsx b/apps/src/tests/Test432.tsx index 8274bfd299..f58bd3b752 100644 --- a/apps/src/tests/Test432.tsx +++ b/apps/src/tests/Test432.tsx @@ -1,37 +1,36 @@ -import { Pressable, View, Button, Text } from 'react-native'; - -import { NavigationContainer, useNavigation } from '@react-navigation/native'; +import { View, Button, Text } from 'react-native'; +import { NavigationContainer } from '@react-navigation/native'; import { NativeStackScreenProps, createNativeStackNavigator, } from '@react-navigation/native-stack'; -import React, { useCallback } from 'react'; +import React, { useEffect, useLayoutEffect, useState } from 'react'; +import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; +import { Square } from '../shared'; -type RootStackParamList = { +type StackParamList = { Home: undefined; + Details: undefined; Settings: undefined; + Info: undefined; }; -type RootStackScreenProps = - NativeStackScreenProps; -const HomeScreen = ({ navigation }: RootStackScreenProps<'Home'>) => { - const [x, setX] = React.useState(false); - React.useEffect(() => { - navigation.setOptions({ - headerBackVisible: !x, - headerRight: x - ? () => ( - - ) - : () => ( - - ), - }); - }, [navigation, x]); +type StackScreenProps = NativeStackScreenProps< + StackParamList, + T +>; +const HomeScreen = ({ navigation }: StackScreenProps<'Home'>) => { return ( -