@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.
Files changed (60) hide show
  1. package/.vscode/settings.json +7 -0
  2. package/package.json +1 -1
  3. package/template/App.tsx +30 -9
  4. package/template/package-lock.json +170 -123
  5. package/template/package.json +1 -0
  6. package/template/src/common/ImageResources.g.ts +3 -5
  7. package/template/src/common/components/Background.tsx +66 -28
  8. package/template/src/common/components/Cards.tsx +116 -0
  9. package/template/src/common/components/Container.tsx +145 -0
  10. package/template/src/common/components/FlatListWrapper.tsx +1 -0
  11. package/template/src/common/components/ImageCropPickerButton.tsx +1 -1
  12. package/template/src/common/components/OTPInput.tsx +107 -0
  13. package/template/src/common/components/PhotoTakingButton.tsx +1 -4
  14. package/template/src/common/components/PrimaryButton.tsx +171 -157
  15. package/template/src/common/components/RTLAwareText.tsx +42 -0
  16. package/template/src/common/components/RTLAwareView.tsx +179 -0
  17. package/template/src/common/components/RadioButton.tsx +1 -3
  18. package/template/src/common/components/RadioIcon.tsx +1 -2
  19. package/template/src/common/components/SearchBar.tsx +179 -0
  20. package/template/src/common/components/Separator.tsx +7 -4
  21. package/template/src/common/components/TouchablePlatform.tsx +1 -3
  22. package/template/src/common/components/TryAgain.tsx +3 -3
  23. package/template/src/common/helpers/inAppReviewHelper.ts +0 -1
  24. package/template/src/common/helpers/stringsHelpers.ts +10 -0
  25. package/template/src/common/hooks/useFlatListActions.ts +1 -1
  26. package/template/src/common/localization/LocalizationProvider.tsx +152 -0
  27. package/template/src/common/localization/README.md +488 -0
  28. package/template/src/common/localization/localization.ts +12 -0
  29. package/template/src/common/localization/translations/profileLocalization.ts +24 -0
  30. package/template/src/common/validations/errorValidations.ts +1 -6
  31. package/template/src/common/validations/examples/TextInputWithValidation.tsx +229 -0
  32. package/template/src/common/validations/index.ts +28 -0
  33. package/template/src/common/validations/regex.js +83 -0
  34. package/template/src/common/validations/regexValidator.ts +240 -0
  35. package/template/src/common/validations/validationConstants.ts +2 -2
  36. package/template/src/core/api/errorHandler.ts +39 -0
  37. package/template/src/core/api/responseHandlers.ts +1 -26
  38. package/template/src/core/api/serverHeaders.ts +13 -23
  39. package/template/src/core/store/app/appSlice.ts +1 -2
  40. package/template/src/core/theme/ThemeProvider.tsx +63 -0
  41. package/template/src/core/theme/colors.ts +31 -42
  42. package/template/src/core/theme/commonConsts.ts +1 -1
  43. package/template/src/core/theme/commonStyles.ts +267 -210
  44. package/template/src/core/theme/fonts.ts +17 -1
  45. package/template/src/core/theme/scaling.ts +101 -0
  46. package/template/src/core/theme/themes.ts +214 -0
  47. package/template/src/core/theme/types.ts +51 -0
  48. package/template/src/navigation/AuthStack.tsx +25 -30
  49. package/template/src/navigation/HeaderComponents.tsx +18 -58
  50. package/template/src/navigation/MainNavigation.tsx +5 -6
  51. package/template/src/navigation/MainStack.tsx +3 -28
  52. package/template/src/navigation/RootNavigation.tsx +1 -7
  53. package/template/src/navigation/TabBar.tsx +2 -2
  54. package/template/src/navigation/TopTabBar.tsx +1 -1
  55. package/template/src/screens/Login/Login.tsx +3 -3
  56. package/template/src/screens/home/components/CarouselSection.tsx +7 -8
  57. package/template/src/screens/home/components/FeaturedCarousel.tsx +5 -6
  58. package/template/src/screens/registration/RegistrationScreen.tsx +2 -2
  59. package/template/src/screens/resetPassword/ForgotPasswordScreen.tsx +2 -2
  60. package/template/src/utils/stringBuilder.js +25 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "workbench.colorCustomizations": {
3
+ "activityBar.background": "#342D0C",
4
+ "titleBar.activeBackground": "#493F10",
5
+ "titleBar.activeForeground": "#FCFAF0"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fadyshawky/react-native-magic",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "react native template with ready components, hooks, react navigation, redux, typescript, etc.",
5
5
  "keywords": [
6
6
  "react-native-magic",
package/template/App.tsx CHANGED
@@ -4,27 +4,48 @@
4
4
  *
5
5
  * @format
6
6
  */
7
- import React from 'react';
8
- import {LogBox, SafeAreaView, StatusBar} from 'react-native';
7
+ import React, {useEffect} from 'react';
8
+ import {ImageBackground, LogBox, SafeAreaView, StatusBar} from 'react-native';
9
9
  import {SheetProvider} from 'react-native-actions-sheet';
10
10
  import {SafeAreaProvider} from 'react-native-safe-area-context';
11
11
  import {Provider} from 'react-redux';
12
12
  import {PersistGate} from 'redux-persist/integration/react';
13
+ import {LocalizationProvider} from './src/common/localization/LocalizationProvider';
14
+ import {
15
+ Languages,
16
+ DEFAULT_LANGUAGE,
17
+ } from './src/common/localization/localization';
13
18
  import {persistor, store} from './src/core/store/store';
14
19
  import AppNavigator from './src/navigation/MainNavigation';
20
+ import {ThemeProvider, useTheme} from './src/core/theme/ThemeProvider';
15
21
 
16
22
  LogBox.ignoreAllLogs();
23
+
24
+ const ThemedApp = () => {
25
+ const {theme} = useTheme();
26
+ return (
27
+ <SafeAreaProvider>
28
+ <SafeAreaView style={{position: 'absolute'}} />
29
+ <StatusBar
30
+ barStyle={theme.mode === 'dark' ? 'light-content' : 'dark-content'}
31
+ backgroundColor={theme.colors.background}
32
+ />
33
+ <SheetProvider>
34
+ <AppNavigator />
35
+ </SheetProvider>
36
+ </SafeAreaProvider>
37
+ );
38
+ };
39
+
17
40
  function App(): React.JSX.Element {
18
41
  return (
19
42
  <Provider store={store}>
20
43
  <PersistGate loading={null} persistor={persistor}>
21
- <SafeAreaProvider>
22
- <SafeAreaView style={{position: 'absolute'}} />
23
- <StatusBar barStyle={'dark-content'} backgroundColor={'white'} />
24
- <SheetProvider>
25
- <AppNavigator />
26
- </SheetProvider>
27
- </SafeAreaProvider>
44
+ <LocalizationProvider initialLanguage={DEFAULT_LANGUAGE}>
45
+ <ThemeProvider initialTheme="dark">
46
+ <ThemedApp />
47
+ </ThemeProvider>
48
+ </LocalizationProvider>
28
49
  </PersistGate>
29
50
  </Provider>
30
51
  );