-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
44 lines (37 loc) · 1.17 KB
/
App.tsx
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { StatusBar } from 'expo-status-bar';
import { useState } from 'react';
import { SafeAreaView, StyleSheet } from 'react-native';
import ButtonsRow from './components/ButtonsRow';
import SettingsModal from './components/SettingsModal';
import Timer from './components/Timer';
import { useTheme } from './hooks';
const App = () => {
const theme = useTheme();
const styles = createStyles(theme);
const [start, setStart] = useState(false);
const [modalVisible, setModalVisible] = useState(true);
return (
<SafeAreaView style={styles.container}>
<Timer start={start} />
<ButtonsRow
startedTimer={start}
setStartedTimer={setStart}
modalVisible={modalVisible}
setModalVisible={setModalVisible}
/>
<SettingsModal visible={modalVisible} setVisible={setModalVisible} />
<StatusBar style="light" backgroundColor="transparent" />
</SafeAreaView>
);
};
const createStyles = (theme: ReturnType<typeof useTheme>) => {
return StyleSheet.create({
container: {
flex: 1,
backgroundColor: theme.backgroundColor,
alignItems: 'center',
justifyContent: 'center',
},
});
};
export default App;