|
1 |
| -import Layout from "./components/Layout"; |
2 | 1 | import { useDeviceContext, useAppColorScheme } from 'twrnc';
|
3 |
| -import Home from "./screens/Home"; |
4 |
| -import tw from "twrnc" |
5 |
| -import { Text, TouchableOpacity, View } from "react-native"; |
| 2 | +import tw from 'twrnc'; |
| 3 | +import { Text, TouchableOpacity } from 'react-native'; |
6 | 4 | import { NavigationContainer } from '@react-navigation/native';
|
7 | 5 | import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
8 |
| -import About from "./screens/About"; |
9 |
| -import { Button } from "react-native-web"; |
| 6 | +import About from './screens/About'; |
| 7 | +import Home from './screens/Home'; |
| 8 | +import Layout from './components/Layout'; |
10 | 9 |
|
11 | 10 | const Stack = createNativeStackNavigator();
|
12 | 11 |
|
13 | 12 | export default function App() {
|
14 | 13 | useDeviceContext(tw, { withDeviceColorScheme: false });
|
15 |
| - const [colorScheme, toggleColorScheme, setColorScheme] = useAppColorScheme(tw); |
| 14 | + const [, toggleColorScheme] = useAppColorScheme(tw); |
16 | 15 |
|
17 | 16 | return (
|
18 | 17 | <Layout>
|
19 | 18 | <TouchableOpacity onPress={toggleColorScheme}>
|
20 | 19 | <Text
|
21 |
| - style={tw`bg-gray-200 dark:bg-gray-900 text-black dark:text-white |
| 20 | + style={tw`bg-gray-200 dark:bg-gray-900 text-black dark:text-white |
22 | 21 | capitalize p-2 mt-24 text-center`}
|
23 | 22 | >
|
24 | 23 | toggle theme
|
25 | 24 | </Text>
|
26 | 25 | </TouchableOpacity>
|
27 |
| - {/* navigation container */} |
28 | 26 | <NavigationContainer>
|
29 |
| - <Stack.Navigator screenOptions={{ |
30 |
| - headerRight: () => ( |
31 |
| - <TouchableOpacity onPress={toggleColorScheme}> |
32 |
| - <Text |
33 |
| - style={tw`bg-gray-200 dark:bg-gray-900 text-black dark:text-white |
| 27 | + <Stack.Navigator |
| 28 | + screenOptions={{ |
| 29 | + headerRight: () => ( |
| 30 | + <TouchableOpacity onPress={toggleColorScheme}> |
| 31 | + <Text |
| 32 | + style={tw`bg-gray-200 dark:bg-gray-900 text-black dark:text-white |
34 | 33 | capitalize p-2 rounded`}
|
35 |
| - > |
36 |
| - toggle theme |
37 |
| - </Text> |
38 |
| - </TouchableOpacity> |
39 |
| - ), |
40 |
| - }}> |
| 34 | + > |
| 35 | + toggle theme |
| 36 | + </Text> |
| 37 | + </TouchableOpacity> |
| 38 | + ), |
| 39 | + }} |
| 40 | + > |
41 | 41 | <Stack.Screen name="Home" component={Home} />
|
42 | 42 | <Stack.Screen name="About" component={About} />
|
43 | 43 | </Stack.Navigator>
|
44 | 44 | </NavigationContainer>
|
45 | 45 | </Layout>
|
46 |
| - |
47 |
| - // <Layout> |
48 |
| - // {/* <TouchableOpacity onPress={toggleColorScheme}> |
49 |
| - // <Text style={tw`py-2 px-3 bg-blue-400 dark:bg-gray-800 |
50 |
| - // text-black dark:text-white rounded`}>Switch Color Scheme</Text> |
51 |
| - // </TouchableOpacity> */} |
52 |
| - // {/* <NavigationContainer> |
53 |
| - // <Stack.Navigator initialRouteName="Home"> |
54 |
| - // <Stack.Screen name="Home" component={Home} /> |
55 |
| - // <Stack.Screen name="About" component={About} /> |
56 |
| - // </Stack.Navigator> |
57 |
| - // </NavigationContainer> */} |
58 |
| - // </Layout> |
59 | 46 | );
|
60 | 47 | }
|
0 commit comments