-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtamagui.config.ts
More file actions
185 lines (166 loc) · 3.91 KB
/
tamagui.config.ts
File metadata and controls
185 lines (166 loc) · 3.91 KB
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
import { createAnimations } from '@tamagui/animations-react-native';
import { createInterFont } from '@tamagui/font-inter';
import { createMedia } from '@tamagui/react-native-media-driver';
import { shorthands } from '@tamagui/shorthands';
import { themes, tokens } from '@tamagui/themes';
import {
createTamagui,
styled,
SizableText,
H1,
H2,
YStack,
Button as ButtonTamagui,
} from 'tamagui';
// FlexpaHealth Colors based on the screenshot
const colors = {
flexpaBlue: '#00a3ae', // The teal/blue color from Flexpa logo
flexpaGreen: '#88d16c', // The green accent color
flexpaLightGreen: '#e8f6e5', // Light green for backgrounds
flexpaBlack: '#333333', // Dark text color
flexpaGray: '#666666', // Secondary text color
white: '#FFFFFF',
};
const animations = createAnimations({
bouncy: {
damping: 10,
mass: 0.9,
stiffness: 100,
type: 'spring',
},
lazy: {
damping: 20,
type: 'spring',
stiffness: 60,
},
quick: {
damping: 20,
mass: 1.2,
stiffness: 250,
type: 'spring',
},
});
const headingFont = createInterFont();
const bodyFont = createInterFont();
export const Container = styled(YStack, {
flex: 1,
padding: 24,
backgroundColor: colors.white,
});
export const Main = styled(YStack, {
flex: 1,
justifyContent: 'space-between',
maxWidth: 960,
});
export const Title = styled(H1, {
color: colors.flexpaBlack,
size: '$7',
fontWeight: 'bold',
});
export const Subtitle = styled(SizableText, {
color: colors.flexpaGray,
size: '$4',
});
export const SectionTitle = styled(H2, {
color: colors.flexpaBlack,
size: '$5',
fontWeight: '600',
});
export const Button = styled(ButtonTamagui, {
backgroundColor: colors.flexpaBlue,
borderRadius: 28,
hoverStyle: {
backgroundColor: '#008f99', // Darker teal for hover
},
pressStyle: {
backgroundColor: '#008f99', // Darker teal for press
},
maxWidth: 500,
// Shadows
shadowColor: '#000',
shadowOffset: {
height: 2,
width: 0,
},
shadowOpacity: 0.15,
shadowRadius: 3.84,
// Button text
color: colors.white,
fontWeight: '600',
fontSize: 16,
});
export const GreenButton = styled(ButtonTamagui, {
backgroundColor: colors.flexpaGreen,
borderRadius: 28,
hoverStyle: {
backgroundColor: '#75c257', // Darker green for hover
},
pressStyle: {
backgroundColor: '#75c257', // Darker green for press
},
maxWidth: 500,
// Shadows
shadowColor: '#000',
shadowOffset: {
height: 2,
width: 0,
},
shadowOpacity: 0.15,
shadowRadius: 3.84,
// Button text
color: colors.white,
fontWeight: '600',
fontSize: 16,
});
const config = createTamagui({
light: {
color: {
background: colors.white,
text: colors.flexpaBlack,
},
},
defaultFont: 'body',
animations,
shouldAddPrefersColorThemes: true,
themeClassNameOnRoot: true,
shorthands,
fonts: {
body: bodyFont,
heading: headingFont,
},
themes,
tokens: {
...tokens,
color: {
...tokens.color,
flexpaBlue: colors.flexpaBlue,
flexpaGreen: colors.flexpaGreen,
flexpaLightGreen: colors.flexpaLightGreen,
flexpaBlack: colors.flexpaBlack,
flexpaGray: colors.flexpaGray,
},
},
media: createMedia({
xs: { maxWidth: 660 },
sm: { maxWidth: 800 },
md: { maxWidth: 1020 },
lg: { maxWidth: 1280 },
xl: { maxWidth: 1420 },
xxl: { maxWidth: 1600 },
gtXs: { minWidth: 660 + 1 },
gtSm: { minWidth: 800 + 1 },
gtMd: { minWidth: 1020 + 1 },
gtLg: { minWidth: 1280 + 1 },
short: { maxHeight: 820 },
tall: { minHeight: 820 },
hoverNone: { hover: 'none' },
pointerCoarse: { pointer: 'coarse' },
}),
});
type AppConfig = typeof config;
// Enable auto-completion of props shorthand (ex: jc="center") for Tamagui templates.
// Docs: https://tamagui.dev/docs/core/configuration
declare module 'tamagui' {
interface TamaguiCustomConfig extends AppConfig {}
}
export default config;