-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
37 lines (31 loc) · 936 Bytes
/
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
import React from 'react';
import { useColorScheme, Dimensions, StyleSheet } from 'react-native';
import Theme from './src/Theme';
import { Container } from './src/components/Container';
import { Text } from './src/components/Text';
import Sun from './src/sources/sun.svg';
import Moon from './src/sources/moon.svg';
const { width } = Dimensions.get('window');
const App = () => {
const appearanceMode = useColorScheme();
return (
<Theme>
<Container>
{appearanceMode === 'light' ? (
<Sun width={width * 0.25} height={width * 0.25} fill={'#ff9800'} />
) : (
<Moon width={width * 0.25} height={width * 0.25} fill={'#6200ee'} />
)}
<Text style={styles.text}>Modo {appearanceMode}</Text>
</Container>
</Theme>
);
};
const styles = StyleSheet.create({
text: {
fontWeight: 'bold',
fontSize: 24,
marginVertical: 16,
},
});
export default App;