forked from ufosc/Alarm-Clock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
30 lines (26 loc) · 1.06 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import React, { useState } from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
import HomeScreen from './screens/Home';
import Setting from './screens/Setting';
import AlarmFeatures from './screens/AlarmFeatures';
const Stack = createNativeStackNavigator();
export default function App() {
const [isDarkMode, setIsDarkMode] = useState(false);
const toggleSwitch = () => setIsDarkMode(!isDarkMode);
return (
<NavigationContainer>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen name="Home">
{props => <HomeScreen {...props} isDarkMode={isDarkMode} />}
</Stack.Screen>
<Stack.Screen name="Setting">
{props => <Setting {...props} isDarkMode={isDarkMode} toggleSwitch={toggleSwitch} />}
</Stack.Screen>
<Stack.Screen name="AlarmFeatures">
{props => <AlarmFeatures {...props} isDarkMode={isDarkMode} />}
</Stack.Screen>
</Stack.Navigator>
</NavigationContainer>
);
}