-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.jsx
More file actions
22 lines (20 loc) · 752 Bytes
/
App.jsx
File metadata and controls
22 lines (20 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// App.jsx
import React, { useState } from 'react';
import { PaperProvider } from 'react-native-paper';
import { NavigationContainer } from '@react-navigation/native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { AppNavigator } from './src/navigation/AppNavigator';
import { lightTheme, darkTheme } from './src/theme/theme';
export default function App() {
const [isDark, setIsDark] = useState(false);
const theme = isDark ? darkTheme : lightTheme;
return (
<SafeAreaProvider>
<PaperProvider theme={theme}>
<NavigationContainer>
<AppNavigator toggleTheme={() => setIsDark(d => !d)} isDark={isDark} />
</NavigationContainer>
</PaperProvider>
</SafeAreaProvider>
);
}