nx-react-native-cli 1.0.9 → 1.0.10

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 (111) hide show
  1. package/lib/index.cjs +1 -1
  2. package/package.json +1 -1
  3. package/contents/.eslintrc.json +0 -293
  4. package/contents/.husky/pre-commit +0 -5
  5. package/contents/.husky/pre-push +0 -15
  6. package/contents/.nvmrc +0 -1
  7. package/contents/.prettierignore +0 -8
  8. package/contents/.prettierrc +0 -13
  9. package/contents/.ruby-version +0 -1
  10. package/contents/.vscode/extensions.json +0 -10
  11. package/contents/.vscode/settings.json +0 -18
  12. package/contents/apps/mobile/.env.template +0 -3
  13. package/contents/apps/mobile/.eslintrc.json +0 -34
  14. package/contents/apps/mobile/Gemfile +0 -11
  15. package/contents/apps/mobile/android/app/build.gradle +0 -164
  16. package/contents/apps/mobile/android/app/src/dev/res/values/strings.xml +0 -3
  17. package/contents/apps/mobile/android/app/src/production/res/values/strings.xml +0 -3
  18. package/contents/apps/mobile/android/build.gradle +0 -34
  19. package/contents/apps/mobile/babel.config.json +0 -14
  20. package/contents/apps/mobile/fastlane/.env.template +0 -24
  21. package/contents/apps/mobile/fastlane/Fastfile +0 -303
  22. package/contents/apps/mobile/fastlane/Matchfile +0 -5
  23. package/contents/apps/mobile/fastlane/Pluginfile +0 -6
  24. package/contents/apps/mobile/fastlane/README.md +0 -65
  25. package/contents/apps/mobile/package.json +0 -77
  26. package/contents/apps/mobile/project.json +0 -102
  27. package/contents/apps/mobile/src/app/index.tsx +0 -68
  28. package/contents/apps/mobile/src/components/atoms/BottomSheet/bottom-sheet.component.tsx +0 -145
  29. package/contents/apps/mobile/src/components/atoms/BottomSheet/index.ts +0 -1
  30. package/contents/apps/mobile/src/components/atoms/Button/button.component.tsx +0 -55
  31. package/contents/apps/mobile/src/components/atoms/Button/index.ts +0 -2
  32. package/contents/apps/mobile/src/components/atoms/Button/outlined-button.component.tsx +0 -59
  33. package/contents/apps/mobile/src/components/atoms/Divider/divider-component.tsx +0 -13
  34. package/contents/apps/mobile/src/components/atoms/Divider/index.ts +0 -1
  35. package/contents/apps/mobile/src/components/atoms/InputLayout/index.ts +0 -1
  36. package/contents/apps/mobile/src/components/atoms/InputLayout/input-layout.component.tsx +0 -34
  37. package/contents/apps/mobile/src/components/atoms/ListLoadingItem/index.ts +0 -1
  38. package/contents/apps/mobile/src/components/atoms/ListLoadingItem/list-loading-item.component.tsx +0 -56
  39. package/contents/apps/mobile/src/components/atoms/Modal/index.ts +0 -1
  40. package/contents/apps/mobile/src/components/atoms/Modal/modal.component.tsx +0 -58
  41. package/contents/apps/mobile/src/components/atoms/ScreenLoader/index.ts +0 -1
  42. package/contents/apps/mobile/src/components/atoms/ScreenLoader/screen-loader.component.tsx +0 -17
  43. package/contents/apps/mobile/src/components/atoms/Skeleton/index.ts +0 -1
  44. package/contents/apps/mobile/src/components/atoms/Skeleton/skeleton.component.tsx +0 -42
  45. package/contents/apps/mobile/src/components/atoms/Text/index.ts +0 -1
  46. package/contents/apps/mobile/src/components/atoms/Text/text.component.tsx +0 -23
  47. package/contents/apps/mobile/src/components/atoms/TextInput/constants.ts +0 -43
  48. package/contents/apps/mobile/src/components/atoms/TextInput/index.ts +0 -2
  49. package/contents/apps/mobile/src/components/atoms/TextInput/text-input.component.tsx +0 -137
  50. package/contents/apps/mobile/src/components/atoms/index.ts +0 -10
  51. package/contents/apps/mobile/src/components/index.ts +0 -3
  52. package/contents/apps/mobile/src/components/molecules/BackButton/back-button.component.tsx +0 -58
  53. package/contents/apps/mobile/src/components/molecules/BackButton/index.ts +0 -1
  54. package/contents/apps/mobile/src/components/molecules/BottomActionsContainer/BottomActionsContainer.component.tsx +0 -28
  55. package/contents/apps/mobile/src/components/molecules/BottomActionsContainer/index.ts +0 -1
  56. package/contents/apps/mobile/src/components/molecules/ScreenContainer/index.ts +0 -1
  57. package/contents/apps/mobile/src/components/molecules/ScreenContainer/screen-container.component.tsx +0 -100
  58. package/contents/apps/mobile/src/components/molecules/ScreenHeader/index.ts +0 -1
  59. package/contents/apps/mobile/src/components/molecules/ScreenHeader/screen-header.component.tsx +0 -71
  60. package/contents/apps/mobile/src/components/molecules/StorageManager/StorageManager.component.tsx +0 -18
  61. package/contents/apps/mobile/src/components/molecules/StorageManager/index.ts +0 -1
  62. package/contents/apps/mobile/src/components/molecules/index.ts +0 -5
  63. package/contents/apps/mobile/src/components/organisms/index.ts +0 -1
  64. package/contents/apps/mobile/src/config/index.ts +0 -13
  65. package/contents/apps/mobile/src/dimens/index.ts +0 -1
  66. package/contents/apps/mobile/src/env.d.ts +0 -17
  67. package/contents/apps/mobile/src/hooks/index.ts +0 -9
  68. package/contents/apps/mobile/src/hooks/useAppState.hook.tsx +0 -20
  69. package/contents/apps/mobile/src/hooks/useApplicationDimensions.hook.tsx +0 -10
  70. package/contents/apps/mobile/src/hooks/useDebounce.hook.ts +0 -11
  71. package/contents/apps/mobile/src/hooks/useGetLayoutHeight.hook.tsx +0 -27
  72. package/contents/apps/mobile/src/hooks/useGetLayoutWidth.hook.tsx +0 -27
  73. package/contents/apps/mobile/src/hooks/useNavigation.hook.tsx +0 -8
  74. package/contents/apps/mobile/src/hooks/useShakeAnimation.hook.tsx +0 -32
  75. package/contents/apps/mobile/src/hooks/useTextInputChangeFocus.hook.tsx +0 -12
  76. package/contents/apps/mobile/src/hooks/useThrottle.hook.ts +0 -11
  77. package/contents/apps/mobile/src/icons/arrow-left.svg +0 -3
  78. package/contents/apps/mobile/src/icons/checkbox-active.svg +0 -4
  79. package/contents/apps/mobile/src/icons/checkbox-unactive.svg +0 -4
  80. package/contents/apps/mobile/src/icons/close.svg +0 -3
  81. package/contents/apps/mobile/src/icons/download.svg +0 -4
  82. package/contents/apps/mobile/src/icons/email.svg +0 -10
  83. package/contents/apps/mobile/src/icons/eye-slash.svg +0 -11
  84. package/contents/apps/mobile/src/icons/eye.svg +0 -4
  85. package/contents/apps/mobile/src/icons/gear.svg +0 -4
  86. package/contents/apps/mobile/src/icons/home.svg +0 -3
  87. package/contents/apps/mobile/src/icons/index.ts +0 -33
  88. package/contents/apps/mobile/src/icons/pencil.svg +0 -3
  89. package/contents/apps/mobile/src/icons/phone.svg +0 -3
  90. package/contents/apps/mobile/src/icons/user-circle.svg +0 -3
  91. package/contents/apps/mobile/src/icons/user.svg +0 -4
  92. package/contents/apps/mobile/src/icons/warning.svg +0 -3
  93. package/contents/apps/mobile/src/main.tsx +0 -5
  94. package/contents/apps/mobile/src/routes/index.tsx +0 -65
  95. package/contents/apps/mobile/src/routes/privateRoutes.tsx +0 -32
  96. package/contents/apps/mobile/src/routes/publicRoutes.tsx +0 -26
  97. package/contents/apps/mobile/src/routes/routes.enum.ts +0 -5
  98. package/contents/apps/mobile/src/routes/screen-options.ts +0 -9
  99. package/contents/apps/mobile/src/routes/screens.enum.ts +0 -4
  100. package/contents/apps/mobile/src/screens/HomeScreen/home.screen.tsx +0 -12
  101. package/contents/apps/mobile/src/screens/LoginScreen/login.screen.tsx +0 -13
  102. package/contents/apps/mobile/src/stores/index.ts +0 -1
  103. package/contents/apps/mobile/src/stores/local-storage.store.ts +0 -60
  104. package/contents/apps/mobile/src/stores/mmkvStorage.ts +0 -19
  105. package/contents/apps/mobile/src/tailwind/index.ts +0 -24
  106. package/contents/apps/mobile/src/types/component.type.ts +0 -13
  107. package/contents/apps/mobile/src/types/index.ts +0 -1
  108. package/contents/apps/mobile/tailwind.config.js +0 -80
  109. package/contents/apps/mobile/tsconfig.app.json +0 -11
  110. package/contents/check-env.sh +0 -44
  111. package/contents/clean-generated-outputs.sh +0 -32
@@ -1,58 +0,0 @@
1
- /* eslint-disable no-magic-numbers */
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';
5
- import RNModal from 'react-native-modal';
6
-
7
- import { tw } from '../../../tailwind';
8
- import { DefaultComponentProps } from '../../../types';
9
-
10
- export type ModalProps = DefaultComponentProps &
11
- ModalBaseProps & {
12
- children?: ReactNode;
13
- containerStyle?: StyleProp<ViewStyle>;
14
- isVisible: boolean;
15
- onBackdropPress?: () => void;
16
- onBackButtonPress?: () => void;
17
- };
18
-
19
- const backdropColor = 'rgba(0, 0, 0, 0.6)';
20
-
21
- export function Modal(props: ModalProps) {
22
- const { children, containerStyle, isVisible, onBackButtonPress, onBackdropPress, style } = props;
23
-
24
- return (
25
- <RNModal
26
- backdropColor={backdropColor}
27
- backdropTransitionOutTiming={0}
28
- isVisible={isVisible}
29
- style={[tw`m-0 w-full`, style]}
30
- onBackButtonPress={onBackButtonPress}
31
- onBackdropPress={onBackdropPress}
32
- >
33
- <BottomSheetModalProvider>
34
- <View style={[tw`px-4`, containerStyle]}>{children}</View>
35
- </BottomSheetModalProvider>
36
- </RNModal>
37
- );
38
- }
39
-
40
- export function useModal() {
41
- const [isVisible, setVisible] = useState<boolean>(false);
42
-
43
- const showModal = useCallback(() => {
44
- Keyboard.dismiss();
45
- setVisible(true);
46
- }, []);
47
-
48
- const hideModal = useCallback(() => {
49
- Keyboard.dismiss();
50
- setVisible(false);
51
- }, []);
52
-
53
- return {
54
- hideModal,
55
- isVisible,
56
- showModal,
57
- };
58
- }
@@ -1 +0,0 @@
1
- export * from './screen-loader.component';
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { ActivityIndicator, View } from 'react-native';
3
-
4
- import { colors, tw } from '../../../tailwind';
5
- import { DefaultComponentProps } from '../../../types/component.type';
6
-
7
- type Props = DefaultComponentProps;
8
-
9
- export function ScreenLoader(props: Props): JSX.Element {
10
- const { style } = props;
11
-
12
- return (
13
- <View style={[tw`h-full w-full items-center justify-center bg-gray-50 p-8`, style]}>
14
- <ActivityIndicator color={colors.primary[400]} />
15
- </View>
16
- );
17
- }
@@ -1 +0,0 @@
1
- export * from './skeleton.component';
@@ -1,42 +0,0 @@
1
- import React from 'react';
2
- import { View } from 'react-native';
3
- import Animated, {
4
- useAnimatedStyle,
5
- useSharedValue,
6
- withRepeat,
7
- withTiming,
8
- } from 'react-native-reanimated';
9
-
10
- import { tw } from '../../../tailwind';
11
-
12
- interface Props {
13
- children: React.ReactNode;
14
- isLoading: boolean;
15
- }
16
-
17
- export function Skeleton(props: Props) {
18
- const { children, isLoading } = props;
19
- const opacity = useSharedValue(1);
20
-
21
- const animatedStyle = useAnimatedStyle(
22
- () => ({
23
- opacity: withRepeat(withTiming(opacity.value, { duration: 500 }), -1, true),
24
- }),
25
- [],
26
- );
27
-
28
- React.useEffect(() => {
29
- opacity.value = 0.5; // Start the animation
30
- }, []);
31
-
32
- if (!isLoading) {
33
- // eslint-disable-next-line react/jsx-no-useless-fragment
34
- return <>{children}</>;
35
- }
36
-
37
- return (
38
- <Animated.View style={[tw`rounded-lg bg-gray-200`, animatedStyle]}>
39
- <View style={tw`opacity-0`}>{children}</View>
40
- </Animated.View>
41
- );
42
- }
@@ -1 +0,0 @@
1
- export * from './text.component';
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import { Text as RNText, TextProps } from 'react-native';
3
-
4
- import { tw } from '../../../tailwind';
5
-
6
- type Props = TextProps & {
7
- numberOfLines?: number;
8
- };
9
-
10
- export function Text(props: Props): JSX.Element {
11
- const { numberOfLines = 0, style, ...extraProps } = props;
12
-
13
- const shouldTruncateTextProps: TextProps =
14
- numberOfLines > 0 ? { ellipsizeMode: 'tail', numberOfLines } : {};
15
-
16
- return (
17
- <RNText
18
- {...shouldTruncateTextProps}
19
- style={[tw`text-black-950 font-sans text-base font-normal`, style]}
20
- {...extraProps}
21
- />
22
- );
23
- }
@@ -1,43 +0,0 @@
1
- import { TextInputProps } from 'react-native';
2
-
3
- export const DefaultPhonePadInputProps: TextInputProps = {
4
- autoCapitalize: 'none',
5
- autoCorrect: false,
6
- keyboardType: 'phone-pad',
7
- numberOfLines: 1,
8
- };
9
-
10
- export const DefaultNumberPadInputProps: TextInputProps = {
11
- autoCapitalize: 'none',
12
- autoCorrect: false,
13
- keyboardType: 'number-pad',
14
- numberOfLines: 1,
15
- };
16
-
17
- export const DefaultNumericInputProps: TextInputProps = {
18
- autoCapitalize: 'none',
19
- autoCorrect: false,
20
- keyboardType: 'numeric',
21
- numberOfLines: 1,
22
- };
23
-
24
- export const DefaultNameInputProps: TextInputProps = {
25
- autoCapitalize: 'words',
26
- autoCorrect: false,
27
- keyboardType: 'default',
28
- numberOfLines: 1,
29
- };
30
-
31
- export const DefaultEmailInputProps: TextInputProps = {
32
- autoCapitalize: 'none',
33
- autoCorrect: false,
34
- keyboardType: 'email-address',
35
- numberOfLines: 1,
36
- };
37
-
38
- export const DefaultTextAreaInputProps: TextInputProps = {
39
- autoCapitalize: 'sentences',
40
- autoCorrect: false,
41
- keyboardType: 'default',
42
- numberOfLines: 3,
43
- };
@@ -1,2 +0,0 @@
1
- export * from './constants';
2
- export * from './text-input.component';
@@ -1,137 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import {
3
- TextInput as RNTextInput,
4
- TextInputProps as RNTextInputProps,
5
- StyleProp,
6
- TextStyle,
7
- View,
8
- } from 'react-native';
9
-
10
- import {
11
- colors,
12
- defaultInputContainerStyle,
13
- defaultInputTextStyle,
14
- disabledInputStyle,
15
- focusedInputStyle,
16
- } from '../../../tailwind';
17
- import { DefaultInputComponentProps } from '../../../types';
18
-
19
- import { DefaultNameInputProps, DefaultTextAreaInputProps } from './constants';
20
-
21
- export const TEXT_INPUT_MIN_HEIGHT = 100;
22
- export const TEXT_INPUT_LINE_HEIGHT = 21;
23
-
24
- export function getTextInputHeightAdjustment(numberOfNewLines: number) {
25
- if (numberOfNewLines < 2) {
26
- return TEXT_INPUT_MIN_HEIGHT;
27
- }
28
-
29
- return TEXT_INPUT_MIN_HEIGHT + (numberOfNewLines - 2) * TEXT_INPUT_LINE_HEIGHT;
30
- }
31
-
32
- export type TextInputProps = DefaultInputComponentProps<string> &
33
- RNTextInputProps & {
34
- textInputRef?: React.RefObject<RNTextInput>;
35
- textStyle?: StyleProp<TextStyle>;
36
- };
37
-
38
- export function TextInput(props: TextInputProps) {
39
- const {
40
- isDisabled = false,
41
- multiline = false,
42
- onChangeText,
43
- placeholder,
44
- style,
45
- textInputRef,
46
- textStyle,
47
- value,
48
- ...extraProps
49
- } = props;
50
- const [isFocused, setFocused] = useState<boolean>(false);
51
-
52
- function handleOnChangeText(text: string) {
53
- onChangeText?.(text);
54
- }
55
-
56
- function handleOnFocus() {
57
- setFocused(true);
58
- }
59
-
60
- function handleOnBlur() {
61
- setFocused(false);
62
- }
63
-
64
- return (
65
- <View
66
- style={[
67
- defaultInputContainerStyle,
68
- focusedInputStyle(isFocused),
69
- disabledInputStyle(isDisabled),
70
- style,
71
- ]}
72
- >
73
- <RNTextInput
74
- {...DefaultNameInputProps}
75
- ref={textInputRef}
76
- editable={!isDisabled}
77
- multiline={multiline}
78
- placeholder={placeholder}
79
- placeholderTextColor={colors.gray[600]}
80
- selectionColor={colors.primary[400]}
81
- style={[defaultInputTextStyle, textStyle]}
82
- value={value}
83
- onBlur={handleOnBlur}
84
- onChangeText={handleOnChangeText}
85
- onFocus={handleOnFocus}
86
- {...extraProps}
87
- />
88
- </View>
89
- );
90
- }
91
-
92
- export function TextInputArea(props: TextInputProps) {
93
- const {
94
- numberOfLines = DefaultTextAreaInputProps.numberOfLines as number,
95
- onChangeText,
96
- textStyle,
97
- value,
98
- ...extraProps
99
- } = props;
100
- const [numberOfNewLines, setNumberOfNewLines] = useState<number>(numberOfLines);
101
-
102
- function handleOnChangeText(text: string) {
103
- onChangeText?.(text);
104
- }
105
- useEffect(() => {
106
- if (!value) {
107
- return;
108
- }
109
-
110
- const newLines = value.split(/\r\n|\r|\n/).length;
111
-
112
- if (numberOfNewLines !== newLines) {
113
- setNumberOfNewLines(newLines);
114
- }
115
-
116
- // eslint-disable-next-line react-hooks/exhaustive-deps
117
- }, [value]);
118
-
119
- return (
120
- <TextInput
121
- {...DefaultTextAreaInputProps}
122
- multiline
123
- numberOfLines={numberOfLines}
124
- textStyle={[
125
- textStyle,
126
- {
127
- height: getTextInputHeightAdjustment(numberOfNewLines),
128
- minHeight: TEXT_INPUT_MIN_HEIGHT,
129
- textAlignVertical: 'top',
130
- },
131
- ]}
132
- value={value}
133
- onChangeText={handleOnChangeText}
134
- {...extraProps}
135
- />
136
- );
137
- }
@@ -1,10 +0,0 @@
1
- export * from './BottomSheet';
2
- export * from './Button';
3
- export * from './Divider';
4
- export * from './InputLayout';
5
- export * from './ListLoadingItem';
6
- export * from './Modal';
7
- export * from './ScreenLoader';
8
- export * from './Skeleton';
9
- export * from './Text';
10
- export * from './TextInput';
@@ -1,3 +0,0 @@
1
- export * from './atoms';
2
- export * from './molecules';
3
- export * from './organisms';
@@ -1,58 +0,0 @@
1
- import { useBackHandler } from '@react-native-community/hooks';
2
- import { ParamListBase } from '@react-navigation/native';
3
- import React from 'react';
4
- import {
5
- GestureResponderEvent,
6
- PressableProps,
7
- StyleProp,
8
- TouchableOpacity,
9
- View,
10
- ViewStyle,
11
- } from 'react-native';
12
-
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/component.type';
18
-
19
- type Props = DefaultComponentProps &
20
- PressableProps & {
21
- fallbackRoute?: Screens;
22
- onPress?: (event?: GestureResponderEvent) => void;
23
- style?: StyleProp<ViewStyle>;
24
- };
25
-
26
- const ACTIVE_OPACITY = 0.5;
27
- export function BackButton(props: Props): JSX.Element {
28
- const { fallbackRoute, onPress, style } = props;
29
- const navigation = useNavigation<ParamListBase>();
30
-
31
- useBackHandler(() => {
32
- handleOnPress();
33
-
34
- return true;
35
- });
36
-
37
- const handleOnPress = (event?: GestureResponderEvent) => {
38
- if (onPress) {
39
- onPress(event);
40
- } else if (navigation.canGoBack()) {
41
- navigation.goBack();
42
- } else if (fallbackRoute) {
43
- navigation.replace(fallbackRoute);
44
- }
45
- };
46
-
47
- return (
48
- <TouchableOpacity
49
- activeOpacity={ACTIVE_OPACITY}
50
- style={[tw`h-[48px] w-[48px]`, style]}
51
- onPress={handleOnPress}
52
- >
53
- <View style={[tw`flex-1 items-center justify-center rounded-full`, style]}>
54
- <ArrowLeftIcon style={tw`text-gray-950`} />
55
- </View>
56
- </TouchableOpacity>
57
- );
58
- }
@@ -1 +0,0 @@
1
- export * from './back-button.component';
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- import { ViewProps } from 'react-native';
3
- import { SafeAreaView } from 'react-native-safe-area-context';
4
-
5
- import { tw } from '../../../tailwind';
6
- import { DefaultComponentProps } from '../../../types';
7
-
8
- type Props = DefaultComponentProps &
9
- ViewProps & {
10
- children: React.ReactNode;
11
- };
12
-
13
- export function BottomActionsContainer(props: Props) {
14
- const { children, style, ...rest } = props;
15
-
16
- return (
17
- <SafeAreaView
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
- ]}
23
- {...rest}
24
- >
25
- {children}
26
- </SafeAreaView>
27
- );
28
- }
@@ -1 +0,0 @@
1
- export * from './BottomActionsContainer.component';
@@ -1 +0,0 @@
1
- export * from './screen-container.component';
@@ -1,100 +0,0 @@
1
- import { useFocusEffect } from '@react-navigation/core';
2
- import React, { ReactElement, useEffect } from 'react';
3
- import {
4
- NativeScrollEvent,
5
- NativeSyntheticEvent,
6
- Platform,
7
- StatusBar,
8
- StyleProp,
9
- View,
10
- ViewStyle,
11
- } from 'react-native';
12
- import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
13
- import Animated from 'react-native-reanimated';
14
- import { Edge, SafeAreaProviderProps, SafeAreaView } from 'react-native-safe-area-context';
15
-
16
- import CONFIG from '../../../config';
17
- import { tw } from '../../../tailwind';
18
-
19
- type Props = SafeAreaProviderProps & {
20
- containerStyle?: StyleProp<ViewStyle>;
21
- excludedEdges?: Edge[];
22
- extraBottomPadding?: number;
23
- hasScroll?: boolean;
24
- refreshControl?: ReactElement;
25
- shouldShowStatusBar?: boolean;
26
- shouldBeTranslucent?: boolean;
27
- statusBarColor?: string;
28
- onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
29
- };
30
-
31
- const defaultStyle = tw.style('grow', {
32
- paddingTop: StatusBar.currentHeight ? StatusBar.currentHeight - 1 : 0,
33
- });
34
-
35
- const safeAreaViewEdges: Edge[] = Platform.select({
36
- android: ['left', 'right', 'bottom'],
37
- default: [],
38
- ios: ['left', 'right', 'bottom', 'top'],
39
- });
40
-
41
- const AnimatedKeyboardAwareScrollView = Animated.createAnimatedComponent(KeyboardAwareScrollView);
42
-
43
- export function ScreenContainer(props: Props): JSX.Element {
44
- const {
45
- children,
46
- containerStyle,
47
- excludedEdges = [],
48
- extraBottomPadding = 0,
49
- hasScroll = true,
50
- onScroll,
51
- refreshControl,
52
- shouldBeTranslucent = false,
53
- shouldShowStatusBar = true,
54
- statusBarColor = 'transparent',
55
- style,
56
- } = props;
57
- const edges =
58
- excludedEdges.length > 0
59
- ? safeAreaViewEdges.filter((edge) => !excludedEdges.includes(edge))
60
- : safeAreaViewEdges;
61
-
62
- useEffect(() => {
63
- if (CONFIG.IS_ANDROID) {
64
- StatusBar.setBackgroundColor(statusBarColor);
65
- }
66
- }, [statusBarColor]);
67
-
68
- useFocusEffect(() => {
69
- StatusBar.setHidden(!shouldShowStatusBar);
70
- if (CONFIG.IS_ANDROID) {
71
- StatusBar.setBackgroundColor(statusBarColor);
72
- StatusBar.setTranslucent(!shouldBeTranslucent);
73
- }
74
- });
75
-
76
- const defaultContainerStyle = [
77
- defaultStyle,
78
- containerStyle,
79
- // eslint-disable-next-line no-magic-numbers
80
- extraBottomPadding && tw`pb-[${extraBottomPadding + 50}px]`,
81
- ];
82
-
83
- return (
84
- <SafeAreaView edges={edges} style={[tw`flex-1 bg-gray-50`, style]}>
85
- {hasScroll ? (
86
- <AnimatedKeyboardAwareScrollView
87
- contentContainerStyle={defaultContainerStyle}
88
- keyboardShouldPersistTaps="handled"
89
- refreshControl={refreshControl}
90
- scrollEventThrottle={16}
91
- onScroll={onScroll}
92
- >
93
- {children}
94
- </AnimatedKeyboardAwareScrollView>
95
- ) : (
96
- <View style={defaultContainerStyle}>{children}</View>
97
- )}
98
- </SafeAreaView>
99
- );
100
- }
@@ -1 +0,0 @@
1
- export * from './screen-header.component';
@@ -1,71 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import { StyleProp, TouchableOpacity, View, ViewStyle } from 'react-native';
3
-
4
- import { GearIcon } from '../../../icons';
5
- import { tw } from '../../../tailwind';
6
- import { DefaultComponentProps } from '../../../types/component.type';
7
- import { Text } from '../../atoms/Text';
8
- import { BackButton } from '../BackButton';
9
-
10
- type Props = DefaultComponentProps & {
11
- hasBackButton?: boolean;
12
- extraActionComponent?: ReactNode;
13
- shouldShowBorder?: boolean;
14
- title: string;
15
- titleStyle?: StyleProp<ViewStyle>;
16
- onBackPress?: () => void;
17
- onExtraActionPress?: () => void;
18
- };
19
-
20
- const ACTIVE_OPACITY = 0.5;
21
- export function ScreenHeader(props: Props) {
22
- const {
23
- extraActionComponent,
24
- hasBackButton = true,
25
- onBackPress,
26
- onExtraActionPress,
27
- shouldShowBorder = false,
28
- style,
29
- title,
30
- titleStyle,
31
- } = props;
32
-
33
- const hasExtraActionComponent = onExtraActionPress;
34
- const extraActionComponentDisplay = hasExtraActionComponent && (
35
- <TouchableOpacity
36
- activeOpacity={ACTIVE_OPACITY}
37
- style={tw`z-10 h-[48px] w-[48px]`}
38
- onPress={onExtraActionPress}
39
- >
40
- <View style={[tw`flex-1 items-center justify-center rounded-full`, style]}>
41
- {extraActionComponent ? (
42
- extraActionComponent
43
- ) : (
44
- <GearIcon height={25} style={tw`text-black-950`} width={25} />
45
- )}
46
- </View>
47
- </TouchableOpacity>
48
- );
49
-
50
- 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
- >
58
- {hasBackButton && <BackButton style={tw`z-10`} onPress={onBackPress} />}
59
- <Text
60
- style={[
61
- tw`text-primary-700 absolute inset-x-0 top-4 text-center text-xl font-medium`,
62
- titleStyle,
63
- ]}
64
- >
65
- {title}
66
- </Text>
67
- {extraActionComponentDisplay}
68
- </View>
69
- </View>
70
- );
71
- }
@@ -1,18 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- import { useLocalStorageState } from '../../../stores';
4
-
5
- type Props = {
6
- children: ReactNode;
7
- };
8
-
9
- export function StorageManager(props: Props) {
10
- const { children } = props;
11
- const hasHydrated = useLocalStorageState((state) => state._hasHydrated);
12
-
13
- if (!hasHydrated) {
14
- return null;
15
- }
16
-
17
- return children;
18
- }
@@ -1 +0,0 @@
1
- export * from './StorageManager.component';
@@ -1,5 +0,0 @@
1
- export * from './BackButton';
2
- export * from './BottomActionsContainer';
3
- export * from './ScreenContainer';
4
- export * from './ScreenHeader';
5
- export * from './StorageManager';
@@ -1 +0,0 @@
1
- export default {};
@@ -1,13 +0,0 @@
1
- /* eslint-disable import/no-unresolved */
2
- import { API_BASE_URL, IS_LIVE, STORAGE_KEY } from '@env';
3
- import { Platform } from 'react-native';
4
-
5
- const CONFIG = {
6
- API_BASE_URL: API_BASE_URL,
7
- IS_ANDROID: Platform.OS === 'android',
8
- IS_IOS: Platform.OS === 'ios',
9
- IS_LIVE: IS_LIVE,
10
- STORAGE_KEY: STORAGE_KEY,
11
- };
12
-
13
- export default CONFIG;
@@ -1 +0,0 @@
1
- export const HEADER_HEIGHT = 110;