nx-react-native-cli 1.0.20 → 2.0.0

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 (65) hide show
  1. package/README.md +69 -21
  2. package/lib/index.cjs +49 -39
  3. package/package.json +3 -3
  4. package/templates/.husky/pre-commit +0 -3
  5. package/templates/.husky/pre-push +0 -3
  6. package/templates/.vscode/settings.json +2 -5
  7. package/templates/apps/mobile/.eslintrc.json +4 -1
  8. package/templates/apps/mobile/Gemfile +5 -2
  9. package/templates/apps/mobile/android/app/build.gradle +5 -4
  10. package/templates/apps/mobile/android/app/src/main/java/com/appsmobile/MainActivity.kt +28 -0
  11. package/templates/apps/mobile/android/app/src/main/java/com/appsmobile/MainApplication.kt +44 -0
  12. package/templates/apps/mobile/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  13. package/templates/apps/mobile/android/build.gradle +6 -6
  14. package/templates/apps/mobile/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  15. package/templates/apps/mobile/android/gradle.properties +44 -0
  16. package/templates/apps/mobile/android/gradlew +251 -0
  17. package/templates/apps/mobile/android/gradlew.bat +94 -0
  18. package/templates/apps/mobile/android/settings.gradle +6 -0
  19. package/templates/apps/mobile/babel.config.json +23 -0
  20. package/templates/apps/mobile/fastlane/.env.template +7 -2
  21. package/templates/apps/mobile/fastlane/Fastfile +46 -5
  22. package/templates/apps/mobile/fastlane/Matchfile +3 -3
  23. package/templates/apps/mobile/ios/AppDelegate.mm +33 -0
  24. package/templates/apps/mobile/metro.config.js +42 -0
  25. package/templates/apps/mobile/package.json +2 -3
  26. package/templates/apps/mobile/project.json +2 -1
  27. package/templates/apps/mobile/src/app/index.tsx +22 -7
  28. package/templates/apps/mobile/src/components/atoms/BottomSheet/bottom-sheet.component.tsx +9 -4
  29. package/templates/apps/mobile/src/components/atoms/Button/button.component.tsx +6 -6
  30. package/templates/apps/mobile/src/components/atoms/Divider/divider-component.tsx +4 -4
  31. package/templates/apps/mobile/src/components/atoms/ExcludedEdges/excluded-edges.component.tsx +37 -0
  32. package/templates/apps/mobile/src/components/atoms/ExcludedEdges/index.ts +1 -0
  33. package/templates/apps/mobile/src/components/atoms/InputLayout/input-layout.component.tsx +8 -9
  34. package/templates/apps/mobile/src/components/atoms/KeyboardAwareScrollView/index.ts +1 -0
  35. package/templates/apps/mobile/src/components/atoms/KeyboardAwareScrollView/keyboard-aware-scroll-view.component.tsx +60 -0
  36. package/templates/apps/mobile/src/components/atoms/ListLoadingItem/list-loading-item.component.tsx +20 -20
  37. package/templates/apps/mobile/src/components/atoms/Modal/modal.component.tsx +4 -5
  38. package/templates/apps/mobile/src/components/atoms/ScreenLoader/screen-loader.component.tsx +5 -6
  39. package/templates/apps/mobile/src/components/atoms/Skeleton/skeleton.component.tsx +9 -8
  40. package/templates/apps/mobile/src/components/atoms/TextInput/text-input.component.tsx +9 -7
  41. package/templates/apps/mobile/src/components/atoms/Typography/typography.component.tsx +2 -2
  42. package/templates/apps/mobile/src/components/atoms/index.ts +2 -1
  43. package/templates/apps/mobile/src/components/molecules/BackButton/back-button.component.tsx +8 -8
  44. package/templates/apps/mobile/src/components/molecules/BottomActionsContainer/BottomActionsContainer.component.tsx +2 -2
  45. package/templates/apps/mobile/src/components/molecules/ScreenContainer/screen-container.component.tsx +19 -25
  46. package/templates/apps/mobile/src/components/molecules/ScreenHeader/screen-header.component.tsx +12 -13
  47. package/templates/apps/mobile/src/components/molecules/StorageManager/StorageManager.component.tsx +3 -1
  48. package/templates/apps/mobile/src/hooks/useGetLayoutHeight.hook.tsx +1 -1
  49. package/templates/apps/mobile/src/hooks/useGetLayoutWidth.hook.tsx +1 -1
  50. package/templates/apps/mobile/src/hooks/useNavigation.hook.tsx +1 -1
  51. package/templates/apps/mobile/src/hooks/useTextInputChangeFocus.hook.tsx +2 -2
  52. package/templates/apps/mobile/src/hooks/useToggleDarkMode.hook.tsx +1 -1
  53. package/templates/apps/mobile/src/main.tsx +1 -1
  54. package/templates/apps/mobile/src/routes/index.tsx +7 -7
  55. package/templates/apps/mobile/src/routes/privateRoutes.tsx +3 -4
  56. package/templates/apps/mobile/src/routes/publicRoutes.tsx +3 -4
  57. package/templates/apps/mobile/src/screens/HomeScreen/home.screen.tsx +3 -2
  58. package/templates/apps/mobile/src/screens/LandingScreen/landing.screen.tsx +21 -13
  59. package/templates/apps/mobile/src/stores/local-storage.store.ts +1 -1
  60. package/templates/apps/mobile/src/stores/mmkvStorage.ts +1 -1
  61. package/templates/apps/mobile/tsconfig.app.json +5 -1
  62. package/templates/clean-generated-outputs.sh +1 -1
  63. package/templates/apps/mobile/.env +0 -3
  64. package/templates/apps/mobile/src/components/atoms/Box/box.component.tsx +0 -21
  65. package/templates/apps/mobile/src/components/atoms/Box/index.ts +0 -1
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { View } from 'react-native';
2
3
  import Animated, {
3
4
  useAnimatedStyle,
4
5
  useSharedValue,
@@ -6,16 +7,16 @@ import Animated, {
6
7
  withTiming,
7
8
  } from 'react-native-reanimated';
8
9
 
9
- import { tw } from '../../../tailwind';
10
- import { Box } from '../Box';
10
+ import { tw } from '@/tailwind';
11
+ import { DefaultComponentProps } from '@/types';
11
12
 
12
- interface Props {
13
- children: React.ReactNode;
13
+ type Props = DefaultComponentProps & {
14
+ children?: React.ReactNode;
14
15
  isLoading: boolean;
15
- }
16
+ };
16
17
 
17
18
  export function Skeleton(props: Props) {
18
- const { children, isLoading } = props;
19
+ const { children, isLoading, style } = props;
19
20
  const opacity = useSharedValue(1);
20
21
 
21
22
  const animatedStyle = useAnimatedStyle(
@@ -35,8 +36,8 @@ export function Skeleton(props: Props) {
35
36
  }
36
37
 
37
38
  return (
38
- <Animated.View style={[tw`rounded-lg bg-gray-200`, animatedStyle]}>
39
- <Box style={tw`opacity-0`}>{children}</Box>
39
+ <Animated.View style={[tw`rounded-lg bg-gray-200`, animatedStyle, style]}>
40
+ <View style={tw`opacity-0`}>{children}</View>
40
41
  </Animated.View>
41
42
  );
42
43
  }
@@ -4,19 +4,21 @@ import {
4
4
  TextInputProps as RNTextInputProps,
5
5
  StyleProp,
6
6
  TextStyle,
7
+ View,
7
8
  } from 'react-native';
8
9
 
10
+ import {
11
+ DefaultNameInputProps,
12
+ DefaultTextAreaInputProps,
13
+ } from '@/components/atoms/TextInput/constants';
9
14
  import {
10
15
  colors,
11
16
  defaultInputContainerStyle,
12
17
  defaultInputTextStyle,
13
18
  disabledInputStyle,
14
19
  focusedInputStyle,
15
- } from '../../../tailwind';
16
- import { DefaultComponentProps } from '../../../types';
17
- import { Box } from '../Box';
18
-
19
- import { DefaultNameInputProps, DefaultTextAreaInputProps } from './constants';
20
+ } from '@/tailwind';
21
+ import { DefaultComponentProps } from '@/types';
20
22
 
21
23
  export const TEXT_INPUT_MIN_HEIGHT = 100;
22
24
  export const TEXT_INPUT_LINE_HEIGHT = 21;
@@ -62,7 +64,7 @@ export function TextInput(props: TextInputProps) {
62
64
  }
63
65
 
64
66
  return (
65
- <Box
67
+ <View
66
68
  style={[
67
69
  defaultInputContainerStyle,
68
70
  focusedInputStyle(isFocused),
@@ -85,7 +87,7 @@ export function TextInput(props: TextInputProps) {
85
87
  onFocus={handleOnFocus}
86
88
  {...extraProps}
87
89
  />
88
- </Box>
90
+ </View>
89
91
  );
90
92
  }
91
93
 
@@ -1,7 +1,7 @@
1
- import React from 'react';
1
+ import React, { JSX } from 'react';
2
2
  import { Text as RNText, TextProps } from 'react-native';
3
3
 
4
- import { tw } from '../../../tailwind';
4
+ import { tw } from '@/tailwind';
5
5
 
6
6
  type Props = TextProps & {
7
7
  numberOfLines?: number;
@@ -1,8 +1,9 @@
1
1
  export * from './BottomSheet';
2
- export * from './Box';
3
2
  export * from './Button';
4
3
  export * from './Divider';
4
+ export * from './ExcludedEdges';
5
5
  export * from './InputLayout';
6
+ export * from './KeyboardAwareScrollView';
6
7
  export * from './ListLoadingItem';
7
8
  export * from './Modal';
8
9
  export * from './ScreenLoader';
@@ -6,15 +6,15 @@ import {
6
6
  PressableProps,
7
7
  StyleProp,
8
8
  TouchableOpacity,
9
+ View,
9
10
  ViewStyle,
10
11
  } from 'react-native';
11
12
 
12
- import { useNavigation } from '../../../hooks';
13
- import { ArrowLeftIcon } from '../../../icons';
14
- import { Screens } from '../../../routes';
15
- import { tw } from '../../../tailwind';
16
- import { DefaultComponentProps } from '../../../types/component.type';
17
- import { Box } from '../../atoms';
13
+ import { useNavigation } from '@/hooks';
14
+ import { ArrowLeftIcon } from '@/icons';
15
+ import { Screens } from '@/routes';
16
+ import { tw } from '@/tailwind';
17
+ import { DefaultComponentProps } from '@/types';
18
18
 
19
19
  type Props = DefaultComponentProps &
20
20
  PressableProps & {
@@ -50,9 +50,9 @@ export function BackButton(props: Props) {
50
50
  style={[tw`h-[48px] w-[48px]`, style]}
51
51
  onPress={handleOnPress}
52
52
  >
53
- <Box style={[tw`flex-1 items-center justify-center rounded-full`, style]}>
53
+ <View style={[tw`flex-1 items-center justify-center rounded-full`, style]}>
54
54
  <ArrowLeftIcon style={tw`text-gray-950`} />
55
- </Box>
55
+ </View>
56
56
  </TouchableOpacity>
57
57
  );
58
58
  }
@@ -2,8 +2,8 @@ import React from 'react';
2
2
  import { ViewProps } from 'react-native';
3
3
  import { SafeAreaView } from 'react-native-safe-area-context';
4
4
 
5
- import { tw } from '../../../tailwind';
6
- import { DefaultComponentProps } from '../../../types';
5
+ import { tw } from '@/tailwind';
6
+ import { DefaultComponentProps } from '@/types';
7
7
 
8
8
  type Props = DefaultComponentProps &
9
9
  ViewProps & {
@@ -1,23 +1,26 @@
1
1
  import { useFocusEffect } from '@react-navigation/core';
2
- import React, { ReactElement, useEffect } from 'react';
2
+ import React, { ReactElement } from 'react';
3
3
  import {
4
4
  NativeScrollEvent,
5
5
  NativeSyntheticEvent,
6
6
  Platform,
7
+ RefreshControlProps,
7
8
  StatusBar,
9
+ StatusBarStyle,
8
10
  StyleProp,
11
+ View,
9
12
  ViewStyle,
10
13
  } from 'react-native';
11
- import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
12
- import Animated from 'react-native-reanimated';
14
+ import { KeyboardAwareScrollView as RNKeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
13
15
  import { Edge, SafeAreaProviderProps, SafeAreaView } from 'react-native-safe-area-context';
14
16
 
15
- import CONFIG from '../../../config';
16
- import { tw } from '../../../tailwind';
17
- import { Box } from '../../atoms';
17
+ import { KeyboardAwareScrollView } from '@/components';
18
+ import CONFIG from '@/config';
19
+ import { tw } from '@/tailwind';
18
20
 
19
21
  type Props = SafeAreaProviderProps & {
20
- scrollViewRef?: React.RefObject<KeyboardAwareScrollView>;
22
+ barStyle?: StatusBarStyle;
23
+ scrollViewRef?: React.RefObject<RNKeyboardAwareScrollView>;
21
24
  containerStyle?: StyleProp<ViewStyle>;
22
25
  excludedEdges?: Edge[];
23
26
  extraBottomPadding?: number;
@@ -37,10 +40,9 @@ const safeAreaViewEdges: Edge[] = Platform.select({
37
40
  ios: ['top', 'left', 'right', 'bottom'],
38
41
  });
39
42
 
40
- const AnimatedKeyboardAwareScrollView = Animated.createAnimatedComponent(KeyboardAwareScrollView);
41
-
42
43
  export function ScreenContainer(props: Props) {
43
44
  const {
45
+ barStyle = 'dark-content',
44
46
  children,
45
47
  containerStyle,
46
48
  excludedEdges = [],
@@ -59,17 +61,12 @@ export function ScreenContainer(props: Props) {
59
61
  ? safeAreaViewEdges.filter((edge) => !excludedEdges.includes(edge))
60
62
  : safeAreaViewEdges;
61
63
 
62
- useEffect(() => {
63
- if (CONFIG.IS_ANDROID) {
64
- StatusBar.setBackgroundColor(statusBarColor);
65
- }
66
- }, [statusBarColor]);
67
-
68
64
  useFocusEffect(() => {
69
65
  StatusBar.setHidden(!shouldShowStatusBar);
70
66
  if (CONFIG.IS_ANDROID) {
71
67
  StatusBar.setBackgroundColor(statusBarColor);
72
68
  StatusBar.setTranslucent(!shouldBeTranslucent);
69
+ StatusBar.setBarStyle(barStyle);
73
70
  }
74
71
  });
75
72
 
@@ -81,21 +78,18 @@ export function ScreenContainer(props: Props) {
81
78
  ];
82
79
 
83
80
  return (
84
- <SafeAreaView edges={edges} style={[tw`flex-1 bg-gray-50 dark:bg-gray-900`, style]}>
81
+ <SafeAreaView edges={edges} style={[tw`flex-1 bg-white`, style]}>
85
82
  {hasScroll ? (
86
- <AnimatedKeyboardAwareScrollView
87
- ref={scrollViewRef}
88
- contentContainerStyle={defaultContainerStyle}
89
- enableResetScrollToCoords={false}
90
- keyboardShouldPersistTaps="handled"
91
- refreshControl={refreshControl}
92
- scrollEventThrottle={16}
83
+ <KeyboardAwareScrollView
84
+ containerStyle={defaultContainerStyle}
85
+ refreshControl={refreshControl as ReactElement<RefreshControlProps>}
86
+ scrollViewRef={scrollViewRef}
93
87
  onScroll={onScroll}
94
88
  >
95
89
  {children}
96
- </AnimatedKeyboardAwareScrollView>
90
+ </KeyboardAwareScrollView>
97
91
  ) : (
98
- <Box style={defaultContainerStyle}>{children}</Box>
92
+ <View style={defaultContainerStyle}>{children}</View>
99
93
  )}
100
94
  </SafeAreaView>
101
95
  );
@@ -1,12 +1,11 @@
1
1
  import React from 'react';
2
- import { StyleProp, TouchableOpacity, ViewStyle } from 'react-native';
2
+ import { StyleProp, TouchableOpacity, View, ViewStyle } from 'react-native';
3
3
 
4
- import { GearIcon } from '../../../icons';
5
- import { tw } from '../../../tailwind';
6
- import { DefaultComponentProps } from '../../../types/component.type';
7
- import { Box } from '../../atoms';
8
- import { Typography } from '../../atoms/Typography';
9
- import { BackButton } from '../BackButton';
4
+ import { Typography } from '@/components';
5
+ import { BackButton } from '@/components/molecules/BackButton';
6
+ import { GearIcon } from '@/icons';
7
+ import { tw } from '@/tailwind';
8
+ import { DefaultComponentProps } from '@/types';
10
9
 
11
10
  type Props = DefaultComponentProps & {
12
11
  hasBackButton?: boolean;
@@ -36,19 +35,19 @@ export function ScreenHeader(props: Props) {
36
35
  style={tw`z-10 h-[48px] w-[48px]`}
37
36
  onPress={onExtraActionPress}
38
37
  >
39
- <Box style={[tw`flex-1 items-center justify-center rounded-full`, style]}>
38
+ <View style={[tw`flex-1 items-center justify-center rounded-full`, style]}>
40
39
  {extraActionComponent ? (
41
40
  extraActionComponent
42
41
  ) : (
43
42
  <GearIcon height={25} style={tw`text-black-950`} width={25} />
44
43
  )}
45
- </Box>
44
+ </View>
46
45
  </TouchableOpacity>
47
46
  );
48
47
 
49
48
  return (
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`]}>
49
+ <View style={[tw`h-[64px] border border-transparent`, style]}>
50
+ <View style={[tw`flex-row items-center justify-between border border-transparent p-4 pt-2`]}>
52
51
  {hasBackButton && <BackButton style={tw`z-10`} onPress={onBackPress} />}
53
52
  <Typography
54
53
  style={[
@@ -59,7 +58,7 @@ export function ScreenHeader(props: Props) {
59
58
  {title}
60
59
  </Typography>
61
60
  {extraActionComponentDisplay}
62
- </Box>
63
- </Box>
61
+ </View>
62
+ </View>
64
63
  );
65
64
  }
@@ -1,4 +1,6 @@
1
- import { useLocalStorageState } from '../../../stores';
1
+ import { JSX } from 'react';
2
+
3
+ import { useLocalStorageState } from '@/stores';
2
4
 
3
5
  type Props = {
4
6
  children: JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { useState } from 'react';
2
2
  import { LayoutChangeEvent } from 'react-native';
3
3
 
4
- import { useDebounce } from './useDebounce.hook';
4
+ import { useDebounce } from '@/hooks/useDebounce.hook';
5
5
 
6
6
  export function useGetLayoutHeight(
7
7
  initialHeight = 0,
@@ -1,7 +1,7 @@
1
1
  import { useState } from 'react';
2
2
  import { LayoutChangeEvent } from 'react-native';
3
3
 
4
- import { useDebounce } from './useDebounce.hook';
4
+ import { useDebounce } from '@/hooks/useDebounce.hook';
5
5
 
6
6
  export function useGetLayoutWidth(
7
7
  initialWidth = 0,
@@ -1,7 +1,7 @@
1
1
  import { ParamListBase, useNavigation as RNUseNavigation } from '@react-navigation/native';
2
2
  import { StackNavigationProp } from '@react-navigation/stack';
3
3
 
4
- import { PrivateStackParams, PublicStackParams } from '../routes';
4
+ import { PrivateStackParams, PublicStackParams } from '@/routes';
5
5
 
6
6
  export function useNavigation<T extends PublicStackParams | PrivateStackParams | ParamListBase>() {
7
7
  return RNUseNavigation<StackNavigationProp<T, keyof T>>();
@@ -1,8 +1,8 @@
1
1
  import React, { useRef } from 'react';
2
2
  import { TextInput } from 'react-native';
3
3
 
4
- export function useTextInputChangeFocus(): [React.MutableRefObject<TextInput>, () => void] {
5
- const ref = useRef() as React.MutableRefObject<TextInput>;
4
+ export function useTextInputChangeFocus(): [React.RefObject<TextInput>, () => void] {
5
+ const ref = useRef<any>(null) as React.RefObject<TextInput>;
6
6
 
7
7
  function changeFocus() {
8
8
  ref?.current?.focus();
@@ -1,6 +1,6 @@
1
1
  import { useAppColorScheme } from 'twrnc';
2
2
 
3
- import { tw } from '../tailwind';
3
+ import { tw } from '@/tailwind';
4
4
 
5
5
  export function useToggleDarkMode() {
6
6
  const [, toggleColorScheme] = useAppColorScheme(tw);
@@ -1,5 +1,5 @@
1
1
  import { AppRegistry } from 'react-native';
2
2
 
3
- import App from './app';
3
+ import App from '@/app';
4
4
 
5
5
  AppRegistry.registerComponent('AppsMobile', () => App);
@@ -3,13 +3,12 @@ import { createNativeStackNavigator } from '@react-navigation/native-stack';
3
3
  import React, { useEffect } from 'react';
4
4
  import { StatusBar } from 'react-native';
5
5
 
6
- import CONFIG from '../config';
7
- import { colors } from '../tailwind';
8
-
9
- import PrivateRoutes from './privateRoutes';
10
- import PublicRoutes from './publicRoutes';
11
- import { Routes } from './routes.enum';
12
- import { screenOptions } from './screen-options';
6
+ import CONFIG from '@/config';
7
+ import { Routes } from '@/routes';
8
+ import PrivateRoutes from '@/routes/privateRoutes';
9
+ import PublicRoutes from '@/routes/publicRoutes';
10
+ import { screenOptions } from '@/routes/screen-options';
11
+ import { colors } from '@/tailwind';
13
12
 
14
13
  const RootStack = createNativeStackNavigator();
15
14
 
@@ -36,6 +35,7 @@ export default function ApplicationRoutes() {
36
35
  if (CONFIG.IS_ANDROID) {
37
36
  StatusBar.setBackgroundColor('transparent');
38
37
  StatusBar.setTranslucent(true);
38
+ StatusBar.setBarStyle('dark-content');
39
39
  }
40
40
  }, []);
41
41
 
@@ -3,10 +3,9 @@ import { MaterialTopTabScreenProps } from '@react-navigation/material-top-tabs';
3
3
  import { createNativeStackNavigator, NativeStackScreenProps } from '@react-navigation/native-stack';
4
4
  import React from 'react';
5
5
 
6
- import { HomeScreen } from '../screens/HomeScreen/home.screen';
7
-
8
- import { screenOptions } from './screen-options';
9
- import { Screens } from './screens.enum';
6
+ import { Screens } from '@/routes';
7
+ import { screenOptions } from '@/routes/screen-options';
8
+ import { HomeScreen } from '@/screens/HomeScreen/home.screen';
10
9
 
11
10
  const PrivateStack = createNativeStackNavigator<PrivateStackParams>();
12
11
 
@@ -2,10 +2,9 @@ import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
2
2
  import { createNativeStackNavigator, NativeStackScreenProps } from '@react-navigation/native-stack';
3
3
  import React from 'react';
4
4
 
5
- import { LandingScreen } from '../screens/LandingScreen/landing.screen';
6
-
7
- import { screenOptions } from './screen-options';
8
- import { Screens } from './screens.enum';
5
+ import { Screens } from '@/routes';
6
+ import { screenOptions } from '@/routes/screen-options';
7
+ import { LandingScreen } from '@/screens/LandingScreen/landing.screen';
9
8
 
10
9
  const PublicStack = createNativeStackNavigator<PublicStackParams>();
11
10
 
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
2
 
3
- import { ScreenContainer, Typography } from '../../components';
4
- import { PrivateScreenProps, Screens } from '../../routes';
3
+ import { ScreenContainer, Typography } from '@/components';
4
+ import { PrivateScreenProps } from '@/routes';
5
+ import { Screens } from '@/routes/screens.enum';
5
6
 
6
7
  export function HomeScreen(props: PrivateScreenProps<Screens.HOME>) {
7
8
  return (
@@ -1,36 +1,44 @@
1
1
  import React from 'react';
2
+ import { View } from 'react-native';
2
3
 
3
4
  import {
4
5
  BottomSheet,
5
- Box,
6
6
  Button,
7
+ Divider,
7
8
  OutlinedButton,
8
9
  ScreenContainer,
9
10
  ScreenHeader,
10
11
  Typography,
11
12
  useBottomSheet,
12
- } from '../../components';
13
- import { useToggleDarkMode } from '../../hooks';
14
- import { PublicScreenProps, Screens } from '../../routes';
15
- import { tw } from '../../tailwind';
13
+ } from '@/components';
14
+ import { ArrowLeftIcon, HomeIcon } from '@/icons';
15
+ import { PublicScreenProps, Screens } from '@/routes';
16
+ import { tw } from '@/tailwind';
17
+ import { toast } from '@/utils';
16
18
 
17
19
  export function LandingScreen(props: PublicScreenProps<Screens.LANDING>) {
18
- const toggleDarkMode = useToggleDarkMode();
19
20
  const { expandSheet, sheetRef } = useBottomSheet();
20
21
 
22
+ function toastHi() {
23
+ toast('Hi!');
24
+ }
25
+
21
26
  return (
22
27
  <ScreenContainer>
23
- <ScreenHeader title="Landing" onExtraActionPress={toggleDarkMode} />
24
- <Box style={tw`mx-4`}>
25
- <Box row style={tw`gap-2`}>
28
+ <ScreenHeader title="Landing" onExtraActionPress={toastHi} />
29
+ <ArrowLeftIcon />
30
+ <Divider />
31
+ <HomeIcon />
32
+ <View style={tw`mx-4`}>
33
+ <View style={tw`gap-2`}>
26
34
  <Button title="Show Bottom Sheet" onPress={expandSheet} />
27
35
  <OutlinedButton title="Login" />
28
- </Box>
29
- </Box>
36
+ </View>
37
+ </View>
30
38
  <BottomSheet sheetRef={sheetRef}>
31
- <Box>
39
+ <View>
32
40
  <Typography>Bottom Sheet</Typography>
33
- </Box>
41
+ </View>
34
42
  </BottomSheet>
35
43
  </ScreenContainer>
36
44
  );
@@ -1,7 +1,7 @@
1
1
  import { StateCreator, create } from 'zustand';
2
2
  import { PersistOptions, createJSONStorage, persist } from 'zustand/middleware';
3
3
 
4
- import { MmkvStorage } from './mmkvStorage';
4
+ import { MmkvStorage } from '@/stores/mmkvStorage';
5
5
 
6
6
  const initialState = {
7
7
  _hasHydrated: false,
@@ -1,7 +1,7 @@
1
1
  import { MMKV } from 'react-native-mmkv';
2
2
  import { StateStorage } from 'zustand/middleware';
3
3
 
4
- import CONFIG from '../config';
4
+ import CONFIG from '@/config';
5
5
 
6
6
  const storage = new MMKV({
7
7
  encryptionKey: CONFIG.STORAGE_KEY,
@@ -3,7 +3,11 @@
3
3
  "compilerOptions": {
4
4
  "outDir": "../../dist/out-tsc",
5
5
  "strict": true,
6
- "types": ["node"]
6
+ "types": ["node"],
7
+ "baseUrl": ".",
8
+ "paths": {
9
+ "@/*": ["src/*"]
10
+ }
7
11
  },
8
12
  "files": ["../../node_modules/@nx/react-native/typings/svg.d.ts"],
9
13
  "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.spec.tsx", "test-setup.ts"],
@@ -27,6 +27,6 @@ rm -rf "$app_rn_ios_build_path"
27
27
  echo "Deleting $app_rn_android_gradle_path..."
28
28
  rm -rf "$app_rn_android_gradle_path"
29
29
 
30
- npm install
30
+ yarn install
31
31
 
32
32
  echo "Done!"
@@ -1,3 +0,0 @@
1
- IS_LIVE=false
2
- STORAGE_KEY=MMKV-STORAGE-KEY
3
- API_BASE_URL=
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import { View, ViewProps } from 'react-native';
3
-
4
- import { tw } from '../../../tailwind';
5
- import { DefaultComponentProps } from '../../../types';
6
-
7
- type Props = DefaultComponentProps &
8
- ViewProps & {
9
- row?: boolean;
10
- };
11
-
12
- export function Box(props: Props) {
13
- const { row, style, ...rest } = props;
14
-
15
- return (
16
- <View
17
- style={[tw`bg-gray-50 dark:bg-gray-900`, row && tw`flex-row items-center`, style]}
18
- {...rest}
19
- />
20
- );
21
- }
@@ -1 +0,0 @@
1
- export * from './box.component';