nx-react-native-cli 1.0.17 → 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.
- package/lib/index.cjs +13 -13
- package/package.json +1 -1
- package/templates/.eslintrc.json +1 -0
- package/templates/.nvmrc +1 -1
- package/templates/apps/mobile/android/app/build.gradle +1 -1
- package/templates/apps/mobile/android/app/proguard-rules.pro +20 -0
- package/templates/apps/mobile/package.json +3 -1
- package/templates/apps/mobile/react-native.config.js +7 -0
- package/templates/apps/mobile/src/app/index.tsx +7 -1
- package/templates/apps/mobile/src/assets/fonts/InterBlack.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterBlackItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterBold.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterBoldItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterExtraBold.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterExtraBoldItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterExtraLight.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterExtraLightItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterLight.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterLightItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterMedium.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterMediumItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterRegular.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterSemiBold.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterSemiBoldItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterThin.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/InterThinItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratBlack.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratBlackItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratBold.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratBoldItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratExtraBold.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratExtraBoldItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratExtraLight.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratExtraLightItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratLight.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratLightItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratMedium.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratMediumItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratRegular.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratSemiBold.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratSemiBoldItalic.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratThin.ttf +0 -0
- package/templates/apps/mobile/src/assets/fonts/MontserratThinItalic.ttf +0 -0
- package/templates/apps/mobile/src/components/atoms/BottomSheet/bottom-sheet.component.tsx +9 -7
- package/templates/apps/mobile/src/components/atoms/Box/box.component.tsx +21 -0
- package/templates/apps/mobile/src/components/atoms/Box/index.ts +1 -0
- package/templates/apps/mobile/src/components/atoms/Button/button.component.tsx +24 -8
- package/templates/apps/mobile/src/components/atoms/Button/index.ts +0 -1
- package/templates/apps/mobile/src/components/atoms/Divider/divider-component.tsx +2 -2
- package/templates/apps/mobile/src/components/atoms/InputLayout/input-layout.component.tsx +12 -11
- package/templates/apps/mobile/src/components/atoms/ListLoadingItem/list-loading-item.component.tsx +17 -17
- package/templates/apps/mobile/src/components/atoms/Modal/modal.component.tsx +5 -4
- package/templates/apps/mobile/src/components/atoms/ScreenLoader/screen-loader.component.tsx +5 -4
- package/templates/apps/mobile/src/components/atoms/Skeleton/skeleton.component.tsx +2 -2
- package/templates/apps/mobile/src/components/atoms/TextInput/text-input.component.tsx +5 -5
- package/templates/apps/mobile/src/components/atoms/Typography/index.ts +1 -0
- package/templates/apps/mobile/src/components/atoms/{Text/text.component.tsx → Typography/typography.component.tsx} +1 -1
- package/templates/apps/mobile/src/components/atoms/index.ts +2 -1
- package/templates/apps/mobile/src/components/molecules/BackButton/back-button.component.tsx +4 -4
- package/templates/apps/mobile/src/components/molecules/BottomActionsContainer/BottomActionsContainer.component.tsx +1 -4
- package/templates/apps/mobile/src/components/molecules/ScreenContainer/screen-container.component.tsx +11 -9
- package/templates/apps/mobile/src/components/molecules/ScreenHeader/screen-header.component.tsx +13 -19
- package/templates/apps/mobile/src/components/molecules/StorageManager/StorageManager.component.tsx +1 -3
- package/templates/apps/mobile/src/hooks/index.ts +2 -1
- package/templates/apps/mobile/src/hooks/useToggleDarkMode.hook.tsx +9 -0
- package/templates/apps/mobile/src/routes/index.tsx +3 -3
- package/templates/apps/mobile/src/routes/privateRoutes.tsx +10 -7
- package/templates/apps/mobile/src/routes/publicRoutes.tsx +12 -9
- package/templates/apps/mobile/src/routes/screen-options.ts +0 -1
- package/templates/apps/mobile/src/routes/screens.enum.ts +1 -1
- package/templates/apps/mobile/src/screens/HomeScreen/home.screen.tsx +2 -2
- package/templates/apps/mobile/src/screens/LandingScreen/landing.screen.tsx +37 -0
- package/templates/apps/mobile/src/types/component.type.ts +1 -6
- package/templates/apps/mobile/src/utils/axios.util.ts +10 -0
- package/templates/apps/mobile/src/utils/index.ts +4 -0
- package/templates/apps/mobile/src/utils/log.util.ts +40 -0
- package/templates/apps/mobile/src/utils/route.util.ts +48 -0
- package/templates/apps/mobile/src/components/atoms/Button/outlined-button.component.tsx +0 -59
- package/templates/apps/mobile/src/components/atoms/Text/index.ts +0 -1
- package/templates/apps/mobile/src/screens/LoginScreen/login.screen.tsx +0 -13
package/package.json
CHANGED
package/templates/.eslintrc.json
CHANGED
|
@@ -264,6 +264,7 @@
|
|
|
264
264
|
"extends": ["plugin:@nx/typescript"],
|
|
265
265
|
"rules": {
|
|
266
266
|
"@typescript-eslint/consistent-type-definitions": "off",
|
|
267
|
+
"@typescript-eslint/no-inferrable-types": "off",
|
|
267
268
|
"@typescript-eslint/no-explicit-any": "off",
|
|
268
269
|
"@typescript-eslint/no-use-before-define": "off",
|
|
269
270
|
"@typescript-eslint/no-unused-vars": [
|
package/templates/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
v20.9.0
|
|
@@ -45,7 +45,7 @@ react {
|
|
|
45
45
|
|
|
46
46
|
/* Hermes Commands */
|
|
47
47
|
// The hermes compiler command to run. By default it is 'hermesc'
|
|
48
|
-
// hermesCommand = "
|
|
48
|
+
// hermesCommand = "../../../../node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc"
|
|
49
49
|
//
|
|
50
50
|
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
|
|
51
51
|
// hermesFlags = ["-O", "-output-source-map"]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Add project specific ProGuard rules here.
|
|
2
|
+
# By default, the flags in this file are appended to flags specified
|
|
3
|
+
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
|
|
4
|
+
# You can edit the include path and order by changing the proguardFiles
|
|
5
|
+
# directive in build.gradle.
|
|
6
|
+
#
|
|
7
|
+
# For more details, see
|
|
8
|
+
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
9
|
+
|
|
10
|
+
# Add any project specific keep options here:
|
|
11
|
+
|
|
12
|
+
-keep public class com.dylanvann.fastimage.* {*;}
|
|
13
|
+
-keep public class com.dylanvann.fastimage.** {*;}
|
|
14
|
+
-keep public class * implements com.bumptech.glide.module.GlideModule
|
|
15
|
+
-keep public class * extends com.bumptech.glide.module.AppGlideModule
|
|
16
|
+
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
|
|
17
|
+
**[] $VALUES;
|
|
18
|
+
public *;
|
|
19
|
+
}
|
|
20
|
+
-keep class com.shopify.reactnative.skia.** { *; }
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"version": "0.0.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
|
-
|
|
7
6
|
"android:connect": "adb reverse tcp:8081 tcp:8081",
|
|
8
7
|
"start": "npx nx start mobile --skip-nx-cache",
|
|
9
8
|
"run-ios": "npx nx run-ios mobile --skip-nx-cache --scheme=Dev --simulator='iPhone 13 (A96A9251-28D7-48B1-8F6A-20B6CCB8810B)'",
|
|
@@ -37,6 +36,7 @@
|
|
|
37
36
|
"@react-navigation/native": "*",
|
|
38
37
|
"@react-navigation/routers": "*",
|
|
39
38
|
"@react-navigation/stack": "*",
|
|
39
|
+
"@shopify/react-native-skia": "*",
|
|
40
40
|
"@tanstack/query-async-storage-persister": "*",
|
|
41
41
|
"@tanstack/query-core": "*",
|
|
42
42
|
"@tanstack/query-sync-storage-persister": "*",
|
|
@@ -50,12 +50,14 @@
|
|
|
50
50
|
"jotai-optics": "*",
|
|
51
51
|
"jotai": "*",
|
|
52
52
|
"lodash": "*",
|
|
53
|
+
"lottie-react-native": "*",
|
|
53
54
|
"metro-config": "*",
|
|
54
55
|
"react-hook-form": "*",
|
|
55
56
|
"react-native-dotenv": "*",
|
|
56
57
|
"react-native-fast-image": "*",
|
|
57
58
|
"react-native-gesture-handler": "*",
|
|
58
59
|
"react-native-get-random-values": "*",
|
|
60
|
+
"react-native-haptic-feedback": "*",
|
|
59
61
|
"react-native-keyboard-aware-scroll-view": "*",
|
|
60
62
|
"react-native-mmkv": "*",
|
|
61
63
|
"react-native-modal-datetime-picker": "*",
|
|
@@ -8,6 +8,8 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
|
8
8
|
import 'react-native-get-random-values';
|
|
9
9
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
10
10
|
import { enableFreeze } from 'react-native-screens';
|
|
11
|
+
import { useDeviceContext } from 'twrnc';
|
|
12
|
+
|
|
11
13
|
import 'react-native-url-polyfill/auto';
|
|
12
14
|
|
|
13
15
|
import { StorageManager } from '../components';
|
|
@@ -35,7 +37,11 @@ const persister = createAsyncStoragePersister({
|
|
|
35
37
|
|
|
36
38
|
const persistOptions = { maxAge: CACHE_TIME, persister };
|
|
37
39
|
|
|
38
|
-
function Application()
|
|
40
|
+
function Application() {
|
|
41
|
+
useDeviceContext(tw, {
|
|
42
|
+
initialColorScheme: 'light',
|
|
43
|
+
});
|
|
44
|
+
|
|
39
45
|
return (
|
|
40
46
|
<GestureHandlerRootView style={tw`flex-1`}>
|
|
41
47
|
<SafeAreaProvider>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
3
|
/* eslint-disable no-magic-numbers */
|
|
2
4
|
import {
|
|
3
5
|
BottomSheetBackdropProps,
|
|
@@ -6,7 +8,7 @@ import {
|
|
|
6
8
|
BottomSheetModal,
|
|
7
9
|
BottomSheetScrollView,
|
|
8
10
|
} from '@gorhom/bottom-sheet';
|
|
9
|
-
import React, { FC,
|
|
11
|
+
import React, { FC, RefObject, useCallback, useMemo, useRef, useState } from 'react';
|
|
10
12
|
import { Keyboard, StyleProp, ViewStyle } from 'react-native';
|
|
11
13
|
import { TouchableWithoutFeedback } from 'react-native-gesture-handler';
|
|
12
14
|
import Animated, { Extrapolation, interpolate, useAnimatedStyle } from 'react-native-reanimated';
|
|
@@ -16,7 +18,7 @@ import { DefaultComponentProps } from '../../../types';
|
|
|
16
18
|
|
|
17
19
|
export type BottomSheetProps = DefaultComponentProps & {
|
|
18
20
|
backgroundStyle?: StyleProp<Omit<ViewStyle, 'left' | 'right' | 'position' | 'top' | 'bottom'>>;
|
|
19
|
-
children?: ReactNode;
|
|
21
|
+
children?: React.ReactNode;
|
|
20
22
|
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
21
23
|
enableDismissOnPressBackdrop?: boolean;
|
|
22
24
|
enableDynamicSizing?: boolean;
|
|
@@ -100,6 +102,7 @@ export function BottomSheet(props: BottomSheetProps) {
|
|
|
100
102
|
return (
|
|
101
103
|
<BottomSheetModal
|
|
102
104
|
ref={sheetRef}
|
|
105
|
+
android_keyboardInputMode="adjustResize"
|
|
103
106
|
backdropComponent={renderBackdrop}
|
|
104
107
|
backgroundStyle={[tw`bg-gray-50`, backgroundStyle]}
|
|
105
108
|
enableDynamicSizing={enableDynamicSizing}
|
|
@@ -125,21 +128,20 @@ export function BottomSheet(props: BottomSheetProps) {
|
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
export function useBottomSheet() {
|
|
131
|
+
const [isVisible, setIsVisible] = useState<boolean>(false);
|
|
128
132
|
const sheetRef = useRef<BottomSheetModal>(null);
|
|
129
133
|
|
|
130
134
|
const expandSheet = useCallback(() => {
|
|
131
135
|
Keyboard.dismiss();
|
|
132
136
|
sheetRef.current?.present();
|
|
137
|
+
setIsVisible(true);
|
|
133
138
|
}, []);
|
|
134
139
|
|
|
135
140
|
const closeSheet = useCallback(() => {
|
|
136
141
|
Keyboard.dismiss();
|
|
137
142
|
sheetRef.current?.close();
|
|
143
|
+
setIsVisible(false);
|
|
138
144
|
}, []);
|
|
139
145
|
|
|
140
|
-
return {
|
|
141
|
-
closeSheet,
|
|
142
|
-
expandSheet,
|
|
143
|
-
sheetRef,
|
|
144
|
-
};
|
|
146
|
+
return { closeSheet, expandSheet, isVisible, sheetRef };
|
|
145
147
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './box.component';
|
|
@@ -5,16 +5,17 @@ import {
|
|
|
5
5
|
TextStyle,
|
|
6
6
|
TouchableOpacity,
|
|
7
7
|
TouchableOpacityProps,
|
|
8
|
-
View,
|
|
9
8
|
ViewStyle,
|
|
10
9
|
} from 'react-native';
|
|
11
10
|
|
|
12
11
|
import { colors, disabledInputStyle, tw } from '../../../tailwind';
|
|
13
12
|
import { DefaultComponentProps } from '../../../types/component.type';
|
|
14
|
-
import {
|
|
13
|
+
import { Box } from '../Box';
|
|
14
|
+
import { Typography } from '../Typography';
|
|
15
15
|
|
|
16
16
|
type Props = DefaultComponentProps &
|
|
17
17
|
TouchableOpacityProps & {
|
|
18
|
+
activityIndicatorColor?: string;
|
|
18
19
|
buttonStyle?: StyleProp<ViewStyle>;
|
|
19
20
|
children?: React.ReactNode;
|
|
20
21
|
isLoading?: boolean;
|
|
@@ -24,9 +25,10 @@ type Props = DefaultComponentProps &
|
|
|
24
25
|
|
|
25
26
|
const ACTIVE_OPACITY = 0.5;
|
|
26
27
|
|
|
27
|
-
export function Button(props: Props)
|
|
28
|
+
export function Button(props: Props) {
|
|
28
29
|
const {
|
|
29
30
|
activeOpacity = ACTIVE_OPACITY,
|
|
31
|
+
activityIndicatorColor = colors.white,
|
|
30
32
|
buttonStyle,
|
|
31
33
|
children,
|
|
32
34
|
isDisabled = false,
|
|
@@ -37,19 +39,33 @@ export function Button(props: Props): JSX.Element {
|
|
|
37
39
|
...rest
|
|
38
40
|
} = props;
|
|
39
41
|
const disabled = isDisabled || isLoading;
|
|
40
|
-
const display = children ??
|
|
42
|
+
const display = children ?? (
|
|
43
|
+
<Typography style={[tw`font-medium text-white`, textStyle]}>{title}</Typography>
|
|
44
|
+
);
|
|
41
45
|
|
|
42
46
|
return (
|
|
43
47
|
<TouchableOpacity activeOpacity={activeOpacity} disabled={disabled} style={[style]} {...rest}>
|
|
44
|
-
<
|
|
48
|
+
<Box
|
|
45
49
|
style={[
|
|
46
|
-
tw`bg-primary-700 items-center justify-center rounded-xl p-
|
|
50
|
+
tw`bg-primary-700 items-center justify-center rounded-xl p-3`,
|
|
47
51
|
buttonStyle,
|
|
48
52
|
disabledInputStyle(disabled),
|
|
49
53
|
]}
|
|
50
54
|
>
|
|
51
|
-
{isLoading ? <ActivityIndicator color={
|
|
52
|
-
</
|
|
55
|
+
{isLoading ? <ActivityIndicator color={activityIndicatorColor} /> : display}
|
|
56
|
+
</Box>
|
|
53
57
|
</TouchableOpacity>
|
|
54
58
|
);
|
|
55
59
|
}
|
|
60
|
+
|
|
61
|
+
export function OutlinedButton(props: Props) {
|
|
62
|
+
const { ...rest } = props;
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<Button
|
|
66
|
+
{...rest}
|
|
67
|
+
buttonStyle={tw`border-primary-700 border-2 bg-white`}
|
|
68
|
+
textStyle={tw`text-primary-700`}
|
|
69
|
+
/>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
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
|
|
|
7
7
|
type Props = DefaultComponentProps & {};
|
|
8
8
|
|
|
9
9
|
export function Divider(props: Props) {
|
|
10
10
|
const { style } = props;
|
|
11
11
|
|
|
12
|
-
return <
|
|
12
|
+
return <Box style={[tw`h-[1px] w-full bg-gray-200`, style]}></Box>;
|
|
13
13
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { StyleProp, TextStyle
|
|
2
|
+
import { StyleProp, TextStyle } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { tw } from '../../../tailwind';
|
|
5
5
|
import { DefaultComponentProps } from '../../../types';
|
|
6
|
-
import {
|
|
6
|
+
import { Box } from '../Box';
|
|
7
|
+
import { Typography } from '../Typography';
|
|
7
8
|
|
|
8
9
|
type Props = DefaultComponentProps & {
|
|
9
|
-
children
|
|
10
|
+
children?: React.ReactNode;
|
|
10
11
|
isRequired?: boolean;
|
|
11
12
|
label?: string;
|
|
12
13
|
textStyle?: StyleProp<TextStyle>;
|
|
@@ -16,19 +17,19 @@ export function InputLayout(props: Props) {
|
|
|
16
17
|
const { children, error, isRequired, label, style, textStyle } = props;
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
|
-
<
|
|
20
|
+
<Box style={[style]}>
|
|
20
21
|
{label && (
|
|
21
|
-
<
|
|
22
|
+
<Typography style={[tw`mb-2 text-gray-600`, textStyle]}>
|
|
22
23
|
{label}
|
|
23
|
-
{isRequired && <
|
|
24
|
-
</
|
|
24
|
+
{isRequired && <Typography style={tw`text-red-600`}>{isRequired && '*'}</Typography>}
|
|
25
|
+
</Typography>
|
|
25
26
|
)}
|
|
26
27
|
{children}
|
|
27
28
|
{!!error && (
|
|
28
|
-
<
|
|
29
|
-
<
|
|
30
|
-
</
|
|
29
|
+
<Box style={tw`items-end`}>
|
|
30
|
+
<Typography style={tw`text-right text-red-500`}>{error}</Typography>
|
|
31
|
+
</Box>
|
|
31
32
|
)}
|
|
32
|
-
</
|
|
33
|
+
</Box>
|
|
33
34
|
);
|
|
34
35
|
}
|
package/templates/apps/mobile/src/components/atoms/ListLoadingItem/list-loading-item.component.tsx
CHANGED
|
@@ -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
|
-
<
|
|
17
|
-
<
|
|
16
|
+
<Box style={[style]}>
|
|
17
|
+
<Box style={[tw`gap-2`, style]}>
|
|
18
18
|
<Skeleton isLoading={isLoading}>
|
|
19
|
-
{isLoading && <
|
|
19
|
+
{isLoading && <Box style={tw`h-[100px] w-full`} />}
|
|
20
20
|
</Skeleton>
|
|
21
21
|
<Skeleton isLoading={isLoading}>
|
|
22
|
-
{isLoading && <
|
|
22
|
+
{isLoading && <Box style={tw`h-[100px] w-full`} />}
|
|
23
23
|
</Skeleton>
|
|
24
24
|
<Skeleton isLoading={isLoading}>
|
|
25
|
-
{isLoading && <
|
|
25
|
+
{isLoading && <Box style={tw`h-[100px] w-full`} />}
|
|
26
26
|
</Skeleton>
|
|
27
|
-
</
|
|
28
|
-
</
|
|
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
|
-
<
|
|
37
|
-
<
|
|
36
|
+
<Box style={[style]}>
|
|
37
|
+
<Box style={[tw`flex-row gap-2`, style]}>
|
|
38
38
|
<Skeleton isLoading={isLoading}>
|
|
39
|
-
{isLoading && <
|
|
39
|
+
{isLoading && <Box style={tw`h-[200px] w-[100px]`} />}
|
|
40
40
|
</Skeleton>
|
|
41
41
|
<Skeleton isLoading={isLoading}>
|
|
42
|
-
{isLoading && <
|
|
42
|
+
{isLoading && <Box style={tw`h-[200px] w-[100px]`} />}
|
|
43
43
|
</Skeleton>
|
|
44
44
|
<Skeleton isLoading={isLoading}>
|
|
45
|
-
{isLoading && <
|
|
45
|
+
{isLoading && <Box style={tw`h-[200px] w-[100px]`} />}
|
|
46
46
|
</Skeleton>
|
|
47
47
|
<Skeleton isLoading={isLoading}>
|
|
48
|
-
{isLoading && <
|
|
48
|
+
{isLoading && <Box style={tw`h-[200px] w-[100px]`} />}
|
|
49
49
|
</Skeleton>
|
|
50
50
|
<Skeleton isLoading={isLoading}>
|
|
51
|
-
{isLoading && <
|
|
51
|
+
{isLoading && <Box style={tw`h-[200px] w-[100px]`} />}
|
|
52
52
|
</Skeleton>
|
|
53
|
-
</
|
|
54
|
-
</
|
|
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, {
|
|
4
|
-
import { Keyboard, ModalBaseProps, StyleProp,
|
|
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
|
-
<
|
|
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
|
|
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)
|
|
10
|
+
export function ScreenLoader(props: Props) {
|
|
10
11
|
const { style } = props;
|
|
11
12
|
|
|
12
13
|
return (
|
|
13
|
-
<
|
|
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
|
-
</
|
|
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
|
-
<
|
|
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 {
|
|
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 =
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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
|
|
10
|
+
export function Typography(props: Props): JSX.Element {
|
|
11
11
|
const { numberOfLines = 0, style, ...extraProps } = props;
|
|
12
12
|
|
|
13
13
|
const shouldTruncateTextProps: TextProps =
|