frontend: drop dark mode entirely
Pedro Lucas Porcellis porcellis@eletrotupi.com · 5 months ago
41bda0cf25be87bad882ce8b3ddbe82a45ed1e38 Browse filesParents
e767eacChanged files
2
Additions
+7
Deletions
-30
frontend/constants/theme.ts
1 1
/**
2 2
* Below are the colors that are used in the app. The colors are defined in the light and dark mode.
3 3
* There are many other ways to style your app. For example, [Nativewind](https://www.nativewind.dev/), [Tamagui](https://tamagui.dev/), [unistyles](https://reactnativeunistyles.vercel.app), etc.
4 4
*/
5 5
6 6
import { Platform } from 'react-native';
7 7
8 -
const tintColorLight = '#0a7ea4';
9 -
const tintColorDark = '#fff';
8 +
const tintColorLight = '#12ED5C';
9 +
const tintColorSecondary = '#618A70';
10 +
const black = '#121712';
10 11
11 12
export const Colors = {
12 13
light: {
13 -
text: '#11181C',
14 +
text: '#121712',
14 15
background: '#fff',
15 16
tint: tintColorLight,
16 17
icon: '#687076',
17 -
tabIconDefault: '#687076',
18 -
tabIconSelected: tintColorLight,
19 -
},
20 -
dark: {
21 -
text: '#ECEDEE',
22 -
background: '#151718',
23 -
tint: tintColorDark,
24 -
icon: '#9BA1A6',
25 -
tabIconDefault: '#9BA1A6',
26 -
tabIconSelected: tintColorDark,
18 +
tabIconDefault: tintColorSecondary,
19 +
tabIconSelected: black,
27 20
},
28 21
};
29 22
30 23
export const Fonts = Platform.select({
31 -
ios: {
32 -
/** iOS `UIFontDescriptorSystemDesignDefault` */
33 -
sans: 'system-ui',
34 -
/** iOS `UIFontDescriptorSystemDesignSerif` */
35 -
serif: 'ui-serif',
36 -
/** iOS `UIFontDescriptorSystemDesignRounded` */
37 -
rounded: 'ui-rounded',
38 -
/** iOS `UIFontDescriptorSystemDesignMonospaced` */
39 -
mono: 'ui-monospace',
40 -
},
41 24
default: {
42 25
sans: 'normal',
43 26
serif: 'serif',
44 27
rounded: 'normal',
45 28
mono: 'monospace',
46 -
},
47 -
web: {
48 -
sans: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
49 -
serif: "Georgia, 'Times New Roman', serif",
50 -
rounded: "'SF Pro Rounded', 'Hiragino Maru Gothic ProN', Meiryo, 'MS PGothic', sans-serif",
51 -
mono: "SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
52 29
},
53 30
});
frontend/hooks/use-theme-color.ts
1 1
/**
2 2
* Learn more about light and dark modes:
3 3
* https://docs.expo.dev/guides/color-schemes/
4 4
*/
5 5
8 8
9 9
export function useThemeColor(
10 10
props: { light?: string; dark?: string },
11 11
colorName: keyof typeof Colors.light & keyof typeof Colors.dark
12 12
) {
13 -
const theme = useColorScheme() ?? 'light';
13 +
const theme = 'light';
14 14
const colorFromProps = props[theme];
15 15
16 16
if (colorFromProps) {
17 17
return colorFromProps;
18 18
} else {
19 19
return Colors[theme][colorName];
20 20
}
21 21
}