-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
45 lines (40 loc) · 1.14 KB
/
index.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* @format
*/
import { AppRegistry, SafeAreaView, useColorScheme } from 'react-native';
import {
Provider as PaperProvider,
MD3DarkTheme,
MD3LightTheme,
} from 'react-native-paper';
import App from './App';
import { name as appName } from './app.json';
import React from 'react';
import { getStyles } from './utils';
import 'react-native-url-polyfill/auto';
// eslint-disable-next-line import/no-unused-modules
export default function Main() {
/* Selecting Theme based on system */
const sysTheme = useColorScheme();
const isDarkTheme = sysTheme === 'dark';
const baseTheme = isDarkTheme ? MD3DarkTheme : MD3LightTheme;
const styles = getStyles(baseTheme);
const theme = {
...baseTheme,
colors: {
...baseTheme.colors,
primary: '#e91e62',
onPrimary: '#ffffff',
buttonColor: '#e91e62',
},
};
return (
<PaperProvider theme={theme}>
<SafeAreaView style={[styles.flex_0, styles.background_primary]} />
<SafeAreaView style={[styles.flex_1, styles.background_color]}>
<App />
</SafeAreaView>
</PaperProvider>
);
}
AppRegistry.registerComponent(appName, () => Main);