@fadyshawky/react-native-magic 1.0.8 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +7 -0
- package/package.json +1 -1
- package/template/App.tsx +30 -9
- package/template/package-lock.json +181 -123
- package/template/package.json +2 -0
- package/template/src/common/ImageResources.g.ts +3 -5
- package/template/src/common/components/Background.tsx +66 -28
- package/template/src/common/components/Cards.tsx +116 -0
- package/template/src/common/components/Container.tsx +145 -0
- package/template/src/common/components/FlatListWrapper.tsx +1 -0
- package/template/src/common/components/ImageCropPickerButton.tsx +1 -1
- package/template/src/common/components/OTPInput.tsx +107 -0
- package/template/src/common/components/PhotoTakingButton.tsx +1 -4
- package/template/src/common/components/PrimaryButton.tsx +171 -157
- package/template/src/common/components/RTLAwareText.tsx +42 -0
- package/template/src/common/components/RTLAwareView.tsx +179 -0
- package/template/src/common/components/RadioButton.tsx +1 -3
- package/template/src/common/components/RadioIcon.tsx +1 -2
- package/template/src/common/components/SearchBar.tsx +179 -0
- package/template/src/common/components/Separator.tsx +7 -4
- package/template/src/common/components/TouchablePlatform.tsx +1 -3
- package/template/src/common/components/TryAgain.tsx +3 -3
- package/template/src/common/helpers/inAppReviewHelper.ts +0 -1
- package/template/src/common/helpers/stringsHelpers.ts +10 -0
- package/template/src/common/hooks/useFlatListActions.ts +1 -1
- package/template/src/common/localization/LocalizationProvider.tsx +152 -0
- package/template/src/common/localization/README.md +488 -0
- package/template/src/common/localization/localization.ts +12 -0
- package/template/src/common/localization/translations/profileLocalization.ts +24 -0
- package/template/src/common/validations/errorValidations.ts +1 -6
- package/template/src/common/validations/examples/TextInputWithValidation.tsx +229 -0
- package/template/src/common/validations/index.ts +28 -0
- package/template/src/common/validations/regex.js +83 -0
- package/template/src/common/validations/regexValidator.ts +240 -0
- package/template/src/common/validations/validationConstants.ts +2 -2
- package/template/src/core/api/errorHandler.ts +39 -0
- package/template/src/core/api/responseHandlers.ts +1 -26
- package/template/src/core/api/serverHeaders.ts +13 -23
- package/template/src/core/store/app/appSlice.ts +1 -2
- package/template/src/core/theme/ThemeProvider.tsx +63 -0
- package/template/src/core/theme/colors.ts +31 -42
- package/template/src/core/theme/commonConsts.ts +1 -1
- package/template/src/core/theme/commonStyles.ts +267 -210
- package/template/src/core/theme/fonts.ts +17 -1
- package/template/src/core/theme/scaling.ts +101 -0
- package/template/src/core/theme/themes.ts +214 -0
- package/template/src/core/theme/types.ts +51 -0
- package/template/src/navigation/AuthStack.tsx +25 -30
- package/template/src/navigation/HeaderComponents.tsx +18 -58
- package/template/src/navigation/MainNavigation.tsx +5 -6
- package/template/src/navigation/MainStack.tsx +3 -28
- package/template/src/navigation/RootNavigation.tsx +1 -7
- package/template/src/navigation/TabBar.tsx +2 -2
- package/template/src/navigation/TopTabBar.tsx +1 -1
- package/template/src/screens/Login/Login.tsx +3 -3
- package/template/src/screens/home/components/CarouselSection.tsx +7 -8
- package/template/src/screens/home/components/FeaturedCarousel.tsx +5 -6
- package/template/src/screens/registration/RegistrationScreen.tsx +2 -2
- package/template/src/screens/resetPassword/ForgotPasswordScreen.tsx +2 -2
- package/template/src/utils/stringBuilder.js +25 -0
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import axios from 'axios';
|
|
3
|
-
import {AxiosDefaults} from 'axios';
|
|
1
|
+
import axios, {AxiosDefaults} from 'axios';
|
|
4
2
|
|
|
5
3
|
export const defaultHeaders: HeadersInit_ = {
|
|
6
4
|
Connection: 'keep-alive',
|
|
@@ -12,28 +10,20 @@ declare type MethodData = {
|
|
|
12
10
|
config?: any;
|
|
13
11
|
};
|
|
14
12
|
|
|
13
|
+
const baseURL = '';
|
|
14
|
+
|
|
15
15
|
const instance = axios.create({
|
|
16
|
-
baseURL:
|
|
17
|
-
timeout: 5000,
|
|
18
|
-
maxRate: 100,
|
|
16
|
+
baseURL: baseURL,
|
|
19
17
|
headers: {
|
|
20
|
-
|
|
21
|
-
'Content-Type': 'application/json',
|
|
18
|
+
...defaultHeaders,
|
|
22
19
|
},
|
|
23
20
|
});
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export const
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export const put = ({url, data, config}: MethodData) => {
|
|
34
|
-
return instance.put(url, data, config);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const deleteApi = ({url, config}: MethodData) => {
|
|
38
|
-
return instance.delete(url, config);
|
|
39
|
-
};
|
|
22
|
+
// Export HTTP methods using the configured instance
|
|
23
|
+
export const post = ({url, data, config}: MethodData) =>
|
|
24
|
+
instance.post(url, data, config);
|
|
25
|
+
export const get = ({url, config}: MethodData) => instance.get(url, config);
|
|
26
|
+
export const put = ({url, data, config}: MethodData) =>
|
|
27
|
+
instance.put(url, data, config);
|
|
28
|
+
export const deleteApi = ({url, config}: MethodData) =>
|
|
29
|
+
instance.delete(url, config);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {createSlice} from '@reduxjs/toolkit';
|
|
2
|
-
import {newState} from '../../../common/utils/newState';
|
|
3
2
|
|
|
4
|
-
import {appInitialState
|
|
3
|
+
import {appInitialState} from './appState';
|
|
5
4
|
|
|
6
5
|
export const {reducer: AppReducer, actions} = createSlice({
|
|
7
6
|
name: 'app',
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
createContext,
|
|
3
|
+
useCallback,
|
|
4
|
+
useContext,
|
|
5
|
+
useEffect,
|
|
6
|
+
useState,
|
|
7
|
+
} from 'react';
|
|
8
|
+
import {useColorScheme} from 'react-native';
|
|
9
|
+
import {Theme, ThemeMode} from './types';
|
|
10
|
+
import {darkTheme, lightTheme} from './themes';
|
|
11
|
+
|
|
12
|
+
interface ThemeContextType {
|
|
13
|
+
theme: Theme;
|
|
14
|
+
toggleTheme: () => void;
|
|
15
|
+
setThemeMode: (mode: ThemeMode) => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const ThemeContext = createContext<ThemeContextType>({
|
|
19
|
+
theme: lightTheme,
|
|
20
|
+
toggleTheme: () => {},
|
|
21
|
+
setThemeMode: () => {},
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const useTheme = () => {
|
|
25
|
+
const context = useContext(ThemeContext);
|
|
26
|
+
if (!context) {
|
|
27
|
+
throw new Error('useTheme must be used within a ThemeProvider');
|
|
28
|
+
}
|
|
29
|
+
return context;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
interface ThemeProviderProps {
|
|
33
|
+
children: React.ReactNode;
|
|
34
|
+
initialTheme?: ThemeMode;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const ThemeProvider: React.FC<ThemeProviderProps> = ({
|
|
38
|
+
children,
|
|
39
|
+
initialTheme,
|
|
40
|
+
}) => {
|
|
41
|
+
const systemColorScheme = useColorScheme();
|
|
42
|
+
const [themeMode, setThemeMode] = useState<ThemeMode>(
|
|
43
|
+
initialTheme || systemColorScheme || 'light',
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!initialTheme && systemColorScheme) {
|
|
48
|
+
setThemeMode(systemColorScheme);
|
|
49
|
+
}
|
|
50
|
+
}, [systemColorScheme, initialTheme]);
|
|
51
|
+
|
|
52
|
+
const toggleTheme = useCallback(() => {
|
|
53
|
+
setThemeMode(prev => (prev === 'light' ? 'dark' : 'light'));
|
|
54
|
+
}, []);
|
|
55
|
+
|
|
56
|
+
const theme = themeMode === 'dark' ? darkTheme : lightTheme;
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<ThemeContext.Provider value={{theme, toggleTheme, setThemeMode}}>
|
|
60
|
+
{children}
|
|
61
|
+
</ThemeContext.Provider>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
@@ -1,49 +1,36 @@
|
|
|
1
|
-
export enum
|
|
1
|
+
export enum BlackColors {
|
|
2
|
+
indigoBlue = '#6666FF',
|
|
3
|
+
mutedLavender = '#B3B5FF',
|
|
4
|
+
tintColor = '#B3B5FF',
|
|
5
|
+
mutedLavender30 = 'rgba(184, 186, 255, 0.3)',
|
|
6
|
+
balanceBackground = 'rgba(41, 45, 50, 0.8)',
|
|
7
|
+
white = '#FFFFFF',
|
|
8
|
+
backgroundOpacity = 'rgba(36, 40, 44, 0.8)',
|
|
2
9
|
black = '#000000',
|
|
10
|
+
background = '#000000',
|
|
11
|
+
surface = '#121212',
|
|
12
|
+
card = '#1E1E1E',
|
|
13
|
+
shadow = '#FFFFFF',
|
|
14
|
+
red = '#FB043E',
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export enum WhiteColors {
|
|
18
|
+
indigoBlue = '#6666FF',
|
|
19
|
+
mutedLavender = '#B3B5FF',
|
|
20
|
+
tintColor = '#6666FF',
|
|
21
|
+
mutedLavender30 = 'rgba(184, 186, 255, 0.3)',
|
|
22
|
+
balanceBackground = 'rgba(184, 186, 255, 0.3)',
|
|
3
23
|
white = '#FFFFFF',
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
green = '#4DAD4A',
|
|
12
|
-
red = '#CE3C3E',
|
|
13
|
-
transparent = 'transparent',
|
|
14
|
-
primary100 = '#8481FD',
|
|
15
|
-
primary50 = '#C1C0FE',
|
|
16
|
-
primary20 = '#E6E6FF',
|
|
17
|
-
primary10 = '#F3F2FF',
|
|
18
|
-
primary5 = '#F9F9FF',
|
|
19
|
-
teal100 = '#1ED3B8',
|
|
20
|
-
teal50 = '#8EE9DB',
|
|
21
|
-
teal20 = '#D2F6F1',
|
|
22
|
-
teal10 = '#E9FBF8',
|
|
23
|
-
teal5 = '#F4FDFB',
|
|
24
|
-
blue100 = '#52BDFF',
|
|
25
|
-
blue50 = '#A8DEFF',
|
|
26
|
-
blue20 = '#DCF2FF',
|
|
27
|
-
blue10 = '#EEF8FF',
|
|
28
|
-
blue5 = '#F6FCFF',
|
|
29
|
-
coral100 = '#F2565E',
|
|
30
|
-
coral50 = '#F9AAAF',
|
|
31
|
-
coral20 = '#FCDDDF',
|
|
32
|
-
coral10 = '#FEF7F7',
|
|
33
|
-
coral5 = '#FEF7F7',
|
|
34
|
-
orange100 = '#F79E69',
|
|
35
|
-
orange50 = '#FBCEB4',
|
|
36
|
-
orange20 = '#FDECE1',
|
|
37
|
-
orange10 = '#FEF5F0',
|
|
38
|
-
orange5 = '#FFFAF8',
|
|
39
|
-
yellow100 = '#FFDF75',
|
|
40
|
-
yellow50 = '#FFEFBA',
|
|
41
|
-
yellow20 = '#FFF8E3',
|
|
42
|
-
yellow10 = '#FFFCF1',
|
|
43
|
-
yellow5 = '#FFFDF8',
|
|
24
|
+
backgroundOpacity = 'rgba(255, 255, 255, 0.7)',
|
|
25
|
+
black = '#000000',
|
|
26
|
+
background = '#FFFFFF',
|
|
27
|
+
surface = '#FFFFFF',
|
|
28
|
+
card = '#FFFFFF',
|
|
29
|
+
shadow = 'rgba(0, 0, 0, 0.8)',
|
|
30
|
+
red = '#FB043E',
|
|
44
31
|
}
|
|
45
32
|
|
|
46
|
-
export enum
|
|
33
|
+
export enum Colors {
|
|
47
34
|
violetLight = '#F3F2FF',
|
|
48
35
|
violetLightHover = '#E6E6FF',
|
|
49
36
|
violetLightActive = '#C1C0FE',
|
|
@@ -85,4 +72,6 @@ export enum NewColors {
|
|
|
85
72
|
red = '#FFFCF1',
|
|
86
73
|
green = '#F4FDFB',
|
|
87
74
|
background = '#FAFAFA',
|
|
75
|
+
white = 'white',
|
|
76
|
+
gray = 'gray',
|
|
88
77
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
StyleSheet,
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
import DeviceInfo from 'react-native-device-info';
|
|
12
|
-
import {createPerfectSize} from '../../common/utils
|
|
12
|
+
import {createPerfectSize} from '../../common/utils';
|
|
13
13
|
|
|
14
14
|
const windowDimensions = Dimensions.get('window');
|
|
15
15
|
export const isIos = Platform.OS == 'ios';
|
|
@@ -5,224 +5,281 @@ import {
|
|
|
5
5
|
TextStyle,
|
|
6
6
|
ViewStyle,
|
|
7
7
|
} from 'react-native';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import {Theme} from './types';
|
|
9
|
+
import {FontSizes, LineHeight, Spacing} from './commonSizes';
|
|
10
10
|
import {Fonts} from './fonts';
|
|
11
11
|
|
|
12
12
|
export const screenComponentWidth = Dimensions.get('screen').width - 60;
|
|
13
13
|
export const screenWidth = Dimensions.get('screen').width;
|
|
14
14
|
export const screenHeight = Dimensions.get('screen').height;
|
|
15
|
+
|
|
15
16
|
export function justifyWidth(componentWidth: number) {
|
|
16
17
|
return (componentWidth / 2048) * screenWidth;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
export function justifyHeight(componentHeight: number) {
|
|
21
|
+
return (componentHeight / 2048) * screenHeight;
|
|
20
22
|
}
|
|
21
|
-
export const CommonStyles = StyleSheet.create({
|
|
22
|
-
flex1: {
|
|
23
|
-
flex: 1,
|
|
24
|
-
backgroundColor: Colors.background,
|
|
25
|
-
} as ViewStyle,
|
|
26
|
-
flex1Transparent: {
|
|
27
|
-
flex: 1,
|
|
28
|
-
backgroundColor: 'transparent',
|
|
29
|
-
} as ViewStyle,
|
|
30
|
-
flex1Padding: {
|
|
31
|
-
flex: 1,
|
|
32
|
-
paddingHorizontal: CommonSizes.spacing.large,
|
|
33
|
-
} as ViewStyle,
|
|
34
|
-
flex1PaddingTransparent: {
|
|
35
|
-
flex: 1,
|
|
36
|
-
paddingHorizontal: CommonSizes.spacing.large,
|
|
37
|
-
backgroundColor: 'transparent',
|
|
38
|
-
} as ViewStyle,
|
|
39
|
-
flexCenter: {
|
|
40
|
-
flex: 1,
|
|
41
|
-
alignItems: 'center',
|
|
42
|
-
justifyContent: 'center',
|
|
43
|
-
backgroundColor: Colors.background,
|
|
44
|
-
} as ViewStyle,
|
|
45
|
-
flexColumnCenterStretch: {
|
|
46
|
-
flex: 1,
|
|
47
|
-
flexDirection: 'column',
|
|
48
|
-
alignItems: 'stretch',
|
|
49
|
-
justifyContent: 'flex-start',
|
|
50
|
-
backgroundColor: Colors.background,
|
|
51
|
-
} as ViewStyle,
|
|
52
|
-
listContentContainer: {
|
|
53
|
-
flexGrow: 1,
|
|
54
|
-
paddingHorizontal: CommonSizes.spacing.large,
|
|
55
|
-
paddingVertical: CommonSizes.spacing.medium,
|
|
56
|
-
} as ViewStyle,
|
|
57
|
-
rowCenter: {
|
|
58
|
-
flexDirection: 'row',
|
|
59
|
-
alignItems: 'center',
|
|
60
|
-
} as ViewStyle,
|
|
61
|
-
columnAlignStart: {
|
|
62
|
-
flexDirection: 'column',
|
|
63
|
-
alignItems: 'flex-start',
|
|
64
|
-
} as ViewStyle,
|
|
65
|
-
shadow: {
|
|
66
|
-
backgroundColor: Colors.white,
|
|
67
|
-
shadowColor: '#2D9CDB',
|
|
68
|
-
...Platform.select({
|
|
69
|
-
ios: {
|
|
70
|
-
shadowOffset: {
|
|
71
|
-
width: 0,
|
|
72
|
-
height: 2,
|
|
73
|
-
},
|
|
74
|
-
shadowOpacity: 0.23,
|
|
75
|
-
shadowRadius: 2.62,
|
|
76
|
-
} as ViewStyle,
|
|
77
|
-
android: {
|
|
78
|
-
elevation: 4,
|
|
79
|
-
} as ViewStyle,
|
|
80
|
-
}),
|
|
81
|
-
} as ViewStyle,
|
|
82
|
-
iPhoneXFooter: {
|
|
83
|
-
height: 20,
|
|
84
|
-
} as ViewStyle,
|
|
85
|
-
normalText: {
|
|
86
|
-
fontFamily: Fonts.regular,
|
|
87
|
-
fontSize: CommonSizes.font.medium,
|
|
88
|
-
lineHeight: CommonSizes.lineHeight.medium,
|
|
89
|
-
color: Colors.black,
|
|
90
|
-
} as TextStyle,
|
|
91
|
-
h1_bold: {
|
|
92
|
-
fontFamily: Fonts.bold,
|
|
93
|
-
fontSize: CommonSizes.font.largePlus,
|
|
94
|
-
lineHeight: CommonSizes.lineHeight.largePlus,
|
|
95
|
-
color: Colors.black,
|
|
96
|
-
} as TextStyle,
|
|
97
|
-
h1_semiBold: {
|
|
98
|
-
fontFamily: Fonts.semiBold,
|
|
99
|
-
fontSize: CommonSizes.font.largePlus,
|
|
100
|
-
lineHeight: CommonSizes.lineHeight.largePlus,
|
|
101
|
-
color: Colors.black,
|
|
102
|
-
} as TextStyle,
|
|
103
|
-
h1_regular: {
|
|
104
|
-
fontFamily: Fonts.regular,
|
|
105
|
-
fontSize: CommonSizes.font.largePlus,
|
|
106
|
-
lineHeight: CommonSizes.lineHeight.largePlus,
|
|
107
|
-
color: Colors.black,
|
|
108
|
-
} as TextStyle,
|
|
109
|
-
h2_bold: {
|
|
110
|
-
fontFamily: Fonts.bold,
|
|
111
|
-
fontSize: CommonSizes.font.extraMedium,
|
|
112
|
-
lineHeight: CommonSizes.lineHeight.mediumPlus,
|
|
113
|
-
color: Colors.black,
|
|
114
|
-
} as TextStyle,
|
|
115
|
-
h2_semiBold: {
|
|
116
|
-
fontFamily: Fonts.semiBold,
|
|
117
|
-
fontSize: CommonSizes.font.extraMedium,
|
|
118
|
-
lineHeight: CommonSizes.lineHeight.mediumPlus,
|
|
119
|
-
color: Colors.black,
|
|
120
|
-
} as TextStyle,
|
|
121
|
-
h2_regular: {
|
|
122
|
-
fontFamily: Fonts.regular,
|
|
123
|
-
fontSize: CommonSizes.font.extraMedium,
|
|
124
|
-
lineHeight: CommonSizes.lineHeight.mediumPlus,
|
|
125
|
-
color: Colors.black,
|
|
126
|
-
} as TextStyle,
|
|
127
|
-
h3_bold: {
|
|
128
|
-
fontFamily: Fonts.bold,
|
|
129
|
-
fontSize: CommonSizes.font.mediumPlus,
|
|
130
|
-
lineHeight: CommonSizes.lineHeight.medium,
|
|
131
|
-
color: Colors.black,
|
|
132
|
-
} as TextStyle,
|
|
133
|
-
h3_bold_underlined: {
|
|
134
|
-
fontFamily: Fonts.bold,
|
|
135
|
-
fontSize: CommonSizes.font.mediumPlus,
|
|
136
|
-
lineHeight: CommonSizes.lineHeight.medium,
|
|
137
|
-
textDecorationLine: 'underline',
|
|
138
|
-
color: Colors.black,
|
|
139
|
-
} as TextStyle,
|
|
140
|
-
h3_semiBold: {
|
|
141
|
-
fontFamily: Fonts.semiBold,
|
|
142
|
-
fontSize: CommonSizes.font.mediumPlus,
|
|
143
|
-
lineHeight: CommonSizes.lineHeight.medium,
|
|
144
|
-
color: Colors.black,
|
|
145
|
-
} as TextStyle,
|
|
146
|
-
h3_regular: {
|
|
147
|
-
fontFamily: Fonts.regular,
|
|
148
|
-
fontSize: CommonSizes.font.mediumPlus,
|
|
149
|
-
lineHeight: CommonSizes.lineHeight.medium,
|
|
150
|
-
color: Colors.black,
|
|
151
|
-
} as TextStyle,
|
|
152
|
-
h4_bold: {
|
|
153
|
-
fontFamily: Fonts.bold,
|
|
154
|
-
fontSize: CommonSizes.font.medium,
|
|
155
|
-
lineHeight: CommonSizes.lineHeight.medium,
|
|
156
|
-
color: Colors.black,
|
|
157
|
-
} as TextStyle,
|
|
158
|
-
h4_bold_underlined: {
|
|
159
|
-
fontFamily: Fonts.bold,
|
|
160
|
-
fontSize: CommonSizes.font.medium,
|
|
161
|
-
lineHeight: CommonSizes.lineHeight.medium,
|
|
162
|
-
textDecorationLine: 'underline',
|
|
163
|
-
color: Colors.black,
|
|
164
|
-
} as TextStyle,
|
|
165
|
-
h4_semiBold: {
|
|
166
|
-
fontFamily: Fonts.semiBold,
|
|
167
|
-
fontSize: CommonSizes.font.medium,
|
|
168
|
-
lineHeight: CommonSizes.lineHeight.medium,
|
|
169
|
-
color: Colors.black,
|
|
170
|
-
} as TextStyle,
|
|
171
|
-
h4_regular: {
|
|
172
|
-
fontFamily: Fonts.regular,
|
|
173
|
-
fontSize: CommonSizes.font.medium,
|
|
174
|
-
lineHeight: CommonSizes.lineHeight.medium,
|
|
175
|
-
color: Colors.black,
|
|
176
|
-
} as TextStyle,
|
|
177
|
-
body_bold: {
|
|
178
|
-
fontFamily: Fonts.bold,
|
|
179
|
-
fontSize: CommonSizes.font.small,
|
|
180
|
-
lineHeight: CommonSizes.lineHeight.small,
|
|
181
|
-
color: Colors.black,
|
|
182
|
-
} as TextStyle,
|
|
183
|
-
body_bold_underlined: {
|
|
184
|
-
fontFamily: Fonts.bold,
|
|
185
|
-
fontSize: CommonSizes.font.small,
|
|
186
|
-
lineHeight: CommonSizes.lineHeight.small,
|
|
187
|
-
textDecorationLine: 'underline',
|
|
188
|
-
color: Colors.black,
|
|
189
|
-
} as TextStyle,
|
|
190
|
-
body_semiBold: {
|
|
191
|
-
fontFamily: Fonts.semiBold,
|
|
192
|
-
fontSize: CommonSizes.font.small,
|
|
193
|
-
lineHeight: CommonSizes.lineHeight.small,
|
|
194
|
-
color: Colors.black,
|
|
195
|
-
} as TextStyle,
|
|
196
|
-
body_regular: {
|
|
197
|
-
fontFamily: Fonts.regular,
|
|
198
|
-
fontSize: CommonSizes.font.small,
|
|
199
|
-
lineHeight: CommonSizes.lineHeight.small,
|
|
200
|
-
color: Colors.black,
|
|
201
|
-
} as TextStyle,
|
|
202
|
-
tabBar_bold: {
|
|
203
|
-
fontFamily: Fonts.bold,
|
|
204
|
-
fontSize: CommonSizes.font.extraSmallPlus,
|
|
205
|
-
lineHeight: CommonSizes.lineHeight.extraSmallPlus,
|
|
206
|
-
color: Colors.black,
|
|
207
|
-
} as TextStyle,
|
|
208
|
-
tabBar_regular: {
|
|
209
|
-
fontFamily: Fonts.regular,
|
|
210
|
-
fontSize: CommonSizes.font.extraSmallPlus,
|
|
211
|
-
lineHeight: CommonSizes.lineHeight.extraSmallPlus,
|
|
212
|
-
color: Colors.black,
|
|
213
|
-
} as TextStyle,
|
|
214
|
-
dropShadow: {
|
|
215
|
-
shadowColor: '#000',
|
|
216
|
-
shadowOffset: {
|
|
217
|
-
width: 0,
|
|
218
|
-
height: 2,
|
|
219
|
-
},
|
|
220
|
-
shadowOpacity: 0.25,
|
|
221
|
-
shadowRadius: 3.84,
|
|
222
23
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
24
|
+
export const createThemedStyles = (theme: Theme) =>
|
|
25
|
+
StyleSheet.create({
|
|
26
|
+
flex1: {
|
|
27
|
+
flex: 1,
|
|
28
|
+
backgroundColor: theme.colors.background,
|
|
29
|
+
} as ViewStyle,
|
|
30
|
+
flex1Transparent: {
|
|
31
|
+
flex: 1,
|
|
32
|
+
backgroundColor: 'transparent',
|
|
33
|
+
} as ViewStyle,
|
|
34
|
+
flex1Padding: {
|
|
35
|
+
flex: 1,
|
|
36
|
+
paddingHorizontal: theme.spacing.lg,
|
|
37
|
+
} as ViewStyle,
|
|
38
|
+
flex1PaddingTransparent: {
|
|
39
|
+
flex: 1,
|
|
40
|
+
paddingHorizontal: theme.spacing.lg,
|
|
41
|
+
backgroundColor: 'transparent',
|
|
42
|
+
} as ViewStyle,
|
|
43
|
+
flexCenter: {
|
|
44
|
+
flex: 1,
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
justifyContent: 'center',
|
|
47
|
+
backgroundColor: theme.colors.background,
|
|
48
|
+
} as ViewStyle,
|
|
49
|
+
flexColumnCenterStretch: {
|
|
50
|
+
flex: 1,
|
|
51
|
+
flexDirection: 'column',
|
|
52
|
+
alignItems: 'stretch',
|
|
53
|
+
justifyContent: 'flex-start',
|
|
54
|
+
backgroundColor: theme.colors.background,
|
|
55
|
+
} as ViewStyle,
|
|
56
|
+
listContentContainer: {
|
|
57
|
+
flexGrow: 1,
|
|
58
|
+
paddingHorizontal: theme.spacing.lg,
|
|
59
|
+
paddingVertical: theme.spacing.md,
|
|
60
|
+
} as ViewStyle,
|
|
61
|
+
rowCenter: {
|
|
62
|
+
flexDirection: 'row',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
} as ViewStyle,
|
|
65
|
+
columnAlignStart: {
|
|
66
|
+
flexDirection: 'column',
|
|
67
|
+
alignItems: 'flex-start',
|
|
68
|
+
} as ViewStyle,
|
|
69
|
+
shadow: {
|
|
70
|
+
backgroundColor: theme.colors.card,
|
|
71
|
+
shadowColor: theme.colors.shadow,
|
|
72
|
+
...Platform.select({
|
|
73
|
+
ios: {
|
|
74
|
+
shadowOffset: {
|
|
75
|
+
width: 0,
|
|
76
|
+
height: 2,
|
|
77
|
+
},
|
|
78
|
+
shadowOpacity: 0.23,
|
|
79
|
+
shadowRadius: 2.62,
|
|
80
|
+
} as ViewStyle,
|
|
81
|
+
android: {
|
|
82
|
+
elevation: 4,
|
|
83
|
+
} as ViewStyle,
|
|
84
|
+
}),
|
|
85
|
+
} as ViewStyle,
|
|
86
|
+
iPhoneXFooter: {
|
|
87
|
+
height: 20,
|
|
88
|
+
} as ViewStyle,
|
|
89
|
+
normalText: {
|
|
90
|
+
// fontFamily: Fonts.regular,
|
|
91
|
+
// fontSize: FontSizes.medium,
|
|
92
|
+
// lineHeight: LineHeight.medium,
|
|
93
|
+
} as TextStyle,
|
|
94
|
+
h1_bold: {
|
|
95
|
+
fontFamily: Fonts.bold,
|
|
96
|
+
} as TextStyle,
|
|
97
|
+
h1_semiBold: {
|
|
98
|
+
fontFamily: Fonts.semiBold,
|
|
99
|
+
} as TextStyle,
|
|
100
|
+
h1_regular: {
|
|
101
|
+
fontFamily: Fonts.regular,
|
|
102
|
+
} as TextStyle,
|
|
103
|
+
h2_bold: {
|
|
104
|
+
fontFamily: Fonts.bold,
|
|
105
|
+
} as TextStyle,
|
|
106
|
+
h2_semiBold: {
|
|
107
|
+
fontFamily: Fonts.semiBold,
|
|
108
|
+
} as TextStyle,
|
|
109
|
+
h2_regular: {
|
|
110
|
+
fontFamily: Fonts.regular,
|
|
111
|
+
} as TextStyle,
|
|
112
|
+
h3_bold: {
|
|
113
|
+
fontFamily: Fonts.bold,
|
|
114
|
+
} as TextStyle,
|
|
115
|
+
h3_bold_underlined: {
|
|
116
|
+
fontFamily: Fonts.bold,
|
|
117
|
+
textDecorationLine: 'underline',
|
|
118
|
+
} as TextStyle,
|
|
119
|
+
h3_semiBold: {
|
|
120
|
+
fontFamily: Fonts.semiBold,
|
|
121
|
+
} as TextStyle,
|
|
122
|
+
h3_regular: {
|
|
123
|
+
fontFamily: Fonts.regular,
|
|
124
|
+
} as TextStyle,
|
|
125
|
+
h4_bold: {
|
|
126
|
+
fontFamily: Fonts.bold,
|
|
127
|
+
} as TextStyle,
|
|
128
|
+
h4_bold_underlined: {
|
|
129
|
+
fontFamily: Fonts.bold,
|
|
130
|
+
textDecorationLine: 'underline',
|
|
131
|
+
} as TextStyle,
|
|
132
|
+
h4_semiBold: {
|
|
133
|
+
fontFamily: Fonts.semiBold,
|
|
134
|
+
fontSize: FontSizes.medium,
|
|
135
|
+
lineHeight: LineHeight.medium,
|
|
136
|
+
} as TextStyle,
|
|
137
|
+
h4_regular: {
|
|
138
|
+
fontFamily: Fonts.regular,
|
|
139
|
+
fontSize: FontSizes.medium,
|
|
140
|
+
lineHeight: LineHeight.medium,
|
|
141
|
+
} as TextStyle,
|
|
142
|
+
body_bold: {
|
|
143
|
+
fontFamily: Fonts.bold,
|
|
144
|
+
fontSize: FontSizes.small,
|
|
145
|
+
lineHeight: LineHeight.small,
|
|
146
|
+
} as TextStyle,
|
|
147
|
+
body_bold_underlined: {
|
|
148
|
+
fontFamily: Fonts.bold,
|
|
149
|
+
fontSize: FontSizes.small,
|
|
150
|
+
lineHeight: LineHeight.small,
|
|
151
|
+
textDecorationLine: 'underline',
|
|
152
|
+
} as TextStyle,
|
|
153
|
+
body_semiBold: {
|
|
154
|
+
fontFamily: Fonts.semiBold,
|
|
155
|
+
fontSize: FontSizes.small,
|
|
156
|
+
lineHeight: LineHeight.small,
|
|
157
|
+
} as TextStyle,
|
|
158
|
+
body_regular: {
|
|
159
|
+
fontFamily: Fonts.regular,
|
|
160
|
+
fontSize: FontSizes.small,
|
|
161
|
+
lineHeight: LineHeight.small,
|
|
162
|
+
} as TextStyle,
|
|
163
|
+
tabBar_bold: {
|
|
164
|
+
fontFamily: Fonts.bold,
|
|
165
|
+
} as TextStyle,
|
|
166
|
+
tabBar_regular: {
|
|
167
|
+
fontFamily: Fonts.regular,
|
|
168
|
+
} as TextStyle,
|
|
169
|
+
dropShadow: {
|
|
170
|
+
shadowColor: theme.colors.shadow,
|
|
171
|
+
shadowOffset: {
|
|
172
|
+
width: 0,
|
|
173
|
+
height: 4,
|
|
174
|
+
},
|
|
175
|
+
shadowOpacity: 0.25,
|
|
176
|
+
shadowRadius: 8,
|
|
177
|
+
elevation: 5,
|
|
178
|
+
borderWidth: 0.5,
|
|
179
|
+
borderColor: 'rgba(255, 255, 255, 0.1)',
|
|
180
|
+
} as ViewStyle,
|
|
181
|
+
textInputContainer: {
|
|
182
|
+
width: '100%',
|
|
183
|
+
} as ViewStyle,
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
// For backward compatibility and static styles
|
|
187
|
+
export const CommonStyles = createThemedStyles({
|
|
188
|
+
mode: 'light',
|
|
189
|
+
colors: {
|
|
190
|
+
indigoBlue: '#2D9CDB',
|
|
191
|
+
mutedLavender: '#B3B5FF',
|
|
192
|
+
tintColor: '#2D9CDB',
|
|
193
|
+
mutedLavender30: 'rgba(184, 186, 255, 0.3)',
|
|
194
|
+
white: '#FFFFFF',
|
|
195
|
+
backgroundOpacity: 'rgba(41, 45, 50, 0.8)',
|
|
196
|
+
black: '#000000',
|
|
197
|
+
background: '#FFFFFF',
|
|
198
|
+
surface: '#F5F5F5',
|
|
199
|
+
card: '#FFFFFF',
|
|
200
|
+
shadow: 'rgba(0, 0, 0, 0.1)',
|
|
201
|
+
red: '#FB043E',
|
|
202
|
+
balanceBackground: '#F5F5F5',
|
|
203
|
+
},
|
|
204
|
+
text: {
|
|
205
|
+
header1: {
|
|
206
|
+
fontFamily: Fonts.medium,
|
|
207
|
+
fontSize: FontSizes.header1,
|
|
208
|
+
color: '#000000',
|
|
209
|
+
},
|
|
210
|
+
header2: {
|
|
211
|
+
fontFamily: Fonts.normal,
|
|
212
|
+
fontSize: FontSizes.header2,
|
|
213
|
+
color: '#000000',
|
|
214
|
+
},
|
|
215
|
+
body1: {
|
|
216
|
+
fontFamily: Fonts.light,
|
|
217
|
+
fontSize: FontSizes.body1,
|
|
218
|
+
color: '#000000',
|
|
219
|
+
},
|
|
220
|
+
body2: {
|
|
221
|
+
fontFamily: Fonts.regular,
|
|
222
|
+
fontSize: FontSizes.body2,
|
|
223
|
+
color: '#000000',
|
|
224
|
+
},
|
|
225
|
+
button: {
|
|
226
|
+
fontFamily: Fonts.regular,
|
|
227
|
+
fontSize: FontSizes.button,
|
|
228
|
+
color: '#FFFFFF',
|
|
229
|
+
},
|
|
230
|
+
cards: {
|
|
231
|
+
fontFamily: Fonts.semiBold,
|
|
232
|
+
fontSize: FontSizes.card,
|
|
233
|
+
color: '#000000',
|
|
234
|
+
},
|
|
235
|
+
SearchBar: {
|
|
236
|
+
fontFamily: Fonts.light,
|
|
237
|
+
fontSize: FontSizes.searchBar,
|
|
238
|
+
color: '#000000',
|
|
239
|
+
},
|
|
240
|
+
label: {
|
|
241
|
+
fontFamily: Fonts.light,
|
|
242
|
+
fontSize: FontSizes.label,
|
|
243
|
+
color: '#000000',
|
|
244
|
+
},
|
|
245
|
+
hyperlink: {
|
|
246
|
+
fontFamily: Fonts.light,
|
|
247
|
+
fontSize: FontSizes.hyperlink,
|
|
248
|
+
color: '#000000',
|
|
249
|
+
textDecorationLine: 'underline',
|
|
250
|
+
},
|
|
251
|
+
balanceTitle: {
|
|
252
|
+
fontFamily: Fonts.semiBold,
|
|
253
|
+
fontSize: 16,
|
|
254
|
+
color: '#000000',
|
|
255
|
+
},
|
|
256
|
+
balanceAmount: {
|
|
257
|
+
fontFamily: Fonts.semiBold,
|
|
258
|
+
fontSize: 16,
|
|
259
|
+
color: '#000000',
|
|
260
|
+
},
|
|
261
|
+
balanceLabel: {
|
|
262
|
+
fontFamily: Fonts.regular,
|
|
263
|
+
fontSize: 12,
|
|
264
|
+
color: '#000000',
|
|
265
|
+
},
|
|
266
|
+
navBar: {
|
|
267
|
+
fontFamily: Fonts.semiBold,
|
|
268
|
+
fontSize: 16,
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
spacing: {
|
|
272
|
+
xs: 4,
|
|
273
|
+
sm: 8,
|
|
274
|
+
md: 12,
|
|
275
|
+
lg: 16,
|
|
276
|
+
xl: 24,
|
|
277
|
+
},
|
|
278
|
+
borderRadius: {
|
|
279
|
+
xs: 4,
|
|
280
|
+
sm: 8,
|
|
281
|
+
md: 12,
|
|
282
|
+
lg: 16,
|
|
283
|
+
xl: 24,
|
|
284
|
+
},
|
|
228
285
|
});
|