-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
111 lines (99 loc) · 2.46 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
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
import React from 'react';
import {DarkTheme, DefaultTheme} from '@react-navigation/native';
import AsyncStorage from '@react-native-async-storage/async-storage';
export const ThemeColors = {
darkMode: {
background: '#000000',
menubarPrimary: '#161618',
menubarSecondory: '#212124',
primaryText: '#FFFFFF',
secondaryText: '#818181',
},
lightMode: {
background: '#FFFFFF',
menubarPrimary: '#FFFFFF',
menubarSecondory: '#FFFFFF',
inputLabelColor: '#423F3F',
// input
inputBorder:'#E8F0FE',
inputBackground:'#f7f6f7',
// others
headerBlack: '#231F20',
subHeaderBlack: '#202124',
text: '#5F6368',
placeholderTextColor:'#9D9D9D'
},
common: {
blue: '#276EF1',
red: '#eb413e',
tabInactive: '#00000029',
tabactive: '#3C4043',
placeholderTextColor: '#5F6368',
darkShadow:'#00000029'
},
white: '#FFFFFF',
blue: '#276EF1',
// black:
headerBlack: '#231F20',
subHeaderBlack: '#202124',
black: '#000',
text: '#5F6368',
buttonBorder: '#E8F0FE',
tabInactive: '#00000029',
tabactive: '#3C4043',
red: '#eb413e',
inputLabelColor: '#423F3F',
light: {
text: '#000000',
background: '#FCFCFC',
borderColor: '#E8F0FE',
inputText: '#3C4043',
inputLabelColor: '#423F3F',
},
dark: {
text: '#fff',
background: '#000000',
headerColor: '#161618',
borderColor: '#5F6368',
secondaryTextColor: '#818181',
},
primary: '#FCFCFC',
textGray: '#5F6368',
placeholderTextColor: '#5F6368',
redActive: '#B2121B',
redInactive: '#D7242E',
green: '#05A357',
};
// native base
import {extendTheme} from 'native-base';
export const NativeBaseTheme = extendTheme({
colors: ThemeColors,
config: {
useSystemColorMode: false,
initialColorMode: 'light',
},
});
// Define the colorModeManager,
// here we are using react-native-async-storage (https://react-native-async-storage.github.io/async-storage/)
export const colorModeManager = {
get: async () => {
try {
let val = await AsyncStorage.getItem('@color-mode');
return val === 'dark' ? 'dark' : 'light';
} catch (e) {
return 'light';
}
},
set: async value => {
try {
await AsyncStorage.setItem('@color-mode', value);
} catch (e) {}
},
};
// navigation
export const NavigationDefaultTheme = DefaultTheme;
export const NavigationDarkTheme = DarkTheme;
export const PreferencesContext = React.createContext({
toggleTheme: () => {},
isThemeDark: false,
});