nx-react-native-cli 1.0.16 → 1.0.18

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 (89) hide show
  1. package/lib/index.cjs +32 -32
  2. package/package.json +5 -1
  3. package/templates/.eslintrc.json +1 -0
  4. package/templates/.nvmrc +1 -1
  5. package/templates/apps/mobile/android/app/build.gradle +12 -24
  6. package/templates/apps/mobile/android/app/proguard-rules.pro +20 -0
  7. package/templates/apps/mobile/android/build.gradle +6 -19
  8. package/templates/apps/mobile/babel.config.json +2 -1
  9. package/templates/apps/mobile/export-node-binary.sh +6 -0
  10. package/templates/apps/mobile/jest.config.ts +12 -0
  11. package/templates/apps/mobile/package.json +6 -1
  12. package/templates/apps/mobile/project.json +3 -2
  13. package/templates/apps/mobile/react-native.config.js +7 -0
  14. package/templates/apps/mobile/src/app/index.tsx +7 -1
  15. package/templates/apps/mobile/src/assets/fonts/InterBlack.ttf +0 -0
  16. package/templates/apps/mobile/src/assets/fonts/InterBlackItalic.ttf +0 -0
  17. package/templates/apps/mobile/src/assets/fonts/InterBold.ttf +0 -0
  18. package/templates/apps/mobile/src/assets/fonts/InterBoldItalic.ttf +0 -0
  19. package/templates/apps/mobile/src/assets/fonts/InterExtraBold.ttf +0 -0
  20. package/templates/apps/mobile/src/assets/fonts/InterExtraBoldItalic.ttf +0 -0
  21. package/templates/apps/mobile/src/assets/fonts/InterExtraLight.ttf +0 -0
  22. package/templates/apps/mobile/src/assets/fonts/InterExtraLightItalic.ttf +0 -0
  23. package/templates/apps/mobile/src/assets/fonts/InterItalic.ttf +0 -0
  24. package/templates/apps/mobile/src/assets/fonts/InterLight.ttf +0 -0
  25. package/templates/apps/mobile/src/assets/fonts/InterLightItalic.ttf +0 -0
  26. package/templates/apps/mobile/src/assets/fonts/InterMedium.ttf +0 -0
  27. package/templates/apps/mobile/src/assets/fonts/InterMediumItalic.ttf +0 -0
  28. package/templates/apps/mobile/src/assets/fonts/InterRegular.ttf +0 -0
  29. package/templates/apps/mobile/src/assets/fonts/InterSemiBold.ttf +0 -0
  30. package/templates/apps/mobile/src/assets/fonts/InterSemiBoldItalic.ttf +0 -0
  31. package/templates/apps/mobile/src/assets/fonts/InterThin.ttf +0 -0
  32. package/templates/apps/mobile/src/assets/fonts/InterThinItalic.ttf +0 -0
  33. package/templates/apps/mobile/src/assets/fonts/MontserratBlack.ttf +0 -0
  34. package/templates/apps/mobile/src/assets/fonts/MontserratBlackItalic.ttf +0 -0
  35. package/templates/apps/mobile/src/assets/fonts/MontserratBold.ttf +0 -0
  36. package/templates/apps/mobile/src/assets/fonts/MontserratBoldItalic.ttf +0 -0
  37. package/templates/apps/mobile/src/assets/fonts/MontserratExtraBold.ttf +0 -0
  38. package/templates/apps/mobile/src/assets/fonts/MontserratExtraBoldItalic.ttf +0 -0
  39. package/templates/apps/mobile/src/assets/fonts/MontserratExtraLight.ttf +0 -0
  40. package/templates/apps/mobile/src/assets/fonts/MontserratExtraLightItalic.ttf +0 -0
  41. package/templates/apps/mobile/src/assets/fonts/MontserratItalic.ttf +0 -0
  42. package/templates/apps/mobile/src/assets/fonts/MontserratLight.ttf +0 -0
  43. package/templates/apps/mobile/src/assets/fonts/MontserratLightItalic.ttf +0 -0
  44. package/templates/apps/mobile/src/assets/fonts/MontserratMedium.ttf +0 -0
  45. package/templates/apps/mobile/src/assets/fonts/MontserratMediumItalic.ttf +0 -0
  46. package/templates/apps/mobile/src/assets/fonts/MontserratRegular.ttf +0 -0
  47. package/templates/apps/mobile/src/assets/fonts/MontserratSemiBold.ttf +0 -0
  48. package/templates/apps/mobile/src/assets/fonts/MontserratSemiBoldItalic.ttf +0 -0
  49. package/templates/apps/mobile/src/assets/fonts/MontserratThin.ttf +0 -0
  50. package/templates/apps/mobile/src/assets/fonts/MontserratThinItalic.ttf +0 -0
  51. package/templates/apps/mobile/src/components/atoms/BottomSheet/bottom-sheet.component.tsx +9 -7
  52. package/templates/apps/mobile/src/components/atoms/Box/box.component.tsx +21 -0
  53. package/templates/apps/mobile/src/components/atoms/Box/index.ts +1 -0
  54. package/templates/apps/mobile/src/components/atoms/Button/button.component.tsx +24 -8
  55. package/templates/apps/mobile/src/components/atoms/Button/index.ts +0 -1
  56. package/templates/apps/mobile/src/components/atoms/Divider/divider-component.tsx +2 -2
  57. package/templates/apps/mobile/src/components/atoms/InputLayout/input-layout.component.tsx +12 -11
  58. package/templates/apps/mobile/src/components/atoms/ListLoadingItem/list-loading-item.component.tsx +17 -17
  59. package/templates/apps/mobile/src/components/atoms/Modal/modal.component.tsx +5 -4
  60. package/templates/apps/mobile/src/components/atoms/ScreenLoader/screen-loader.component.tsx +5 -4
  61. package/templates/apps/mobile/src/components/atoms/Skeleton/skeleton.component.tsx +2 -2
  62. package/templates/apps/mobile/src/components/atoms/TextInput/text-input.component.tsx +5 -5
  63. package/templates/apps/mobile/src/components/atoms/Typography/index.ts +1 -0
  64. package/templates/apps/mobile/src/components/atoms/{Text/text.component.tsx → Typography/typography.component.tsx} +1 -1
  65. package/templates/apps/mobile/src/components/atoms/index.ts +2 -1
  66. package/templates/apps/mobile/src/components/molecules/BackButton/back-button.component.tsx +4 -4
  67. package/templates/apps/mobile/src/components/molecules/BottomActionsContainer/BottomActionsContainer.component.tsx +1 -4
  68. package/templates/apps/mobile/src/components/molecules/ScreenContainer/screen-container.component.tsx +11 -9
  69. package/templates/apps/mobile/src/components/molecules/ScreenHeader/screen-header.component.tsx +13 -19
  70. package/templates/apps/mobile/src/components/molecules/StorageManager/StorageManager.component.tsx +1 -3
  71. package/templates/apps/mobile/src/hooks/index.ts +2 -1
  72. package/templates/apps/mobile/src/hooks/useToggleDarkMode.hook.tsx +9 -0
  73. package/templates/apps/mobile/src/routes/index.tsx +3 -3
  74. package/templates/apps/mobile/src/routes/privateRoutes.tsx +10 -7
  75. package/templates/apps/mobile/src/routes/publicRoutes.tsx +12 -9
  76. package/templates/apps/mobile/src/routes/screen-options.ts +1 -6
  77. package/templates/apps/mobile/src/routes/screens.enum.ts +1 -1
  78. package/templates/apps/mobile/src/screens/HomeScreen/home.screen.tsx +2 -2
  79. package/templates/apps/mobile/src/screens/LandingScreen/landing.screen.tsx +37 -0
  80. package/templates/apps/mobile/src/types/component.type.ts +1 -6
  81. package/templates/apps/mobile/src/utils/axios.util.ts +10 -0
  82. package/templates/apps/mobile/src/utils/index.ts +4 -0
  83. package/templates/apps/mobile/src/utils/log.util.ts +40 -0
  84. package/templates/apps/mobile/src/utils/route.util.ts +48 -0
  85. package/templates/apps/mobile/test-setup.ts +1 -0
  86. package/templates/apps/mobile/tsconfig.spec.json +20 -0
  87. package/templates/apps/mobile/src/components/atoms/Button/outlined-button.component.tsx +0 -59
  88. package/templates/apps/mobile/src/components/atoms/Text/index.ts +0 -1
  89. package/templates/apps/mobile/src/screens/LoginScreen/login.screen.tsx +0 -13
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { View } from 'react-native';
3
2
 
4
3
  import { tw } from '../../../tailwind';
5
4
  import { DefaultComponentProps } from '../../../types';
5
+ import { Box } from '../Box';
6
6
  import { Skeleton } from '../Skeleton';
7
7
 
8
8
  type Props = DefaultComponentProps & {
@@ -13,19 +13,19 @@ export function ListLoadingItemComponent(props: Props) {
13
13
  const { isLoading, style } = props;
14
14
 
15
15
  return (
16
- <View style={[style]}>
17
- <View style={[tw`gap-2`, style]}>
16
+ <Box style={[style]}>
17
+ <Box style={[tw`gap-2`, style]}>
18
18
  <Skeleton isLoading={isLoading}>
19
- {isLoading && <View style={tw`h-[100px] w-full`} />}
19
+ {isLoading && <Box style={tw`h-[100px] w-full`} />}
20
20
  </Skeleton>
21
21
  <Skeleton isLoading={isLoading}>
22
- {isLoading && <View style={tw`h-[100px] w-full`} />}
22
+ {isLoading && <Box style={tw`h-[100px] w-full`} />}
23
23
  </Skeleton>
24
24
  <Skeleton isLoading={isLoading}>
25
- {isLoading && <View style={tw`h-[100px] w-full`} />}
25
+ {isLoading && <Box style={tw`h-[100px] w-full`} />}
26
26
  </Skeleton>
27
- </View>
28
- </View>
27
+ </Box>
28
+ </Box>
29
29
  );
30
30
  }
31
31
 
@@ -33,24 +33,24 @@ export function ListLoadingHorizontalItemComponent(props: Props) {
33
33
  const { isLoading, style } = props;
34
34
 
35
35
  return (
36
- <View style={[style]}>
37
- <View style={[tw`flex-row gap-2`, style]}>
36
+ <Box style={[style]}>
37
+ <Box style={[tw`flex-row gap-2`, style]}>
38
38
  <Skeleton isLoading={isLoading}>
39
- {isLoading && <View style={tw`h-[200px] w-[100px]`} />}
39
+ {isLoading && <Box style={tw`h-[200px] w-[100px]`} />}
40
40
  </Skeleton>
41
41
  <Skeleton isLoading={isLoading}>
42
- {isLoading && <View style={tw`h-[200px] w-[100px]`} />}
42
+ {isLoading && <Box style={tw`h-[200px] w-[100px]`} />}
43
43
  </Skeleton>
44
44
  <Skeleton isLoading={isLoading}>
45
- {isLoading && <View style={tw`h-[200px] w-[100px]`} />}
45
+ {isLoading && <Box style={tw`h-[200px] w-[100px]`} />}
46
46
  </Skeleton>
47
47
  <Skeleton isLoading={isLoading}>
48
- {isLoading && <View style={tw`h-[200px] w-[100px]`} />}
48
+ {isLoading && <Box style={tw`h-[200px] w-[100px]`} />}
49
49
  </Skeleton>
50
50
  <Skeleton isLoading={isLoading}>
51
- {isLoading && <View style={tw`h-[200px] w-[100px]`} />}
51
+ {isLoading && <Box style={tw`h-[200px] w-[100px]`} />}
52
52
  </Skeleton>
53
- </View>
54
- </View>
53
+ </Box>
54
+ </Box>
55
55
  );
56
56
  }
@@ -1,15 +1,16 @@
1
1
  /* eslint-disable no-magic-numbers */
2
2
  import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
3
- import React, { ReactNode, useCallback, useState } from 'react';
4
- import { Keyboard, ModalBaseProps, StyleProp, View, ViewStyle } from 'react-native';
3
+ import React, { useCallback, useState } from 'react';
4
+ import { Keyboard, ModalBaseProps, StyleProp, ViewStyle } from 'react-native';
5
5
  import RNModal from 'react-native-modal';
6
6
 
7
7
  import { tw } from '../../../tailwind';
8
8
  import { DefaultComponentProps } from '../../../types';
9
+ import { Box } from '../Box';
9
10
 
10
11
  export type ModalProps = DefaultComponentProps &
11
12
  ModalBaseProps & {
12
- children?: ReactNode;
13
+ children?: React.ReactNode;
13
14
  containerStyle?: StyleProp<ViewStyle>;
14
15
  isVisible: boolean;
15
16
  onBackdropPress?: () => void;
@@ -31,7 +32,7 @@ export function Modal(props: ModalProps) {
31
32
  onBackdropPress={onBackdropPress}
32
33
  >
33
34
  <BottomSheetModalProvider>
34
- <View style={[tw`px-4`, containerStyle]}>{children}</View>
35
+ <Box style={[tw`px-4`, containerStyle]}>{children}</Box>
35
36
  </BottomSheetModalProvider>
36
37
  </RNModal>
37
38
  );
@@ -1,17 +1,18 @@
1
1
  import React from 'react';
2
- import { ActivityIndicator, View } from 'react-native';
2
+ import { ActivityIndicator } from 'react-native';
3
3
 
4
4
  import { colors, tw } from '../../../tailwind';
5
5
  import { DefaultComponentProps } from '../../../types/component.type';
6
+ import { Box } from '../Box';
6
7
 
7
8
  type Props = DefaultComponentProps;
8
9
 
9
- export function ScreenLoader(props: Props): JSX.Element {
10
+ export function ScreenLoader(props: Props) {
10
11
  const { style } = props;
11
12
 
12
13
  return (
13
- <View style={[tw`h-full w-full items-center justify-center bg-gray-50 p-8`, style]}>
14
+ <Box style={[tw`h-full w-full items-center justify-center bg-gray-50 p-8`, style]}>
14
15
  <ActivityIndicator color={colors.primary[400]} />
15
- </View>
16
+ </Box>
16
17
  );
17
18
  }
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { View } from 'react-native';
3
2
  import Animated, {
4
3
  useAnimatedStyle,
5
4
  useSharedValue,
@@ -8,6 +7,7 @@ import Animated, {
8
7
  } from 'react-native-reanimated';
9
8
 
10
9
  import { tw } from '../../../tailwind';
10
+ import { Box } from '../Box';
11
11
 
12
12
  interface Props {
13
13
  children: React.ReactNode;
@@ -36,7 +36,7 @@ export function Skeleton(props: Props) {
36
36
 
37
37
  return (
38
38
  <Animated.View style={[tw`rounded-lg bg-gray-200`, animatedStyle]}>
39
- <View style={tw`opacity-0`}>{children}</View>
39
+ <Box style={tw`opacity-0`}>{children}</Box>
40
40
  </Animated.View>
41
41
  );
42
42
  }
@@ -4,7 +4,6 @@ import {
4
4
  TextInputProps as RNTextInputProps,
5
5
  StyleProp,
6
6
  TextStyle,
7
- View,
8
7
  } from 'react-native';
9
8
 
10
9
  import {
@@ -14,7 +13,8 @@ import {
14
13
  disabledInputStyle,
15
14
  focusedInputStyle,
16
15
  } from '../../../tailwind';
17
- import { DefaultInputComponentProps } from '../../../types';
16
+ import { DefaultComponentProps } from '../../../types';
17
+ import { Box } from '../Box';
18
18
 
19
19
  import { DefaultNameInputProps, DefaultTextAreaInputProps } from './constants';
20
20
 
@@ -29,7 +29,7 @@ export function getTextInputHeightAdjustment(numberOfNewLines: number) {
29
29
  return TEXT_INPUT_MIN_HEIGHT + (numberOfNewLines - 2) * TEXT_INPUT_LINE_HEIGHT;
30
30
  }
31
31
 
32
- export type TextInputProps = DefaultInputComponentProps<string> &
32
+ export type TextInputProps = DefaultComponentProps &
33
33
  RNTextInputProps & {
34
34
  textInputRef?: React.RefObject<RNTextInput>;
35
35
  textStyle?: StyleProp<TextStyle>;
@@ -62,7 +62,7 @@ export function TextInput(props: TextInputProps) {
62
62
  }
63
63
 
64
64
  return (
65
- <View
65
+ <Box
66
66
  style={[
67
67
  defaultInputContainerStyle,
68
68
  focusedInputStyle(isFocused),
@@ -85,7 +85,7 @@ export function TextInput(props: TextInputProps) {
85
85
  onFocus={handleOnFocus}
86
86
  {...extraProps}
87
87
  />
88
- </View>
88
+ </Box>
89
89
  );
90
90
  }
91
91
 
@@ -0,0 +1 @@
1
+ export * from './typography.component';
@@ -7,7 +7,7 @@ type Props = TextProps & {
7
7
  numberOfLines?: number;
8
8
  };
9
9
 
10
- export function Text(props: Props): JSX.Element {
10
+ export function Typography(props: Props): JSX.Element {
11
11
  const { numberOfLines = 0, style, ...extraProps } = props;
12
12
 
13
13
  const shouldTruncateTextProps: TextProps =
@@ -1,4 +1,5 @@
1
1
  export * from './BottomSheet';
2
+ export * from './Box';
2
3
  export * from './Button';
3
4
  export * from './Divider';
4
5
  export * from './InputLayout';
@@ -6,5 +7,5 @@ export * from './ListLoadingItem';
6
7
  export * from './Modal';
7
8
  export * from './ScreenLoader';
8
9
  export * from './Skeleton';
9
- export * from './Text';
10
10
  export * from './TextInput';
11
+ export * from './Typography';
@@ -6,7 +6,6 @@ import {
6
6
  PressableProps,
7
7
  StyleProp,
8
8
  TouchableOpacity,
9
- View,
10
9
  ViewStyle,
11
10
  } from 'react-native';
12
11
 
@@ -15,6 +14,7 @@ import { ArrowLeftIcon } from '../../../icons';
15
14
  import { Screens } from '../../../routes';
16
15
  import { tw } from '../../../tailwind';
17
16
  import { DefaultComponentProps } from '../../../types/component.type';
17
+ import { Box } from '../../atoms';
18
18
 
19
19
  type Props = DefaultComponentProps &
20
20
  PressableProps & {
@@ -24,7 +24,7 @@ type Props = DefaultComponentProps &
24
24
  };
25
25
 
26
26
  const ACTIVE_OPACITY = 0.5;
27
- export function BackButton(props: Props): JSX.Element {
27
+ export function BackButton(props: Props) {
28
28
  const { fallbackRoute, onPress, style } = props;
29
29
  const navigation = useNavigation<ParamListBase>();
30
30
 
@@ -50,9 +50,9 @@ export function BackButton(props: Props): JSX.Element {
50
50
  style={[tw`h-[48px] w-[48px]`, style]}
51
51
  onPress={handleOnPress}
52
52
  >
53
- <View style={[tw`flex-1 items-center justify-center rounded-full`, style]}>
53
+ <Box style={[tw`flex-1 items-center justify-center rounded-full`, style]}>
54
54
  <ArrowLeftIcon style={tw`text-gray-950`} />
55
- </View>
55
+ </Box>
56
56
  </TouchableOpacity>
57
57
  );
58
58
  }
@@ -16,10 +16,7 @@ export function BottomActionsContainer(props: Props) {
16
16
  return (
17
17
  <SafeAreaView
18
18
  edges={['left', 'right', 'bottom']}
19
- style={[
20
- tw`border-geyser-200 absolute bottom-0 left-0 right-0 flex flex-col gap-y-2 border-b-0 border-t bg-gray-50 p-4`,
21
- style,
22
- ]}
19
+ style={[tw`absolute bottom-0 left-0 right-0`, style]}
23
20
  {...rest}
24
21
  >
25
22
  {children}
@@ -6,7 +6,6 @@ import {
6
6
  Platform,
7
7
  StatusBar,
8
8
  StyleProp,
9
- View,
10
9
  ViewStyle,
11
10
  } from 'react-native';
12
11
  import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
@@ -15,8 +14,10 @@ import { Edge, SafeAreaProviderProps, SafeAreaView } from 'react-native-safe-are
15
14
 
16
15
  import CONFIG from '../../../config';
17
16
  import { tw } from '../../../tailwind';
17
+ import { Box } from '../../atoms';
18
18
 
19
19
  type Props = SafeAreaProviderProps & {
20
+ scrollViewRef?: React.RefObject<KeyboardAwareScrollView>;
20
21
  containerStyle?: StyleProp<ViewStyle>;
21
22
  excludedEdges?: Edge[];
22
23
  extraBottomPadding?: number;
@@ -28,21 +29,20 @@ type Props = SafeAreaProviderProps & {
28
29
  onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
29
30
  };
30
31
 
31
- const defaultStyle = tw.style('grow', {
32
- paddingTop: StatusBar.currentHeight ? StatusBar.currentHeight - 1 : 0,
33
- });
32
+ const defaultStyle = tw`grow`;
34
33
 
35
34
  const safeAreaViewEdges: Edge[] = Platform.select({
36
- android: ['left', 'right', 'bottom'],
35
+ android: ['top', 'left', 'right', 'bottom'],
37
36
  default: [],
38
- ios: ['left', 'right', 'bottom', 'top'],
37
+ ios: ['top', 'left', 'right', 'bottom'],
39
38
  });
40
39
 
41
40
  const AnimatedKeyboardAwareScrollView = Animated.createAnimatedComponent(KeyboardAwareScrollView);
42
41
 
43
- export function ScreenContainer(props: Props): JSX.Element {
42
+ export function ScreenContainer(props: Props) {
44
43
  const {
45
44
  children,
45
+ scrollViewRef,
46
46
  containerStyle,
47
47
  excludedEdges = [],
48
48
  extraBottomPadding = 0,
@@ -81,10 +81,12 @@ export function ScreenContainer(props: Props): JSX.Element {
81
81
  ];
82
82
 
83
83
  return (
84
- <SafeAreaView edges={edges} style={[tw`flex-1 bg-gray-50`, style]}>
84
+ <SafeAreaView edges={edges} style={[tw`flex-1 bg-gray-50 dark:bg-gray-900`, style]}>
85
85
  {hasScroll ? (
86
86
  <AnimatedKeyboardAwareScrollView
87
+ scrollViewRef={scrollViewRef}
87
88
  contentContainerStyle={defaultContainerStyle}
89
+ enableResetScrollToCoords={false}
88
90
  keyboardShouldPersistTaps="handled"
89
91
  refreshControl={refreshControl}
90
92
  scrollEventThrottle={16}
@@ -93,7 +95,7 @@ export function ScreenContainer(props: Props): JSX.Element {
93
95
  {children}
94
96
  </AnimatedKeyboardAwareScrollView>
95
97
  ) : (
96
- <View style={defaultContainerStyle}>{children}</View>
98
+ <Box style={defaultContainerStyle}>{children}</Box>
97
99
  )}
98
100
  </SafeAreaView>
99
101
  );
@@ -1,16 +1,16 @@
1
- import React, { ReactNode } from 'react';
2
- import { StyleProp, TouchableOpacity, View, ViewStyle } from 'react-native';
1
+ import React from 'react';
2
+ import { StyleProp, TouchableOpacity, ViewStyle } from 'react-native';
3
3
 
4
4
  import { GearIcon } from '../../../icons';
5
5
  import { tw } from '../../../tailwind';
6
6
  import { DefaultComponentProps } from '../../../types/component.type';
7
- import { Text } from '../../atoms/Text';
7
+ import { Box } from '../../atoms';
8
+ import { Typography } from '../../atoms/Typography';
8
9
  import { BackButton } from '../BackButton';
9
10
 
10
11
  type Props = DefaultComponentProps & {
11
12
  hasBackButton?: boolean;
12
- extraActionComponent?: ReactNode;
13
- shouldShowBorder?: boolean;
13
+ extraActionComponent?: React.ReactNode;
14
14
  title: string;
15
15
  titleStyle?: StyleProp<ViewStyle>;
16
16
  onBackPress?: () => void;
@@ -24,7 +24,6 @@ export function ScreenHeader(props: Props) {
24
24
  hasBackButton = true,
25
25
  onBackPress,
26
26
  onExtraActionPress,
27
- shouldShowBorder = false,
28
27
  style,
29
28
  title,
30
29
  titleStyle,
@@ -37,35 +36,30 @@ export function ScreenHeader(props: Props) {
37
36
  style={tw`z-10 h-[48px] w-[48px]`}
38
37
  onPress={onExtraActionPress}
39
38
  >
40
- <View style={[tw`flex-1 items-center justify-center rounded-full`, style]}>
39
+ <Box style={[tw`flex-1 items-center justify-center rounded-full`, style]}>
41
40
  {extraActionComponent ? (
42
41
  extraActionComponent
43
42
  ) : (
44
43
  <GearIcon height={25} style={tw`text-black-950`} width={25} />
45
44
  )}
46
- </View>
45
+ </Box>
47
46
  </TouchableOpacity>
48
47
  );
49
48
 
50
49
  return (
51
- <View style={[tw`h-[64px] border border-transparent bg-gray-50`, style]}>
52
- <View
53
- style={[
54
- tw`flex-row items-center justify-between border border-transparent p-4 pt-2`,
55
- shouldShowBorder && tw`elevation-2 -m-[5px]`,
56
- ]}
57
- >
50
+ <Box style={[tw`h-[64px] border border-transparent`, style]}>
51
+ <Box style={[tw`flex-row items-center justify-between border border-transparent p-4 pt-2`]}>
58
52
  {hasBackButton && <BackButton style={tw`z-10`} onPress={onBackPress} />}
59
- <Text
53
+ <Typography
60
54
  style={[
61
55
  tw`text-primary-700 absolute inset-x-0 top-4 text-center text-xl font-medium`,
62
56
  titleStyle,
63
57
  ]}
64
58
  >
65
59
  {title}
66
- </Text>
60
+ </Typography>
67
61
  {extraActionComponentDisplay}
68
- </View>
69
- </View>
62
+ </Box>
63
+ </Box>
70
64
  );
71
65
  }
@@ -1,9 +1,7 @@
1
- import { ReactNode } from 'react';
2
-
3
1
  import { useLocalStorageState } from '../../../stores';
4
2
 
5
3
  type Props = {
6
- children: ReactNode;
4
+ children: JSX.Element;
7
5
  };
8
6
 
9
7
  export function StorageManager(props: Props) {
@@ -1,5 +1,5 @@
1
- export * from './useAppState.hook';
2
1
  export * from './useApplicationDimensions.hook';
2
+ export * from './useAppState.hook';
3
3
  export * from './useDebounce.hook';
4
4
  export * from './useGetLayoutHeight.hook';
5
5
  export * from './useGetLayoutWidth.hook';
@@ -7,3 +7,4 @@ export * from './useNavigation.hook';
7
7
  export * from './useShakeAnimation.hook';
8
8
  export * from './useTextInputChangeFocus.hook';
9
9
  export * from './useThrottle.hook';
10
+ export * from './useToggleDarkMode.hook';
@@ -0,0 +1,9 @@
1
+ import { useAppColorScheme } from 'twrnc';
2
+
3
+ import { tw } from '../tailwind';
4
+
5
+ export function useToggleDarkMode() {
6
+ const [, toggleColorScheme] = useAppColorScheme(tw);
7
+
8
+ return toggleColorScheme;
9
+ }
@@ -1,5 +1,5 @@
1
1
  import { DefaultTheme, NavigationContainer, Theme } from '@react-navigation/native';
2
- import { createStackNavigator } from '@react-navigation/stack';
2
+ import { createNativeStackNavigator } from '@react-navigation/native-stack';
3
3
  import React, { useEffect } from 'react';
4
4
  import { StatusBar } from 'react-native';
5
5
 
@@ -11,7 +11,7 @@ import PublicRoutes from './publicRoutes';
11
11
  import { Routes } from './routes.enum';
12
12
  import { screenOptions } from './screen-options';
13
13
 
14
- const RootStack = createStackNavigator();
14
+ const RootStack = createNativeStackNavigator();
15
15
 
16
16
  export const noAnimation = {
17
17
  animationEnabled: false,
@@ -25,7 +25,7 @@ const navigationTheme: Theme = {
25
25
  },
26
26
  };
27
27
 
28
- export default function ApplicationRoutes(): JSX.Element {
28
+ export default function ApplicationRoutes() {
29
29
  // const { isLoading } = useAuth();
30
30
  // const isUserAuthenticated = useLocalStorageState((state) => !!state.accessToken);
31
31
  const isUserAuthenticated = false;
@@ -1,5 +1,6 @@
1
+ import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
1
2
  import { MaterialTopTabScreenProps } from '@react-navigation/material-top-tabs';
2
- import { createStackNavigator, StackScreenProps } from '@react-navigation/stack';
3
+ import { createNativeStackNavigator, NativeStackScreenProps } from '@react-navigation/native-stack';
3
4
  import React from 'react';
4
5
 
5
6
  import { HomeScreen } from '../screens/HomeScreen/home.screen';
@@ -7,13 +8,13 @@ import { HomeScreen } from '../screens/HomeScreen/home.screen';
7
8
  import { screenOptions } from './screen-options';
8
9
  import { Screens } from './screens.enum';
9
10
 
10
- const PrivateStack = createStackNavigator<PrivateStackParams>();
11
+ const PrivateStack = createNativeStackNavigator<PrivateStackParams>();
11
12
 
12
13
  export type PrivateStackParams = {
13
14
  [Screens.HOME]: undefined;
14
15
  };
15
16
 
16
- export type PrivateScreenProps<T extends keyof PrivateStackParams> = StackScreenProps<
17
+ export type PrivateScreenProps<T extends keyof PrivateStackParams> = NativeStackScreenProps<
17
18
  PrivateStackParams,
18
19
  T
19
20
  >;
@@ -23,10 +24,12 @@ export type PrivateTabScreenProps<T extends keyof PrivateStackParams> = Material
23
24
  T
24
25
  >;
25
26
 
26
- export default function PrivateRoutes(): JSX.Element {
27
+ export default function PrivateRoutes() {
27
28
  return (
28
- <PrivateStack.Navigator initialRouteName={Screens.HOME} screenOptions={screenOptions}>
29
- <PrivateStack.Screen component={HomeScreen} name={Screens.HOME} />
30
- </PrivateStack.Navigator>
29
+ <BottomSheetModalProvider>
30
+ <PrivateStack.Navigator initialRouteName={Screens.HOME} screenOptions={screenOptions}>
31
+ <PrivateStack.Screen component={HomeScreen} name={Screens.HOME} />
32
+ </PrivateStack.Navigator>
33
+ </BottomSheetModalProvider>
31
34
  );
32
35
  }
@@ -1,26 +1,29 @@
1
- import { createStackNavigator, StackScreenProps } from '@react-navigation/stack';
1
+ import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
2
+ import { createNativeStackNavigator, NativeStackScreenProps } from '@react-navigation/native-stack';
2
3
  import React from 'react';
3
4
 
4
- import { LoginScreen } from '../screens/LoginScreen/login.screen';
5
+ import { LandingScreen } from '../screens/LandingScreen/landing.screen';
5
6
 
6
7
  import { screenOptions } from './screen-options';
7
8
  import { Screens } from './screens.enum';
8
9
 
9
- const PublicStack = createStackNavigator<PublicStackParams>();
10
+ const PublicStack = createNativeStackNavigator<PublicStackParams>();
10
11
 
11
12
  export type PublicStackParams = {
12
- [Screens.LOGIN]: undefined;
13
+ [Screens.LANDING]: undefined;
13
14
  };
14
15
 
15
- export type PublicScreenProps<T extends keyof PublicStackParams> = StackScreenProps<
16
+ export type PublicScreenProps<T extends keyof PublicStackParams> = NativeStackScreenProps<
16
17
  PublicStackParams,
17
18
  T
18
19
  >;
19
20
 
20
- export default function PublicRoutes(): JSX.Element {
21
+ export default function PublicRoutes() {
21
22
  return (
22
- <PublicStack.Navigator initialRouteName={Screens.LOGIN} screenOptions={screenOptions}>
23
- <PublicStack.Screen component={LoginScreen} name={Screens.LOGIN} />
24
- </PublicStack.Navigator>
23
+ <BottomSheetModalProvider>
24
+ <PublicStack.Navigator initialRouteName={Screens.LANDING} screenOptions={screenOptions}>
25
+ <PublicStack.Screen component={LandingScreen} name={Screens.LANDING} />
26
+ </PublicStack.Navigator>
27
+ </BottomSheetModalProvider>
25
28
  );
26
29
  }
@@ -1,9 +1,4 @@
1
- import CONFIG from '../config';
2
-
3
- const areGesturesEnabled = CONFIG.IS_IOS;
4
-
5
1
  export const screenOptions = {
6
- gestureEnabled: areGesturesEnabled,
7
- gestureResponseDistance: 350,
2
+ gestureEnabled: true,
8
3
  headerShown: false,
9
4
  };
@@ -1,4 +1,4 @@
1
1
  export enum Screens {
2
2
  HOME = '/home',
3
- LOGIN = '/login',
3
+ LANDING = '/landing',
4
4
  }
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
2
 
3
- import { ScreenContainer, Text } from '../../components';
3
+ import { ScreenContainer, Typography } from '../../components';
4
4
  import { PrivateScreenProps, Screens } from '../../routes';
5
5
 
6
6
  export function HomeScreen(props: PrivateScreenProps<Screens.HOME>) {
7
7
  return (
8
8
  <ScreenContainer>
9
- <Text>Home</Text>
9
+ <Typography>Home</Typography>
10
10
  </ScreenContainer>
11
11
  );
12
12
  }
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+
3
+ import {
4
+ BottomSheet,
5
+ Box,
6
+ Button,
7
+ OutlinedButton,
8
+ ScreenContainer,
9
+ ScreenHeader,
10
+ Typography,
11
+ useBottomSheet,
12
+ } from '../../components';
13
+ import { useToggleDarkMode } from '../../hooks';
14
+ import { PublicScreenProps, Screens } from '../../routes';
15
+ import { tw } from '../../tailwind';
16
+
17
+ export function LandingScreen(props: PublicScreenProps<Screens.LANDING>) {
18
+ const toggleDarkMode = useToggleDarkMode();
19
+ const { expandSheet, sheetRef } = useBottomSheet();
20
+
21
+ return (
22
+ <ScreenContainer>
23
+ <ScreenHeader title="Landing" onExtraActionPress={toggleDarkMode} />
24
+ <Box style={tw`mx-4`}>
25
+ <Box row style={tw`gap-2`}>
26
+ <Button title="Show Bottom Sheet" onPress={expandSheet} />
27
+ <OutlinedButton title="Login" />
28
+ </Box>
29
+ </Box>
30
+ <BottomSheet sheetRef={sheetRef}>
31
+ <Box>
32
+ <Typography>Bottom Sheet</Typography>
33
+ </Box>
34
+ </BottomSheet>
35
+ </ScreenContainer>
36
+ );
37
+ }
@@ -1,13 +1,8 @@
1
- import { Atom, SetStateAction, WritableAtom } from 'jotai';
2
1
  import { StyleProp, ViewStyle } from 'react-native';
3
2
 
4
3
  export type DefaultComponentProps = {
5
4
  error?: string;
6
5
  isDisabled?: boolean;
7
- style?: StyleProp<ViewStyle>;
8
- };
9
-
10
- export type DefaultInputComponentProps<T> = DefaultComponentProps & {
11
- atom?: WritableAtom<T, [SetStateAction<T>], void> | Atom<T>;
12
6
  isLoading?: boolean;
7
+ style?: StyleProp<ViewStyle>;
13
8
  };
@@ -0,0 +1,10 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import axios, { HttpStatusCode } from 'axios';
3
+
4
+ export function isNetworkError(error: any) {
5
+ return axios.isAxiosError(error) && !error.response;
6
+ }
7
+
8
+ export function isUnauthorizedError(error: any) {
9
+ return axios.isAxiosError(error) && error.response?.status === HttpStatusCode.Unauthorized;
10
+ }
@@ -0,0 +1,4 @@
1
+ export * from './axios.util';
2
+ export * from './log.util';
3
+ export * from './route.util';
4
+