@fadyshawky/react-native-magic 2.0.4 → 2.0.5
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/package.json +1 -1
- package/template/src/common/ImageResources.g.ts +33 -1
- package/template/src/common/components/Background.tsx +3 -1
- package/template/src/common/components/Container.tsx +1 -1
- package/template/src/common/components/OTPInput.tsx +3 -2
- package/template/src/common/components/PrimaryButton.tsx +23 -23
- package/template/src/common/components/PrimaryTextInput.tsx +189 -199
- package/template/src/common/components/RadioIcon.tsx +4 -4
- package/template/src/common/components/SafeText.tsx +41 -0
- package/template/src/common/components/SearchBar.tsx +19 -17
- package/template/src/common/components/TryAgain.tsx +3 -3
- package/template/src/common/localization/localization.ts +10 -0
- package/template/src/common/localization/translations/commonLocalization.ts +97 -0
- package/template/src/common/localization/translations/homeLocalization.ts +24 -0
- package/template/src/common/localization/translations/loginLocalization.ts +28 -2
- package/template/src/common/localization/translations/mainNavigationLocalization.ts +30 -0
- package/template/src/common/localization/translations/navigationLocalization.ts +48 -0
- package/template/src/common/localization/translations/otpLocalization.ts +28 -0
- package/template/src/common/localization/translations/passwordLocalization.ts +54 -0
- package/template/src/common/localization/translations/posLocalization.ts +196 -0
- package/template/src/common/utils/FeesCaalculation.tsx +37 -0
- package/template/src/common/utils/index.tsx +11 -0
- package/template/src/common/utils/printData.tsx +161 -0
- package/template/src/common/validations/errorValidations.ts +3 -2
- package/template/src/components/PrinterExample.js +226 -0
- package/template/src/core/api/serverHeaders.ts +62 -1
- package/template/src/core/store/Categories/categoryActions.ts +33 -0
- package/template/src/core/store/Categories/categorySlice.ts +75 -0
- package/template/src/core/store/Categories/categoryState.ts +41 -0
- package/template/src/core/store/Providers/providersActions.ts +102 -0
- package/template/src/core/store/Providers/providersSlice.ts +136 -0
- package/template/src/core/store/Providers/providersState.ts +37 -0
- package/template/src/core/store/Services/servicesActions.ts +191 -0
- package/template/src/core/store/Services/servicesSlice.ts +205 -0
- package/template/src/core/store/Services/servicesState.ts +466 -0
- package/template/src/core/store/app/appSlice.ts +13 -5
- package/template/src/core/store/app/appState.ts +10 -2
- package/template/src/core/store/rootReducer.ts +6 -1
- package/template/src/core/store/store.tsx +55 -2
- package/template/src/core/store/user/userActions.ts +164 -26
- package/template/src/core/store/user/userSlice.ts +193 -21
- package/template/src/core/store/user/userState.ts +148 -25
- package/template/src/core/theme/colors.ts +70 -94
- package/template/src/core/theme/commonConsts.ts +1 -1
- package/template/src/core/theme/commonSizes.ts +94 -119
- package/template/src/core/theme/commonStyles.ts +22 -22
- package/template/src/core/theme/fonts.ts +14 -13
- package/template/src/core/theme/themes.ts +75 -386
- package/template/src/core/theme/types.ts +15 -201
- package/template/src/core/utils/stringUtils.ts +114 -0
- package/template/src/modules/SunmiCard.js +212 -0
- package/template/src/modules/SunmiPrepaid.ts +122 -0
- package/template/src/navigation/AuthStack.tsx +8 -0
- package/template/src/navigation/HeaderComponents.tsx +76 -1
- package/template/src/navigation/MainNavigation.tsx +3 -1
- package/template/src/navigation/MainStack.tsx +130 -56
- package/template/src/navigation/TabBar.tsx +111 -59
- package/template/src/navigation/types.ts +24 -0
- package/template/src/screens/Categories/Categories.tsx +141 -0
- package/template/src/screens/Categories/hooks/useCategoriesData.ts +33 -0
- package/template/src/screens/Categories/types.ts +7 -0
- package/template/src/screens/Favorites/Favorites.tsx +130 -0
- package/template/src/screens/ForceChangePassword/ForceChangePasswordScreen.tsx +155 -0
- package/template/src/screens/History/History.tsx +430 -0
- package/template/src/screens/History/hooks/useHistoryData.ts +49 -0
- package/template/src/screens/History/types.ts +7 -0
- package/template/src/screens/InquiredBill/InquiredBill.tsx +443 -0
- package/template/src/screens/InquiredBill/hooks/useInquiredData.ts +91 -0
- package/template/src/screens/Login/Login.tsx +85 -85
- package/template/src/screens/OTP/OTPScreen.tsx +170 -0
- package/template/src/screens/PaymentConfirmation/PaymentConfirmation.tsx +326 -0
- package/template/src/screens/Providers/Providers.tsx +166 -0
- package/template/src/screens/Providers/hooks/useProvidersData.ts +33 -0
- package/template/src/screens/Providers/types.ts +7 -0
- package/template/src/screens/ReceiptScreen/ReceiptScreen.tsx +181 -0
- package/template/src/screens/ReceiptScreen/hooks/useReceiptData.ts +46 -0
- package/template/src/screens/ReceiptScreen/utils/utils.tsx +156 -0
- package/template/src/screens/Services/Services.tsx +144 -0
- package/template/src/screens/Services/hooks/useServicesData.ts +41 -0
- package/template/src/screens/SingleService/Components/FawryInputs.tsx +446 -0
- package/template/src/screens/SingleService/SingleService.tsx +229 -0
- package/template/src/screens/SingleService/hooks/useServiceData.ts +164 -0
- package/template/src/screens/home/Components/PayByCode.tsx +129 -0
- package/template/src/screens/home/HomeScreen.tsx +268 -77
- package/template/src/screens/home/hooks/useHomeData.ts +32 -38
- package/template/src/screens/index.tsx +24 -0
- package/template/src/screens/profile/Profile.tsx +290 -2
- package/template/src/services/SunmiPrinterInternal.js +268 -0
- package/template/src/types/sunmiPrepaid.d.ts +20 -0
- package/template/src/utils/SunmiPrinter.ts +442 -0
- package/template/src/utils/feesCalculator.ts +92 -0
- package/template/src/common/components/Stepper.tsx +0 -153
- package/template/src/common/components/Svg.tsx +0 -25
- package/template/src/common/hooks/useDebounce.ts +0 -17
- package/template/src/common/hooks/usePrevious.ts +0 -11
- package/template/src/common/localization/intlFormatter.ts +0 -37
- package/template/src/common/urls/emailUrl.ts +0 -20
- package/template/src/common/urls/mapUrl.ts +0 -22
- package/template/src/common/utils/listHandlers.ts +0 -30
- package/template/src/common/utils/serializeQueryParams.ts +0 -10
- package/template/src/common/validations/hooks/useDatesError.ts +0 -40
- package/template/src/common/validations/profileValidations.ts +0 -30
- package/template/src/core/theme/shadows.ts +0 -135
- package/template/src/navigation/TopTabBar.tsx +0 -77
- package/template/src/screens/Settings/Settings.tsx +0 -5
- package/template/src/screens/home/components/CarouselSection.tsx +0 -79
- package/template/src/screens/home/components/FeaturedCarousel.tsx +0 -128
- package/template/src/screens/main/Main.tsx +0 -5
- package/template/src/screens/registration/RegistrationScreen.tsx +0 -198
- package/template/src/screens/resetPassword/ForgotPasswordScreen.tsx +0 -129
package/package.json
CHANGED
|
@@ -9,4 +9,36 @@ import {ImageURISource} from 'react-native';
|
|
|
9
9
|
* https://github.com/svbutko/react-native-image-resource-generator
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
export class ImageResources {
|
|
12
|
+
export class ImageResources {
|
|
13
|
+
static readonly account: ImageURISource = require('../../resources/images/Account.png');
|
|
14
|
+
static readonly arrows: ImageURISource = require('../../resources/images/Arrows.png');
|
|
15
|
+
static readonly background_2: ImageURISource = require('../../resources/images/Background_2.png');
|
|
16
|
+
static readonly balance: ImageURISource = require('../../resources/images/Balance.png');
|
|
17
|
+
static readonly commission: ImageURISource = require('../../resources/images/Commission.png');
|
|
18
|
+
static readonly display: ImageURISource = require('../../resources/images/Display.png');
|
|
19
|
+
static readonly en: ImageURISource = require('../../resources/images/EN.png');
|
|
20
|
+
static readonly favourite_active: ImageURISource = require('../../resources/images/Favourite_Active.png');
|
|
21
|
+
static readonly favourite_inactive: ImageURISource = require('../../resources/images/Favourite_Inactive.png');
|
|
22
|
+
static readonly favourites: ImageURISource = require('../../resources/images/Favourites.png');
|
|
23
|
+
static readonly financials: ImageURISource = require('../../resources/images/Financials.png');
|
|
24
|
+
static readonly language: ImageURISource = require('../../resources/images/Language.png');
|
|
25
|
+
static readonly neo_pay_plus_logo: ImageURISource = require('../../resources/images/Neo_Pay_Plus_Logo.png');
|
|
26
|
+
static readonly services: ImageURISource = require('../../resources/images/Services.png');
|
|
27
|
+
static readonly splash_screen: ImageURISource = require('../../resources/images/Splash_Screen.png');
|
|
28
|
+
static readonly ar: ImageURISource = require('../../resources/images/ar.png');
|
|
29
|
+
static readonly arrow_left: ImageURISource = require('../../resources/images/arrow_left.png');
|
|
30
|
+
static readonly arrow_right: ImageURISource = require('../../resources/images/arrow_right.png');
|
|
31
|
+
static readonly dark: ImageURISource = require('../../resources/images/dark.png');
|
|
32
|
+
static readonly dark_background_1: ImageURISource = require('../../resources/images/dark_background_1.png');
|
|
33
|
+
static readonly dark_splash_logo: ImageURISource = require('../../resources/images/dark_splash_logo.png');
|
|
34
|
+
static readonly full_ammount: ImageURISource = require('../../resources/images/full_ammount.png');
|
|
35
|
+
static readonly header_logo: ImageURISource = require('../../resources/images/header_logo.png');
|
|
36
|
+
static readonly light: ImageURISource = require('../../resources/images/light.png');
|
|
37
|
+
static readonly light_background_1: ImageURISource = require('../../resources/images/light_background_1.png');
|
|
38
|
+
static readonly light_header_logo: ImageURISource = require('../../resources/images/light_header_logo.png');
|
|
39
|
+
static readonly light_splash_logo: ImageURISource = require('../../resources/images/light_splash_logo.png');
|
|
40
|
+
static readonly partial_ammount: ImageURISource = require('../../resources/images/partial_ammount.png');
|
|
41
|
+
static readonly receipt_logo: ImageURISource = require('../../resources/images/receipt_logo.png');
|
|
42
|
+
static readonly receipt_logo_transparent: ImageURISource = require('../../resources/images/receipt_logo_transparent.png');
|
|
43
|
+
static readonly repeat: ImageURISource = require('../../resources/images/repeat.png');
|
|
44
|
+
}
|
|
@@ -56,7 +56,9 @@ export const Background: FC<BackgroundProps> = memo(
|
|
|
56
56
|
return (
|
|
57
57
|
<View
|
|
58
58
|
style={[styles.container, {backgroundColor: theme.colors.background}]}>
|
|
59
|
-
<ImageBackground
|
|
59
|
+
<ImageBackground
|
|
60
|
+
source={ImageResources[`${theme.mode}_background_1`]}
|
|
61
|
+
style={styles.container}>
|
|
60
62
|
{content}
|
|
61
63
|
</ImageBackground>
|
|
62
64
|
</View>
|
|
@@ -41,7 +41,7 @@ export const Container = forwardRef<KeyboardAwareScrollView, ContainerProps>(
|
|
|
41
41
|
withoutScroll = false,
|
|
42
42
|
backgroundColor,
|
|
43
43
|
withoutBackgroundImage = false,
|
|
44
|
-
backgroundImage =
|
|
44
|
+
backgroundImage = ImageResources[`light_background_1`],
|
|
45
45
|
extendedBackground = false,
|
|
46
46
|
...scrollViewProps
|
|
47
47
|
},
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React, {useRef, useState} from 'react';
|
|
2
2
|
import {
|
|
3
|
-
NativeSyntheticEvent,
|
|
4
3
|
StyleSheet,
|
|
4
|
+
View,
|
|
5
5
|
TextInput,
|
|
6
|
+
NativeSyntheticEvent,
|
|
6
7
|
TextInputKeyPressEventData,
|
|
7
8
|
ViewStyle,
|
|
8
9
|
} from 'react-native';
|
|
9
10
|
import {useTheme} from '../../core/theme/ThemeProvider';
|
|
10
11
|
import {CommonSizes} from '../../core/theme/commonSizes';
|
|
11
|
-
import {scaleWidth} from '../../core/theme/scaling';
|
|
12
12
|
import {PrimaryTextInput} from './PrimaryTextInput';
|
|
13
|
+
import {scaleWidth} from '../../core/theme/scaling';
|
|
13
14
|
import {RTLAwareView} from './RTLAwareView';
|
|
14
15
|
|
|
15
16
|
interface OTPInputProps {
|
|
@@ -17,12 +17,12 @@ import {
|
|
|
17
17
|
TouchablePlatformProps,
|
|
18
18
|
} from '../../../types';
|
|
19
19
|
import {useTheme} from '../../core/theme/ThemeProvider';
|
|
20
|
+
import {BorderRadius, Spacing} from '../../core/theme/commonSizes';
|
|
20
21
|
import {createThemedStyles} from '../../core/theme/commonStyles';
|
|
21
22
|
import {Theme} from '../../core/theme/types';
|
|
22
23
|
import {IconPlatform} from './IconPlatform';
|
|
23
24
|
import {TouchablePlatform} from './TouchablePlatform';
|
|
24
25
|
import {scaleHeight, scaleSpacing} from '../../core/theme/scaling';
|
|
25
|
-
import {CommonSizes} from '../../core/theme/commonSizes';
|
|
26
26
|
|
|
27
27
|
interface IProps extends TouchablePlatformProps {
|
|
28
28
|
label: string;
|
|
@@ -58,7 +58,7 @@ export const PrimaryButton: FC<IProps> = memo(
|
|
|
58
58
|
return (
|
|
59
59
|
<ActivityIndicator
|
|
60
60
|
animating={true}
|
|
61
|
-
color={theme.colors.
|
|
61
|
+
color={theme.colors.backgroundOpacity}
|
|
62
62
|
size={'small'}
|
|
63
63
|
/>
|
|
64
64
|
);
|
|
@@ -91,7 +91,7 @@ export const PrimaryButton: FC<IProps> = memo(
|
|
|
91
91
|
return (
|
|
92
92
|
<TouchablePlatform
|
|
93
93
|
style={[styles.button, style] as ViewStyle[]}
|
|
94
|
-
highlightColor={theme.colors.
|
|
94
|
+
highlightColor={theme.colors.mutedLavender30}
|
|
95
95
|
{...props}>
|
|
96
96
|
{content}
|
|
97
97
|
</TouchablePlatform>
|
|
@@ -158,19 +158,19 @@ function mergeStylesWithDisabled(
|
|
|
158
158
|
...styles,
|
|
159
159
|
button: {
|
|
160
160
|
...styles.button,
|
|
161
|
-
backgroundColor: theme.colors.
|
|
161
|
+
backgroundColor: theme.colors.mutedLavender30,
|
|
162
162
|
borderColor: outline
|
|
163
|
-
? theme.colors.
|
|
163
|
+
? theme.colors.mutedLavender
|
|
164
164
|
: styles.button.borderColor,
|
|
165
165
|
elevation: 0,
|
|
166
166
|
} as ViewStyle,
|
|
167
167
|
icon: {
|
|
168
168
|
...styles.icon,
|
|
169
|
-
tintColor: theme.colors.
|
|
169
|
+
tintColor: theme.colors.mutedLavender,
|
|
170
170
|
} as ImageStyle,
|
|
171
171
|
label: {
|
|
172
172
|
...styles.label,
|
|
173
|
-
color: theme.colors.
|
|
173
|
+
color: theme.colors.backgroundOpacity,
|
|
174
174
|
} as TextStyle,
|
|
175
175
|
};
|
|
176
176
|
}
|
|
@@ -194,7 +194,7 @@ function createButtonStyles(theme: Theme) {
|
|
|
194
194
|
|
|
195
195
|
const commonLabelStyle: TextStyle = {
|
|
196
196
|
...createThemedStyles(theme).h4_bold,
|
|
197
|
-
color: theme.colors.
|
|
197
|
+
color: theme.colors.white,
|
|
198
198
|
textAlign: 'center',
|
|
199
199
|
textAlignVertical: 'center',
|
|
200
200
|
...Platform.select({
|
|
@@ -209,26 +209,26 @@ function createButtonStyles(theme: Theme) {
|
|
|
209
209
|
height: 22,
|
|
210
210
|
marginHorizontal: scaleSpacing(12),
|
|
211
211
|
resizeMode: 'contain',
|
|
212
|
-
tintColor: theme.colors.
|
|
212
|
+
tintColor: theme.colors.indigoBlue,
|
|
213
213
|
};
|
|
214
214
|
|
|
215
215
|
return {
|
|
216
216
|
solid: StyleSheet.create({
|
|
217
217
|
button: {
|
|
218
218
|
...commonButtonStyle,
|
|
219
|
-
backgroundColor: theme.colors.
|
|
219
|
+
backgroundColor: theme.colors.indigoBlue,
|
|
220
220
|
} as ViewStyle,
|
|
221
221
|
label: theme.text.button,
|
|
222
222
|
icon: {
|
|
223
223
|
...commonIcon,
|
|
224
|
-
tintColor: theme.colors.
|
|
224
|
+
tintColor: theme.colors.white,
|
|
225
225
|
},
|
|
226
226
|
}),
|
|
227
227
|
|
|
228
228
|
outline: StyleSheet.create({
|
|
229
229
|
button: {
|
|
230
230
|
...commonButtonStyle,
|
|
231
|
-
borderColor: theme.colors.
|
|
231
|
+
borderColor: theme.colors.indigoBlue,
|
|
232
232
|
borderWidth: 2,
|
|
233
233
|
} as ViewStyle,
|
|
234
234
|
label: {
|
|
@@ -240,7 +240,7 @@ function createButtonStyles(theme: Theme) {
|
|
|
240
240
|
outlineNegative: StyleSheet.create({
|
|
241
241
|
button: {
|
|
242
242
|
...commonButtonStyle,
|
|
243
|
-
borderColor: theme.colors.
|
|
243
|
+
borderColor: theme.colors.mutedLavender,
|
|
244
244
|
borderWidth: 2,
|
|
245
245
|
} as ViewStyle,
|
|
246
246
|
label: {
|
|
@@ -248,7 +248,7 @@ function createButtonStyles(theme: Theme) {
|
|
|
248
248
|
} as TextStyle,
|
|
249
249
|
icon: {
|
|
250
250
|
...commonIcon,
|
|
251
|
-
tintColor: theme.colors.
|
|
251
|
+
tintColor: theme.colors.mutedLavender,
|
|
252
252
|
},
|
|
253
253
|
}),
|
|
254
254
|
|
|
@@ -271,12 +271,12 @@ function createSmallSolidStyles(theme: Theme): IStyles {
|
|
|
271
271
|
const commonStyles = createThemedStyles(theme);
|
|
272
272
|
return StyleSheet.create({
|
|
273
273
|
button: {
|
|
274
|
-
padding:
|
|
274
|
+
padding: Spacing.medium,
|
|
275
275
|
alignItems: 'center',
|
|
276
276
|
justifyContent: 'center',
|
|
277
|
-
borderRadius:
|
|
277
|
+
borderRadius: BorderRadius.extraLarge,
|
|
278
278
|
flexDirection: 'row',
|
|
279
|
-
backgroundColor: theme.colors.
|
|
279
|
+
backgroundColor: theme.colors.indigoBlue,
|
|
280
280
|
// width: 175,
|
|
281
281
|
} as ViewStyle,
|
|
282
282
|
label: {
|
|
@@ -286,7 +286,7 @@ function createSmallSolidStyles(theme: Theme): IStyles {
|
|
|
286
286
|
width: 22,
|
|
287
287
|
height: 22,
|
|
288
288
|
resizeMode: 'contain',
|
|
289
|
-
tintColor: theme.colors.
|
|
289
|
+
tintColor: theme.colors.white,
|
|
290
290
|
} as ImageStyle,
|
|
291
291
|
});
|
|
292
292
|
}
|
|
@@ -295,25 +295,25 @@ function createSmallOutlineStyles(theme: Theme): IStyles {
|
|
|
295
295
|
const commonStyles = createThemedStyles(theme);
|
|
296
296
|
return StyleSheet.create({
|
|
297
297
|
button: {
|
|
298
|
-
padding:
|
|
298
|
+
padding: Spacing.medium,
|
|
299
299
|
alignItems: 'center',
|
|
300
300
|
justifyContent: 'center',
|
|
301
|
-
borderRadius:
|
|
301
|
+
borderRadius: BorderRadius.extraLarge,
|
|
302
302
|
flexDirection: 'row',
|
|
303
303
|
backgroundColor: 'transparent',
|
|
304
304
|
width: 175,
|
|
305
|
-
borderColor: theme.colors.
|
|
305
|
+
borderColor: theme.colors.indigoBlue,
|
|
306
306
|
borderWidth: 1,
|
|
307
307
|
} as ViewStyle,
|
|
308
308
|
label: {
|
|
309
309
|
...commonStyles.normalText,
|
|
310
|
-
color: theme.colors.
|
|
310
|
+
color: theme.colors.indigoBlue,
|
|
311
311
|
} as TextStyle,
|
|
312
312
|
icon: {
|
|
313
313
|
width: 22,
|
|
314
314
|
height: 22,
|
|
315
315
|
resizeMode: 'contain',
|
|
316
|
-
tintColor: theme.colors.
|
|
316
|
+
tintColor: theme.colors.indigoBlue,
|
|
317
317
|
} as ImageStyle,
|
|
318
318
|
});
|
|
319
319
|
}
|