@fadyshawky/react-native-magic 1.0.8 → 1.0.9
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 +170 -123
- package/template/package.json +1 -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
|
@@ -14,7 +14,7 @@ export function TopBar({state, descriptors, navigation, position}: any) {
|
|
|
14
14
|
borderRadius: 20,
|
|
15
15
|
marginBottom: 24,
|
|
16
16
|
}}>
|
|
17
|
-
{state.routes.map((route, index) => {
|
|
17
|
+
{state.routes.map((route: any, index: any) => {
|
|
18
18
|
const {options} = descriptors[route.key];
|
|
19
19
|
const label =
|
|
20
20
|
options.tabBarLabel !== undefined
|
|
@@ -19,7 +19,7 @@ import {useInputError} from '../../common/validations/hooks/useInputError';
|
|
|
19
19
|
import {emailValidations} from '../../common/validations/profileValidations';
|
|
20
20
|
import {useAppDispatch} from '../../core/store/reduxHelpers';
|
|
21
21
|
import {userLogin} from '../../core/store/user/userActions';
|
|
22
|
-
import {Colors
|
|
22
|
+
import {Colors} from '../../core/theme/colors';
|
|
23
23
|
import {CommonSizes} from '../../core/theme/commonSizes';
|
|
24
24
|
import {CommonStyles} from '../../core/theme/commonStyles';
|
|
25
25
|
import type {RootStackParamList} from '../../navigation/types';
|
|
@@ -151,14 +151,14 @@ const styles = StyleSheet.create({
|
|
|
151
151
|
},
|
|
152
152
|
forgotPassword: {
|
|
153
153
|
...CommonStyles.normalText,
|
|
154
|
-
color:
|
|
154
|
+
color: Colors.blueNormalActive,
|
|
155
155
|
textAlign: 'right',
|
|
156
156
|
marginTop: 8,
|
|
157
157
|
marginBottom: 24,
|
|
158
158
|
},
|
|
159
159
|
registerLink: {
|
|
160
160
|
...CommonStyles.normalText,
|
|
161
|
-
color:
|
|
161
|
+
color: Colors.blueNormalActive,
|
|
162
162
|
textAlign: 'center',
|
|
163
163
|
marginTop: 16,
|
|
164
164
|
},
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {
|
|
3
|
-
View,
|
|
4
|
-
StyleSheet,
|
|
5
|
-
ScrollView,
|
|
6
3
|
Image,
|
|
7
|
-
TouchableOpacity,
|
|
8
4
|
ImageStyle,
|
|
5
|
+
ScrollView,
|
|
6
|
+
StyleSheet,
|
|
9
7
|
Text,
|
|
8
|
+
TouchableOpacity,
|
|
9
|
+
View,
|
|
10
10
|
} from 'react-native';
|
|
11
|
+
import {Colors} from '../../../core/theme/colors';
|
|
11
12
|
import {CommonSizes} from '../../../core/theme/commonSizes';
|
|
12
|
-
import {CommonStyles} from '../../../core/theme/commonStyles';
|
|
13
13
|
import {CarouselItem} from '../types';
|
|
14
|
-
import {Colors} from '../../../core/theme/colors';
|
|
15
14
|
|
|
16
15
|
interface CarouselSectionProps {
|
|
17
16
|
items: CarouselItem[];
|
|
@@ -70,11 +69,11 @@ const styles = StyleSheet.create({
|
|
|
70
69
|
title: {
|
|
71
70
|
fontSize: 16,
|
|
72
71
|
fontWeight: '600',
|
|
73
|
-
color: Colors.
|
|
72
|
+
color: Colors.blueDarker,
|
|
74
73
|
},
|
|
75
74
|
subtitle: {
|
|
76
75
|
fontSize: 14,
|
|
77
|
-
color: Colors.
|
|
76
|
+
color: Colors.blueDarker,
|
|
78
77
|
marginTop: 2,
|
|
79
78
|
},
|
|
80
79
|
});
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {useRef, useState} from 'react';
|
|
2
2
|
import {
|
|
3
|
-
View,
|
|
4
|
-
StyleSheet,
|
|
5
3
|
Dimensions,
|
|
6
4
|
FlatList,
|
|
7
5
|
Image,
|
|
8
|
-
|
|
6
|
+
StyleSheet,
|
|
9
7
|
Text,
|
|
8
|
+
TouchableOpacity,
|
|
9
|
+
View,
|
|
10
10
|
} from 'react-native';
|
|
11
11
|
import {Colors} from '../../../core/theme/colors';
|
|
12
12
|
import {CommonSizes} from '../../../core/theme/commonSizes';
|
|
13
|
-
import {CommonStyles} from '../../../core/theme/commonStyles';
|
|
14
13
|
import {CarouselItem} from '../types';
|
|
15
14
|
|
|
16
15
|
const {width} = Dimensions.get('window');
|
|
@@ -121,7 +120,7 @@ const styles = StyleSheet.create({
|
|
|
121
120
|
marginHorizontal: 4,
|
|
122
121
|
},
|
|
123
122
|
activeDot: {
|
|
124
|
-
backgroundColor: Colors.
|
|
123
|
+
backgroundColor: Colors.blueDarker,
|
|
125
124
|
width: 12,
|
|
126
125
|
height: 12,
|
|
127
126
|
borderRadius: 6,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from '../../common/validations/profileValidations';
|
|
22
22
|
import {useAppDispatch} from '../../core/store/reduxHelpers';
|
|
23
23
|
import {userRegister} from '../../core/store/user/userActions';
|
|
24
|
-
import {Colors
|
|
24
|
+
import {Colors} from '../../core/theme/colors';
|
|
25
25
|
import {CommonSizes} from '../../core/theme/commonSizes';
|
|
26
26
|
import {CommonStyles} from '../../core/theme/commonStyles';
|
|
27
27
|
import type {RootStackParamList} from '../../navigation/types';
|
|
@@ -191,7 +191,7 @@ const styles = StyleSheet.create({
|
|
|
191
191
|
},
|
|
192
192
|
loginLink: {
|
|
193
193
|
...CommonStyles.normalText,
|
|
194
|
-
color:
|
|
194
|
+
color: Colors.blueNormalActive,
|
|
195
195
|
textAlign: 'center',
|
|
196
196
|
marginTop: 16,
|
|
197
197
|
},
|
|
@@ -17,7 +17,7 @@ import {useInputError} from '../../common/validations/hooks/useInputError';
|
|
|
17
17
|
import {emailValidations} from '../../common/validations/profileValidations';
|
|
18
18
|
import {useAppDispatch} from '../../core/store/reduxHelpers';
|
|
19
19
|
import {resetPassword} from '../../core/store/user/userActions';
|
|
20
|
-
import {Colors
|
|
20
|
+
import {Colors} from '../../core/theme/colors';
|
|
21
21
|
import {CommonSizes} from '../../core/theme/commonSizes';
|
|
22
22
|
import {CommonStyles} from '../../core/theme/commonStyles';
|
|
23
23
|
import type {RootStackParamList} from '../../navigation/types';
|
|
@@ -122,7 +122,7 @@ const styles = StyleSheet.create({
|
|
|
122
122
|
},
|
|
123
123
|
loginLink: {
|
|
124
124
|
...CommonStyles.normalText,
|
|
125
|
-
color:
|
|
125
|
+
color: Colors.blueNormalActive,
|
|
126
126
|
textAlign: 'center',
|
|
127
127
|
marginTop: 16,
|
|
128
128
|
},
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Initializes a new instance of the StringBuilder class
|
|
2
|
+
// and appends the given value if supplied
|
|
3
|
+
function StringBuilder(value) {
|
|
4
|
+
this.strings = new Array('');
|
|
5
|
+
this.append(value);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// Appends the given value to the end of this instance.
|
|
9
|
+
StringBuilder.prototype.append = function (value) {
|
|
10
|
+
if (value) {
|
|
11
|
+
this.strings.push(value);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// Clears the string buffer
|
|
16
|
+
StringBuilder.prototype.clear = function () {
|
|
17
|
+
this.strings.length = 1;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Converts this instance to a String.
|
|
21
|
+
StringBuilder.prototype.toString = function () {
|
|
22
|
+
return this.strings.join('');
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default StringBuilder;
|