-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.tsx
126 lines (120 loc) · 2.74 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import { StatusBar } from 'expo-status-bar'
import * as React from 'react'
import { AppRegistry, Platform } from 'react-native'
import 'react-native-gesture-handler'
import {
MD2LightTheme,
Provider as PaperProvider,
configureFonts,
} from 'react-native-paper'
import { expo } from './app.json'
import App from './src/App'
import IphoneDummy from './src/components/IphoneDummy'
const fontConfig = {
web: {
regular: {
fontFamily: 'Avenir',
fontWeight: 'normal',
},
medium: {
fontFamily: 'Avenir',
fontWeight: 600,
},
light: {
fontFamily: 'Avenir',
fontWeight: 'light',
},
thin: {
fontFamily: 'Avenir',
fontWeight: 'thin',
},
},
ios: {
regular: {
fontFamily: 'sans-serif',
fontWeight: 'normal',
},
medium: {
fontFamily: 'sans-serif-medium',
fontWeight: 'normal',
},
light: {
fontFamily: 'sans-serif-light',
fontWeight: 'normal',
},
thin: {
fontFamily: 'sans-serif-thin',
fontWeight: 'normal',
},
},
android: {
regular: {
fontFamily: 'sans-serif',
fontWeight: 'normal',
},
medium: {
fontFamily: 'sans-serif-medium',
fontWeight: 'normal',
},
light: {
fontFamily: 'sans-serif-light',
fontWeight: 'normal',
},
thin: {
fontFamily: 'sans-serif-thin',
fontWeight: 'normal',
},
},
} as const
const theme = {
...MD2LightTheme,
roundness: 4,
colors: {
...MD2LightTheme.colors,
background: '#FAF7F0', //beige
surface: '#FAF7F0',
surfaceVariant: '#EBFAEF',
// surfaceVariant: '#FFF',
primary: '#1C3BA0', //mörkblå
accent: '#EBFAEF',
// : '#666259', //mörkgrå
// primary: '#000', // morotsfärg: #FFA726
// accent: '#333', // blå: #29B6F6
// Add any other color changes here
iconInactive: '#666259', //mörkgrå
secondary: '#FFFFFF',
secondaryVariant: '#FFFFFF',
text: '#1B1918',
placeholder: '#1B1918',
},
fonts: configureFonts({ config: fontConfig }),
}
export default function Main() {
/*
const [notification, setNotification] = React.useState({} as Notification)
React.useEffect(() => {
const lastNotification = notifications.at(-1)
if (
lastNotification &&
new Date(lastNotification?.data.date).valueOf() > Date.now() - 10000
) {
setNotificationVisible(true)
setNotification(lastNotification)
}
}, [notifications])*/
return (
<PaperProvider theme={theme}>
{Platform.OS === 'web' ? (
<IphoneDummy>
<App />
</IphoneDummy>
) : (
<>
<StatusBar />
<App />
</>
)}
</PaperProvider>
)
}
AppRegistry.registerComponent(expo.name, () => Main)