@fadyshawky/react-native-magic 1.0.3 → 1.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +2 -4
  3. package/local.properties +1 -0
  4. package/package.json +2 -3
  5. package/template/.env.development +3 -0
  6. package/template/.env.production +4 -1
  7. package/template/.env.staging +4 -1
  8. package/template/App.tsx +0 -1
  9. package/template/android/app/build.gradle +71 -6
  10. package/template/android/app/src/main/AndroidManifest.xml +2 -0
  11. package/template/android/app/src/main/java/com/reactnativemagic/MainActivity.kt +5 -0
  12. package/template/android/gradle.properties +0 -1
  13. package/template/babel.config.js +1 -0
  14. package/template/index.js +1 -1
  15. package/template/ios/Podfile +37 -6
  16. package/template/ios/Podfile.lock +2 -2
  17. package/template/ios/reactnativemagic/Info.plist +4 -0
  18. package/template/ios/reactnativemagic.xcodeproj/project.pbxproj +67 -67
  19. package/template/ios/tmp.xcconfig +2 -0
  20. package/template/metro.config.js +6 -1
  21. package/template/package-lock.json +13 -12
  22. package/template/package.json +7 -6
  23. package/template/src/common/components/Background.tsx +0 -1
  24. package/template/src/common/components/ImageCropPickerButton.tsx +4 -5
  25. package/template/src/common/components/LoadingComponent.tsx +1 -6
  26. package/template/src/common/components/PhotoTakingButton.tsx +5 -7
  27. package/template/src/common/components/PrimaryTextInput.tsx +4 -15
  28. package/template/src/common/components/RadioButton.tsx +2 -9
  29. package/template/src/common/components/RadioIcon.tsx +4 -12
  30. package/template/src/common/components/Separator.tsx +2 -9
  31. package/template/src/common/components/TouchablePlatform.tsx +2 -11
  32. package/template/src/common/components/TryAgain.tsx +2 -9
  33. package/template/src/core/store/user/userActions.ts +0 -3
  34. package/template/src/core/theme/colors.ts +42 -71
  35. package/template/src/core/theme/fonts.ts +1 -12
  36. package/template/src/navigation/HeaderComponents.tsx +3 -5
  37. package/template/src/navigation/MainNavigation.tsx +8 -6
  38. package/template/src/navigation/MainStack.tsx +0 -1
  39. package/template/src/screens/Login/Login.tsx +0 -6
  40. package/template/src/types/react-native-config.d.ts +8 -0
  41. package/template/src/common/helpers/colorHelpers.ts +0 -34
@@ -1,11 +1,6 @@
1
1
  import React, {FC, memo, useMemo} from 'react';
2
2
  import {StyleSheet, View, ViewStyle} from 'react-native';
3
- import {
4
- Colors,
5
- PlatformColorsAndroid,
6
- PlatformColorsIOS,
7
- } from '../../core/theme/colors';
8
- import {platformMixedColor, platformNativeColor} from '../helpers/colorHelpers';
3
+ import {Colors} from '../../core/theme/colors';
9
4
 
10
5
  interface IProps {
11
6
  isSelected: boolean;
@@ -47,17 +42,14 @@ const commonInnerCircle: ViewStyle = {
47
42
  const styles = StyleSheet.create({
48
43
  outerCircle: {
49
44
  ...commonOuterCircle,
50
- borderColor: platformMixedColor(PlatformColorsIOS.systemFill, Colors.black),
45
+ borderColor: Colors.primary100,
51
46
  } as ViewStyle,
52
47
  outerCircleSelected: {
53
48
  ...commonOuterCircle,
54
- borderColor: platformMixedColor(PlatformColorsIOS.systemBlue, Colors.black),
49
+ borderColor: Colors.primary100,
55
50
  } as ViewStyle,
56
51
  innerCircle: {
57
52
  ...commonInnerCircle,
58
- backgroundColor: platformNativeColor(
59
- PlatformColorsIOS.systemBlue,
60
- PlatformColorsAndroid.primary,
61
- ),
53
+ backgroundColor: Colors.primary100,
62
54
  } as ViewStyle,
63
55
  });
@@ -1,12 +1,8 @@
1
1
  import React, {FC, useMemo} from 'react';
2
2
  import {StyleSheet, View, ViewStyle} from 'react-native';
3
- import {
4
- PlatformColorsAndroid,
5
- PlatformColorsIOS,
6
- } from '../../core/theme/colors';
3
+ import {Colors} from '../../core/theme/colors';
7
4
  import {hairlineWidth} from '../../core/theme/commonConsts';
8
5
  import {CommonSizes} from '../../core/theme/commonSizes';
9
- import {platformNativeColor} from '../helpers/colorHelpers';
10
6
 
11
7
  interface IProps {
12
8
  isFull?: boolean;
@@ -22,10 +18,7 @@ export const Separator: FC<IProps> = ({isFull = true}) => {
22
18
 
23
19
  const sharedStyle: ViewStyle = {
24
20
  height: hairlineWidth,
25
- backgroundColor: platformNativeColor(
26
- PlatformColorsIOS.separator,
27
- PlatformColorsAndroid.divider,
28
- ),
21
+ backgroundColor: Colors.gray,
29
22
  };
30
23
 
31
24
  const styles = StyleSheet.create({
@@ -7,9 +7,8 @@ import {
7
7
  PressableStateCallbackType,
8
8
  ViewStyle,
9
9
  } from 'react-native';
10
- import {Colors, PlatformColorsIOS} from '../../core/theme/colors';
10
+ import {Colors} from '../../core/theme/colors';
11
11
  import {isAndroid} from '../../core/theme/commonConsts';
12
- import {platformMixedColor} from '../helpers/colorHelpers';
13
12
 
14
13
  interface IProps extends PressableProps {
15
14
  style?: ViewStyle | ViewStyle[];
@@ -17,15 +16,7 @@ interface IProps extends PressableProps {
17
16
  }
18
17
 
19
18
  export const TouchablePlatform: FC<IProps> = memo(
20
- ({
21
- children,
22
- highlightColor = platformMixedColor(
23
- PlatformColorsIOS.secondarySystemFill,
24
- Colors.white,
25
- ),
26
- style,
27
- ...props
28
- }) => {
19
+ ({children, highlightColor = Colors.white, style, ...props}) => {
29
20
  const pressableStyle = useCallback(
30
21
  (state: PressableStateCallbackType) => {
31
22
  if (isAndroid) {
@@ -6,13 +6,9 @@ import {
6
6
  TouchableOpacity,
7
7
  View,
8
8
  } from 'react-native';
9
- import {
10
- PlatformColorsAndroid,
11
- PlatformColorsIOS,
12
- } from '../../core/theme/colors';
9
+ import {Colors} from '../../core/theme/colors';
13
10
  import {CommonSizes} from '../../core/theme/commonSizes';
14
11
  import {CommonStyles} from '../../core/theme/commonStyles';
15
- import {platformNativeColor} from '../helpers/colorHelpers';
16
12
  import {localization} from '../localization/localization';
17
13
 
18
14
  interface IProps {
@@ -46,10 +42,7 @@ const styles = StyleSheet.create({
46
42
  } as TextStyle,
47
43
  description: {
48
44
  ...CommonStyles.normalText,
49
- color: platformNativeColor(
50
- PlatformColorsIOS.systemBlue,
51
- PlatformColorsAndroid.primary,
52
- ),
45
+ color: Colors.primary100,
53
46
  textAlign: 'center',
54
47
  textDecorationLine: 'underline',
55
48
  } as TextStyle,
@@ -19,9 +19,6 @@ export const userLogin = createAsyncThunk(
19
19
  data,
20
20
  });
21
21
 
22
- if (response.data?.user?.roleName !== 'Parent') {
23
- return rejectWithValue('Not Authorized');
24
- }
25
22
  return handleFetchJsonResponse(response);
26
23
  } catch (e: any) {
27
24
  return rejectWithValue(e?.response);
@@ -43,75 +43,46 @@ export enum Colors {
43
43
  yellow5 = '#FFFDF8',
44
44
  }
45
45
 
46
- export enum PlatformColorsIOS {
47
- /* Label Colors */
48
- label = 'label',
49
- secondaryLabel = 'secondaryLabel',
50
- tertiaryLabel = 'tertiaryLabel',
51
- quaternaryLabel = 'quaternaryLabel',
52
-
53
- /* Fill Colors */
54
- systemFill = 'systemFill',
55
- secondarySystemFill = 'secondarySystemFill',
56
- tertiarySystemFill = 'tertiarySystemFill',
57
- quaternarySystemFill = 'quaternarySystemFill',
58
-
59
- /* Text Colors */
60
- placeholderText = 'placeholderText',
61
-
62
- /* Standard Content Background Colors */
63
- systemBackground = 'systemBackground',
64
- secondarySystemBackground = 'secondarySystemBackground',
65
- tertiarySystemBackground = 'tertiarySystemBackground',
66
-
67
- /* Grouped Content Background Colors */
68
- systemGroupedBackground = 'systemGroupedBackground',
69
- secondarySystemGroupedBackground = 'secondarySystemGroupedBackground',
70
- tertiarySystemGroupedBackground = 'tertiarySystemGroupedBackground',
71
-
72
- /* Separator Colors */
73
- separator = 'separator',
74
- opaqueSeparator = 'opaqueSeparator',
75
-
76
- /* Link Color */
77
- link = 'link',
78
-
79
- /* Nonadaptable Colors */
80
- darkText = 'darkText',
81
- lightText = 'lightText',
82
-
83
- /* Standard Colors */
84
- /* Adaptable Colors */
85
- systemBlue = 'systemBlue',
86
- systemGreen = 'systemGreen',
87
- systemIndigo = 'systemIndigo',
88
- systemOrange = 'systemOrange',
89
- systemPink = 'systemPink',
90
- systemPurple = 'systemPurple',
91
- systemRed = 'systemRed',
92
- systemTeal = 'systemTeal',
93
- systemYellow = 'systemYellow',
94
-
95
- /* Adaptable Gray Colors */
96
- systemGray = 'systemGray',
97
- systemGray2 = 'systemGray2',
98
- systemGray3 = 'systemGray3',
99
- systemGray4 = 'systemGray4',
100
- systemGray5 = 'systemGray5',
101
- systemGray6 = 'systemGray6',
102
- }
103
-
104
- export enum PlatformColorsAndroid {
105
- primary = '@color/primary',
106
- primaryDark = '@color/primaryDark',
107
- primaryLight = '@color/primaryLight',
108
- background = '@color/background',
109
- primaryText = '@color/primaryText',
110
- primaryTextOpacity = '@color/primaryTextOpacity',
111
- secondaryText = '@color/secondaryText',
112
- onPrimaryText = '@color/onPrimaryText',
113
- onPrimaryTextOpacity = '@color/onPrimaryTextOpacity',
114
- divider = '@color/divider',
115
- navigation = '@color/navigation',
116
- statusbar = '@color/statusbar',
46
+ export enum NewColors {
47
+ violetLight = '#F3F2FF',
48
+ violetLightHover = '#E6E6FF',
49
+ violetLightActive = '#C1C0FE',
50
+ violetNormal = '#8481FD',
51
+ violetNormalHover = '#5250D9',
52
+ violetNormalActive = '#3331B8',
53
+ violetDark = '#262626',
54
+ violetDarkHover = '#1A1994',
55
+ violetDarkActive = '#111066',
56
+ violetDarker = '#000033',
57
+ blueLight = '#F6FCFF',
58
+ blueLightHover = '#E9F8FF',
59
+ blueLightActive = '#C1E5FF',
60
+ blueNormal = '#52BDFF',
61
+ blueNormalHover = '#3399D9',
62
+ blueNormalActive = '#1A7DB3',
63
+ blueDarker = '#262626',
64
+ greyLight = '#F9FCFF',
65
+ greyLightHover = '#E0E0E0',
66
+ greyLightActive = '#BDBDBD',
67
+ greyNormal = '#929292',
68
+ greyNormalHover = '#666666',
69
+ greyNormalActive = '#4D4D4D',
70
+ greyDarker = '#262626',
71
+ orandeLight = '#FFFAF8',
72
+ orandeLightHover = '#FDECE1',
73
+ orandeLightActive = '#FBCEB4',
74
+ orandeNormal = '#F2565E',
75
+ orandeNormalHover = '#CE3C3E',
76
+ orandeNormalActive = '#AD3335',
77
+ orandeDarker = '#262626',
78
+ lightBlueLight = '#FEF7F7',
79
+ lightBlueLightHover = '#FCDDDF',
80
+ lightBlueLightActive = '#F9AAAF',
81
+ lightBlueNormal = '#CE3C3E',
82
+ lightBlueNormalHover = '#AD3335',
83
+ lightBlueNormalActive = '#8C292B',
84
+ lightBlueDarker = '#262626',
85
+ red = '#FFFCF1',
86
+ green = '#F4FDFB',
87
+ background = '#FAFAFA',
117
88
  }
@@ -1,12 +1 @@
1
- export const Fonts = {
2
- system: 'System',
3
- thin: 'KumbhSans-Thin',
4
- light: 'KumbhSans-Light',
5
- extraLight: 'KumbhSans-ExtraLight',
6
- regular: 'KumbhSans-Regular',
7
- medium: 'KumbhSans-Medium',
8
- semiBold: 'KumbhSans-SemiBold',
9
- bold: 'KumbhSans-Bold',
10
- extraBold: 'KumbhSans-ExtraBold',
11
- black: 'KumbhSans-Black',
12
- };
1
+ export const Fonts = {};
@@ -1,10 +1,8 @@
1
+ import {NativeStackNavigationProp} from '@react-navigation/native-stack';
1
2
  import React from 'react';
2
- import {View, Text, TouchableOpacity, Image, StyleSheet} from 'react-native';
3
- import {CommonStyles, screenWidth} from '../core/theme/commonStyles';
4
- import {BottomTabHeaderProps} from '@react-navigation/bottom-tabs';
5
- import {ImageResources} from '../common/ImageResources.g';
3
+ import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native';
6
4
  import {CommonSizes} from '../core/theme/commonSizes';
7
- import {NativeStackNavigationProp} from '@react-navigation/native-stack';
5
+ import {CommonStyles, screenWidth} from '../core/theme/commonStyles';
8
6
  import {RootStackParamList} from './types';
9
7
 
10
8
  export function Header({title}: {title: string}) {
@@ -1,12 +1,14 @@
1
1
  // In App.js in a new project
2
2
 
3
- import {NavigationContainer} from '@react-navigation/native';
3
+ import {DefaultTheme, NavigationContainer} from '@react-navigation/native';
4
4
  import * as React from 'react';
5
5
  import {useRef} from 'react';
6
6
  import {useAppSelector} from '../core/store/reduxHelpers';
7
7
  import {AuthStack} from './AuthStack';
8
8
  import {AppMainNavigator} from './MainStack';
9
9
  import {navigationRef} from './RootNavigation';
10
+ import {NewColors} from '../core/theme/colors';
11
+ import {Fonts} from '../core/theme/fonts';
10
12
 
11
13
  function AppNavigator() {
12
14
  const routeNameRef = useRef<string | undefined>(undefined);
@@ -19,7 +21,7 @@ function AppNavigator() {
19
21
  dark: false,
20
22
  colors: {
21
23
  primary: '#000',
22
- background: 'transparent',
24
+ background: NewColors.background,
23
25
  card: '#fff',
24
26
  text: '#000',
25
27
  border: '#000',
@@ -27,19 +29,19 @@ function AppNavigator() {
27
29
  },
28
30
  fonts: {
29
31
  regular: {
30
- fontFamily: 'System',
32
+ fontFamily: Fonts.regular,
31
33
  fontWeight: 'normal',
32
34
  },
33
35
  medium: {
34
- fontFamily: 'System',
36
+ fontFamily: Fonts.medium,
35
37
  fontWeight: '500',
36
38
  },
37
39
  bold: {
38
- fontFamily: 'System',
40
+ fontFamily: Fonts.bold,
39
41
  fontWeight: '700',
40
42
  },
41
43
  heavy: {
42
- fontFamily: 'System',
44
+ fontFamily: Fonts.bold,
43
45
  fontWeight: '900',
44
46
  },
45
47
  },
@@ -5,7 +5,6 @@ import {
5
5
  NativeStackNavigationProp,
6
6
  } from '@react-navigation/native-stack';
7
7
  import React from 'react';
8
- import {ImageResources} from '../common/ImageResources.g';
9
8
  import {localization} from '../common/localization/localization';
10
9
  import {Main} from '../screens/main/Main';
11
10
  import {Profile} from '../screens/profile/Profile';
@@ -1,4 +1,3 @@
1
- import {useNavigation} from '@react-navigation/native';
2
1
  import {toLower} from 'lodash';
3
2
  import React, {useRef, useState} from 'react';
4
3
  import {
@@ -78,11 +77,6 @@ export function Login(): JSX.Element {
78
77
  label={localization.login.Password}
79
78
  placeholder={localization.login.EnterPassword}
80
79
  />
81
- <PrimaryButton
82
- label={localization.login.forgetPassword}
83
- type={ButtonType.borderless}
84
- style={{alignSelf: 'flex-end'}}
85
- />
86
80
  <PrimaryButton
87
81
  isLoading={loading}
88
82
  onPress={loginUser}
@@ -0,0 +1,8 @@
1
+ declare module 'react-native-config' {
2
+ export interface NativeConfig {
3
+ API_BASE_URL: string;
4
+ [key: string]: string;
5
+ }
6
+ const Config: NativeConfig;
7
+ export default Config;
8
+ }
@@ -1,34 +0,0 @@
1
- import {isIos} from '../../core/theme/commonConsts';
2
- import {
3
- Colors,
4
- PlatformColorsAndroid,
5
- PlatformColorsIOS,
6
- } from '../../core/theme/colors';
7
-
8
- export function platformNativeColor(
9
- iosColor?: PlatformColorsIOS,
10
- androidColor?: PlatformColorsAndroid,
11
- ) {
12
- const selectedColor = isIos ? iosColor : androidColor;
13
-
14
- return selectedColor != null ? 'black' : undefined;
15
- }
16
-
17
- export function platformLocalColor(iosColor?: Colors, androidColor?: Colors) {
18
- return isIos ? iosColor : androidColor;
19
- }
20
-
21
- export function platformMixedColor(
22
- iosColor?: Colors | PlatformColorsIOS,
23
- androidColor?: Colors | PlatformColorsAndroid,
24
- ) {
25
- const selectedColor = iosColor;
26
-
27
- if (selectedColor != null) {
28
- return Object.values(Colors).includes(selectedColor as Colors)
29
- ? (selectedColor as Colors)
30
- : 'black';
31
- } else {
32
- return undefined;
33
- }
34
- }