nx-react-native-cli 1.0.8 → 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.
- package/lib/index.cjs +39 -39
- package/package.json +1 -1
- package/contents/.eslintrc.json +0 -293
- package/contents/.husky/pre-commit +0 -5
- package/contents/.husky/pre-push +0 -15
- package/contents/.nvmrc +0 -1
- package/contents/.prettierignore +0 -8
- package/contents/.prettierrc +0 -13
- package/contents/.ruby-version +0 -1
- package/contents/.vscode/extensions.json +0 -10
- package/contents/.vscode/settings.json +0 -18
- package/contents/apps/mobile/.env.template +0 -3
- package/contents/apps/mobile/.eslintrc.json +0 -34
- package/contents/apps/mobile/Gemfile +0 -11
- package/contents/apps/mobile/android/app/build.gradle +0 -164
- package/contents/apps/mobile/android/app/src/dev/res/values/strings.xml +0 -3
- package/contents/apps/mobile/android/app/src/production/res/values/strings.xml +0 -3
- package/contents/apps/mobile/android/build.gradle +0 -34
- package/contents/apps/mobile/babel.config.json +0 -14
- package/contents/apps/mobile/fastlane/.env.template +0 -24
- package/contents/apps/mobile/fastlane/Fastfile +0 -303
- package/contents/apps/mobile/fastlane/Matchfile +0 -5
- package/contents/apps/mobile/fastlane/Pluginfile +0 -6
- package/contents/apps/mobile/fastlane/README.md +0 -65
- package/contents/apps/mobile/package.json +0 -77
- package/contents/apps/mobile/project.json +0 -102
- package/contents/apps/mobile/src/app/index.tsx +0 -68
- package/contents/apps/mobile/src/components/atoms/BottomSheet/bottom-sheet.component.tsx +0 -145
- package/contents/apps/mobile/src/components/atoms/BottomSheet/index.ts +0 -1
- package/contents/apps/mobile/src/components/atoms/Button/button.component.tsx +0 -55
- package/contents/apps/mobile/src/components/atoms/Button/index.ts +0 -2
- package/contents/apps/mobile/src/components/atoms/Button/outlined-button.component.tsx +0 -59
- package/contents/apps/mobile/src/components/atoms/Divider/divider-component.tsx +0 -13
- package/contents/apps/mobile/src/components/atoms/Divider/index.ts +0 -1
- package/contents/apps/mobile/src/components/atoms/InputLayout/index.ts +0 -1
- package/contents/apps/mobile/src/components/atoms/InputLayout/input-layout.component.tsx +0 -34
- package/contents/apps/mobile/src/components/atoms/ListLoadingItem/index.ts +0 -1
- package/contents/apps/mobile/src/components/atoms/ListLoadingItem/list-loading-item.component.tsx +0 -56
- package/contents/apps/mobile/src/components/atoms/Modal/index.ts +0 -1
- package/contents/apps/mobile/src/components/atoms/Modal/modal.component.tsx +0 -58
- package/contents/apps/mobile/src/components/atoms/ScreenLoader/index.ts +0 -1
- package/contents/apps/mobile/src/components/atoms/ScreenLoader/screen-loader.component.tsx +0 -17
- package/contents/apps/mobile/src/components/atoms/Skeleton/index.ts +0 -1
- package/contents/apps/mobile/src/components/atoms/Skeleton/skeleton.component.tsx +0 -42
- package/contents/apps/mobile/src/components/atoms/Text/index.ts +0 -1
- package/contents/apps/mobile/src/components/atoms/Text/text.component.tsx +0 -23
- package/contents/apps/mobile/src/components/atoms/TextInput/constants.ts +0 -43
- package/contents/apps/mobile/src/components/atoms/TextInput/index.ts +0 -2
- package/contents/apps/mobile/src/components/atoms/TextInput/text-input.component.tsx +0 -137
- package/contents/apps/mobile/src/components/atoms/index.ts +0 -10
- package/contents/apps/mobile/src/components/index.ts +0 -3
- package/contents/apps/mobile/src/components/molecules/BackButton/back-button.component.tsx +0 -58
- package/contents/apps/mobile/src/components/molecules/BackButton/index.ts +0 -1
- package/contents/apps/mobile/src/components/molecules/BottomActionsContainer/BottomActionsContainer.component.tsx +0 -28
- package/contents/apps/mobile/src/components/molecules/BottomActionsContainer/index.ts +0 -1
- package/contents/apps/mobile/src/components/molecules/ScreenContainer/index.ts +0 -1
- package/contents/apps/mobile/src/components/molecules/ScreenContainer/screen-container.component.tsx +0 -100
- package/contents/apps/mobile/src/components/molecules/ScreenHeader/index.ts +0 -1
- package/contents/apps/mobile/src/components/molecules/ScreenHeader/screen-header.component.tsx +0 -71
- package/contents/apps/mobile/src/components/molecules/StorageManager/StorageManager.component.tsx +0 -18
- package/contents/apps/mobile/src/components/molecules/StorageManager/index.ts +0 -1
- package/contents/apps/mobile/src/components/molecules/index.ts +0 -5
- package/contents/apps/mobile/src/components/organisms/index.ts +0 -1
- package/contents/apps/mobile/src/config/index.ts +0 -13
- package/contents/apps/mobile/src/dimens/index.ts +0 -1
- package/contents/apps/mobile/src/env.d.ts +0 -17
- package/contents/apps/mobile/src/hooks/index.ts +0 -9
- package/contents/apps/mobile/src/hooks/useAppState.hook.tsx +0 -20
- package/contents/apps/mobile/src/hooks/useApplicationDimensions.hook.tsx +0 -10
- package/contents/apps/mobile/src/hooks/useDebounce.hook.ts +0 -11
- package/contents/apps/mobile/src/hooks/useGetLayoutHeight.hook.tsx +0 -27
- package/contents/apps/mobile/src/hooks/useGetLayoutWidth.hook.tsx +0 -27
- package/contents/apps/mobile/src/hooks/useNavigation.hook.tsx +0 -8
- package/contents/apps/mobile/src/hooks/useShakeAnimation.hook.tsx +0 -32
- package/contents/apps/mobile/src/hooks/useTextInputChangeFocus.hook.tsx +0 -12
- package/contents/apps/mobile/src/hooks/useThrottle.hook.ts +0 -11
- package/contents/apps/mobile/src/icons/arrow-left.svg +0 -3
- package/contents/apps/mobile/src/icons/checkbox-active.svg +0 -4
- package/contents/apps/mobile/src/icons/checkbox-unactive.svg +0 -4
- package/contents/apps/mobile/src/icons/close.svg +0 -3
- package/contents/apps/mobile/src/icons/download.svg +0 -4
- package/contents/apps/mobile/src/icons/email.svg +0 -10
- package/contents/apps/mobile/src/icons/eye-slash.svg +0 -11
- package/contents/apps/mobile/src/icons/eye.svg +0 -4
- package/contents/apps/mobile/src/icons/gear.svg +0 -4
- package/contents/apps/mobile/src/icons/home.svg +0 -3
- package/contents/apps/mobile/src/icons/index.ts +0 -33
- package/contents/apps/mobile/src/icons/pencil.svg +0 -3
- package/contents/apps/mobile/src/icons/phone.svg +0 -3
- package/contents/apps/mobile/src/icons/user-circle.svg +0 -3
- package/contents/apps/mobile/src/icons/user.svg +0 -4
- package/contents/apps/mobile/src/icons/warning.svg +0 -3
- package/contents/apps/mobile/src/main.tsx +0 -5
- package/contents/apps/mobile/src/routes/index.tsx +0 -65
- package/contents/apps/mobile/src/routes/privateRoutes.tsx +0 -32
- package/contents/apps/mobile/src/routes/publicRoutes.tsx +0 -26
- package/contents/apps/mobile/src/routes/routes.enum.ts +0 -5
- package/contents/apps/mobile/src/routes/screen-options.ts +0 -9
- package/contents/apps/mobile/src/routes/screens.enum.ts +0 -4
- package/contents/apps/mobile/src/screens/HomeScreen/home.screen.tsx +0 -12
- package/contents/apps/mobile/src/screens/LoginScreen/login.screen.tsx +0 -13
- package/contents/apps/mobile/src/stores/index.ts +0 -1
- package/contents/apps/mobile/src/stores/local-storage.store.ts +0 -60
- package/contents/apps/mobile/src/stores/mmkvStorage.ts +0 -19
- package/contents/apps/mobile/src/tailwind/index.ts +0 -24
- package/contents/apps/mobile/src/types/component.type.ts +0 -13
- package/contents/apps/mobile/src/types/index.ts +0 -1
- package/contents/apps/mobile/tailwind.config.js +0 -80
- package/contents/apps/mobile/tsconfig.app.json +0 -11
- package/contents/check-env.sh +0 -44
- package/contents/clean-generated-outputs.sh +0 -32
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-magic-numbers */
|
|
2
|
-
import {
|
|
3
|
-
BottomSheetBackdropProps,
|
|
4
|
-
BottomSheetHandle,
|
|
5
|
-
BottomSheetHandleProps,
|
|
6
|
-
BottomSheetModal,
|
|
7
|
-
BottomSheetScrollView,
|
|
8
|
-
} from '@gorhom/bottom-sheet';
|
|
9
|
-
import React, { FC, ReactNode, RefObject, useCallback, useMemo, useRef } from 'react';
|
|
10
|
-
import { Keyboard, StyleProp, ViewStyle } from 'react-native';
|
|
11
|
-
import { TouchableWithoutFeedback } from 'react-native-gesture-handler';
|
|
12
|
-
import Animated, { Extrapolation, interpolate, useAnimatedStyle } from 'react-native-reanimated';
|
|
13
|
-
|
|
14
|
-
import { tw } from '../../../tailwind';
|
|
15
|
-
import { DefaultComponentProps } from '../../../types';
|
|
16
|
-
|
|
17
|
-
export type BottomSheetProps = DefaultComponentProps & {
|
|
18
|
-
backgroundStyle?: StyleProp<Omit<ViewStyle, 'left' | 'right' | 'position' | 'top' | 'bottom'>>;
|
|
19
|
-
children?: ReactNode;
|
|
20
|
-
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
21
|
-
enableDismissOnPressBackdrop?: boolean;
|
|
22
|
-
enableDynamicSizing?: boolean;
|
|
23
|
-
enablePanDownToClose?: boolean;
|
|
24
|
-
handleComponent?: FC<BottomSheetHandleProps> | null;
|
|
25
|
-
onExpand?: () => void;
|
|
26
|
-
sheetRef: RefObject<BottomSheetModal>;
|
|
27
|
-
snapPoints?: string[];
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const DEFAULT_SNAP_POINTS = ['25%', '50%', '100%'];
|
|
31
|
-
|
|
32
|
-
const CustomBackdrop = ({
|
|
33
|
-
animatedIndex,
|
|
34
|
-
enableDismissOnPressBackdrop = true,
|
|
35
|
-
sheetRef,
|
|
36
|
-
style,
|
|
37
|
-
}: BottomSheetBackdropProps & {
|
|
38
|
-
enableDismissOnPressBackdrop?: boolean;
|
|
39
|
-
sheetRef: RefObject<BottomSheetModal>;
|
|
40
|
-
}) => {
|
|
41
|
-
function handleDismiss() {
|
|
42
|
-
if (enableDismissOnPressBackdrop) {
|
|
43
|
-
sheetRef.current?.close();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const containerAnimatedStyle = useAnimatedStyle(() => {
|
|
48
|
-
const opacity = interpolate(
|
|
49
|
-
animatedIndex.value,
|
|
50
|
-
[-1, 0, 1],
|
|
51
|
-
[0, 0.5, 0.75],
|
|
52
|
-
Extrapolation.CLAMP,
|
|
53
|
-
);
|
|
54
|
-
const pointerEvents = opacity > 0.25 ? 'auto' : 'none';
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
opacity,
|
|
58
|
-
pointerEvents,
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
// styles
|
|
63
|
-
const containerStyle = useMemo(
|
|
64
|
-
() => [style, tw`bg-black-950/60`, containerAnimatedStyle],
|
|
65
|
-
[style, containerAnimatedStyle],
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<Animated.View style={containerStyle}>
|
|
70
|
-
<TouchableWithoutFeedback style={tw`h-full w-full`} onPress={handleDismiss} />
|
|
71
|
-
</Animated.View>
|
|
72
|
-
);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export function BottomSheet(props: BottomSheetProps) {
|
|
76
|
-
const {
|
|
77
|
-
backgroundStyle,
|
|
78
|
-
children,
|
|
79
|
-
contentContainerStyle,
|
|
80
|
-
enableDismissOnPressBackdrop = true,
|
|
81
|
-
enableDynamicSizing = false,
|
|
82
|
-
enablePanDownToClose = true,
|
|
83
|
-
handleComponent = BottomSheetHandle,
|
|
84
|
-
sheetRef,
|
|
85
|
-
snapPoints = DEFAULT_SNAP_POINTS,
|
|
86
|
-
style,
|
|
87
|
-
} = props;
|
|
88
|
-
const points = enableDynamicSizing ? undefined : snapPoints;
|
|
89
|
-
|
|
90
|
-
function renderBackdrop(backdropProps: BottomSheetBackdropProps) {
|
|
91
|
-
return (
|
|
92
|
-
<CustomBackdrop
|
|
93
|
-
{...backdropProps}
|
|
94
|
-
enableDismissOnPressBackdrop={enableDismissOnPressBackdrop}
|
|
95
|
-
sheetRef={sheetRef}
|
|
96
|
-
/>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return (
|
|
101
|
-
<BottomSheetModal
|
|
102
|
-
ref={sheetRef}
|
|
103
|
-
backdropComponent={renderBackdrop}
|
|
104
|
-
backgroundStyle={[tw`bg-gray-50`, backgroundStyle]}
|
|
105
|
-
enableDynamicSizing={enableDynamicSizing}
|
|
106
|
-
enablePanDownToClose={enablePanDownToClose}
|
|
107
|
-
handleComponent={handleComponent}
|
|
108
|
-
handleIndicatorStyle={tw`bg-gray-50`}
|
|
109
|
-
handleStyle={tw`rounded-tl-xl rounded-tr-xl`}
|
|
110
|
-
keyboardBehavior="interactive"
|
|
111
|
-
snapPoints={points}
|
|
112
|
-
style={[
|
|
113
|
-
tw`rounded-md`,
|
|
114
|
-
{
|
|
115
|
-
elevation: 10,
|
|
116
|
-
},
|
|
117
|
-
style,
|
|
118
|
-
]}
|
|
119
|
-
>
|
|
120
|
-
<BottomSheetScrollView contentContainerStyle={contentContainerStyle}>
|
|
121
|
-
{children}
|
|
122
|
-
</BottomSheetScrollView>
|
|
123
|
-
</BottomSheetModal>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export function useBottomSheet() {
|
|
128
|
-
const sheetRef = useRef<BottomSheetModal>(null);
|
|
129
|
-
|
|
130
|
-
const expandSheet = useCallback(() => {
|
|
131
|
-
Keyboard.dismiss();
|
|
132
|
-
sheetRef.current?.present();
|
|
133
|
-
}, []);
|
|
134
|
-
|
|
135
|
-
const closeSheet = useCallback(() => {
|
|
136
|
-
Keyboard.dismiss();
|
|
137
|
-
sheetRef.current?.close();
|
|
138
|
-
}, []);
|
|
139
|
-
|
|
140
|
-
return {
|
|
141
|
-
closeSheet,
|
|
142
|
-
expandSheet,
|
|
143
|
-
sheetRef,
|
|
144
|
-
};
|
|
145
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './bottom-sheet.component';
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
ActivityIndicator,
|
|
4
|
-
StyleProp,
|
|
5
|
-
TextStyle,
|
|
6
|
-
TouchableOpacity,
|
|
7
|
-
TouchableOpacityProps,
|
|
8
|
-
View,
|
|
9
|
-
ViewStyle,
|
|
10
|
-
} from 'react-native';
|
|
11
|
-
|
|
12
|
-
import { colors, disabledInputStyle, tw } from '../../../tailwind';
|
|
13
|
-
import { DefaultComponentProps } from '../../../types/component.type';
|
|
14
|
-
import { Text } from '../Text';
|
|
15
|
-
|
|
16
|
-
type Props = DefaultComponentProps &
|
|
17
|
-
TouchableOpacityProps & {
|
|
18
|
-
buttonStyle?: StyleProp<ViewStyle>;
|
|
19
|
-
children?: React.ReactNode;
|
|
20
|
-
isLoading?: boolean;
|
|
21
|
-
textStyle?: StyleProp<TextStyle>;
|
|
22
|
-
title?: string;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const ACTIVE_OPACITY = 0.5;
|
|
26
|
-
|
|
27
|
-
export function Button(props: Props): JSX.Element {
|
|
28
|
-
const {
|
|
29
|
-
activeOpacity = ACTIVE_OPACITY,
|
|
30
|
-
buttonStyle,
|
|
31
|
-
children,
|
|
32
|
-
isDisabled = false,
|
|
33
|
-
isLoading = false,
|
|
34
|
-
style,
|
|
35
|
-
textStyle,
|
|
36
|
-
title = 'Button',
|
|
37
|
-
...rest
|
|
38
|
-
} = props;
|
|
39
|
-
const disabled = isDisabled || isLoading;
|
|
40
|
-
const display = children ?? <Text style={[tw`font-medium text-white`, textStyle]}>{title}</Text>;
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<TouchableOpacity activeOpacity={activeOpacity} disabled={disabled} style={[style]} {...rest}>
|
|
44
|
-
<View
|
|
45
|
-
style={[
|
|
46
|
-
tw`bg-primary-700 items-center justify-center rounded-xl p-4`,
|
|
47
|
-
buttonStyle,
|
|
48
|
-
disabledInputStyle(disabled),
|
|
49
|
-
]}
|
|
50
|
-
>
|
|
51
|
-
{isLoading ? <ActivityIndicator color={colors.white} /> : display}
|
|
52
|
-
</View>
|
|
53
|
-
</TouchableOpacity>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
ActivityIndicator,
|
|
4
|
-
StyleProp,
|
|
5
|
-
TextStyle,
|
|
6
|
-
TouchableOpacity,
|
|
7
|
-
TouchableOpacityProps,
|
|
8
|
-
View,
|
|
9
|
-
ViewStyle,
|
|
10
|
-
} from 'react-native';
|
|
11
|
-
|
|
12
|
-
import { colors, disabledInputStyle, tw } from '../../../tailwind';
|
|
13
|
-
import { DefaultComponentProps } from '../../../types/component.type';
|
|
14
|
-
import { Text } from '../Text';
|
|
15
|
-
|
|
16
|
-
type Props = DefaultComponentProps &
|
|
17
|
-
TouchableOpacityProps & {
|
|
18
|
-
buttonStyle?: StyleProp<ViewStyle>;
|
|
19
|
-
children?: React.ReactNode;
|
|
20
|
-
isLoading?: boolean;
|
|
21
|
-
textStyle?: StyleProp<TextStyle>;
|
|
22
|
-
title?: string;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const ACTIVE_OPACITY = 0.5;
|
|
26
|
-
|
|
27
|
-
export function OutlinedButton(props: Props): JSX.Element {
|
|
28
|
-
const {
|
|
29
|
-
activeOpacity = ACTIVE_OPACITY,
|
|
30
|
-
buttonStyle,
|
|
31
|
-
children,
|
|
32
|
-
isDisabled = false,
|
|
33
|
-
isLoading = false,
|
|
34
|
-
style,
|
|
35
|
-
textStyle,
|
|
36
|
-
title = 'Button',
|
|
37
|
-
...rest
|
|
38
|
-
} = props;
|
|
39
|
-
const disabled = isDisabled || isLoading;
|
|
40
|
-
const display = children ? (
|
|
41
|
-
children
|
|
42
|
-
) : (
|
|
43
|
-
<Text style={[tw`text-primary-700 font-medium`, textStyle]}>{title}</Text>
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<TouchableOpacity activeOpacity={activeOpacity} disabled={disabled} style={[style]} {...rest}>
|
|
48
|
-
<View
|
|
49
|
-
style={[
|
|
50
|
-
tw`border-primary-700 items-center justify-center rounded-md border-2 bg-white p-4`,
|
|
51
|
-
buttonStyle,
|
|
52
|
-
disabledInputStyle(disabled),
|
|
53
|
-
]}
|
|
54
|
-
>
|
|
55
|
-
{isLoading ? <ActivityIndicator color={colors.primary[100]} /> : display}
|
|
56
|
-
</View>
|
|
57
|
-
</TouchableOpacity>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
|
|
4
|
-
import { tw } from '../../../tailwind';
|
|
5
|
-
import { DefaultComponentProps } from '../../../types';
|
|
6
|
-
|
|
7
|
-
type Props = DefaultComponentProps & {};
|
|
8
|
-
|
|
9
|
-
export function Divider(props: Props) {
|
|
10
|
-
const { style } = props;
|
|
11
|
-
|
|
12
|
-
return <View style={[tw`h-[1px] w-full bg-gray-200`, style]}></View>;
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './divider-component';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './input-layout.component';
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StyleProp, TextStyle, View } from 'react-native';
|
|
3
|
-
|
|
4
|
-
import { tw } from '../../../tailwind';
|
|
5
|
-
import { DefaultComponentProps } from '../../../types';
|
|
6
|
-
import { Text } from '../Text';
|
|
7
|
-
|
|
8
|
-
type Props = DefaultComponentProps & {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
isRequired?: boolean;
|
|
11
|
-
label?: string;
|
|
12
|
-
textStyle?: StyleProp<TextStyle>;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export function InputLayout(props: Props) {
|
|
16
|
-
const { children, error, isRequired, label, style, textStyle } = props;
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<View style={[style]}>
|
|
20
|
-
{label && (
|
|
21
|
-
<Text style={[tw`mb-2 text-gray-600`, textStyle]}>
|
|
22
|
-
{label}
|
|
23
|
-
{isRequired && <Text style={tw`text-red-600`}>{isRequired && '*'}</Text>}
|
|
24
|
-
</Text>
|
|
25
|
-
)}
|
|
26
|
-
{children}
|
|
27
|
-
{!!error && (
|
|
28
|
-
<View style={tw`items-end`}>
|
|
29
|
-
<Text style={tw`text-right text-red-500`}>{error}</Text>
|
|
30
|
-
</View>
|
|
31
|
-
)}
|
|
32
|
-
</View>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './list-loading-item.component';
|
package/contents/apps/mobile/src/components/atoms/ListLoadingItem/list-loading-item.component.tsx
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
|
|
4
|
-
import { tw } from '../../../tailwind';
|
|
5
|
-
import { DefaultComponentProps } from '../../../types';
|
|
6
|
-
import { Skeleton } from '../Skeleton';
|
|
7
|
-
|
|
8
|
-
type Props = DefaultComponentProps & {
|
|
9
|
-
isLoading: boolean;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export function ListLoadingItemComponent(props: Props) {
|
|
13
|
-
const { isLoading, style } = props;
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<View style={[style]}>
|
|
17
|
-
<View style={[tw`gap-2`, style]}>
|
|
18
|
-
<Skeleton isLoading={isLoading}>
|
|
19
|
-
{isLoading && <View style={tw`h-[100px] w-full`} />}
|
|
20
|
-
</Skeleton>
|
|
21
|
-
<Skeleton isLoading={isLoading}>
|
|
22
|
-
{isLoading && <View style={tw`h-[100px] w-full`} />}
|
|
23
|
-
</Skeleton>
|
|
24
|
-
<Skeleton isLoading={isLoading}>
|
|
25
|
-
{isLoading && <View style={tw`h-[100px] w-full`} />}
|
|
26
|
-
</Skeleton>
|
|
27
|
-
</View>
|
|
28
|
-
</View>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function ListLoadingHorizontalItemComponent(props: Props) {
|
|
33
|
-
const { isLoading, style } = props;
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<View style={[style]}>
|
|
37
|
-
<View style={[tw`flex-row gap-2`, style]}>
|
|
38
|
-
<Skeleton isLoading={isLoading}>
|
|
39
|
-
{isLoading && <View style={tw`h-[200px] w-[100px]`} />}
|
|
40
|
-
</Skeleton>
|
|
41
|
-
<Skeleton isLoading={isLoading}>
|
|
42
|
-
{isLoading && <View style={tw`h-[200px] w-[100px]`} />}
|
|
43
|
-
</Skeleton>
|
|
44
|
-
<Skeleton isLoading={isLoading}>
|
|
45
|
-
{isLoading && <View style={tw`h-[200px] w-[100px]`} />}
|
|
46
|
-
</Skeleton>
|
|
47
|
-
<Skeleton isLoading={isLoading}>
|
|
48
|
-
{isLoading && <View style={tw`h-[200px] w-[100px]`} />}
|
|
49
|
-
</Skeleton>
|
|
50
|
-
<Skeleton isLoading={isLoading}>
|
|
51
|
-
{isLoading && <View style={tw`h-[200px] w-[100px]`} />}
|
|
52
|
-
</Skeleton>
|
|
53
|
-
</View>
|
|
54
|
-
</View>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './modal.component';
|
|
@@ -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
|
-
};
|