nx-react-native-cli 1.0.19 → 1.1.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.
- package/lib/index.cjs +12 -12
- package/package.json +3 -3
- package/templates/apps/mobile/.eslintrc.json +2 -1
- package/templates/apps/mobile/Gemfile +4 -6
- package/templates/apps/mobile/android/app/build.gradle +4 -3
- package/templates/apps/mobile/android/app/src/main/java/com/appsmobile/MainApplication.kt +43 -0
- package/templates/apps/mobile/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/templates/apps/mobile/android/build.gradle +4 -4
- package/templates/apps/mobile/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/templates/apps/mobile/android/gradle.properties +44 -0
- package/templates/apps/mobile/android/gradlew +249 -0
- package/templates/apps/mobile/android/gradlew.bat +92 -0
- package/templates/apps/mobile/android/settings.gradle +6 -0
- package/templates/apps/mobile/src/components/atoms/Button/button.component.tsx +3 -3
- package/templates/apps/mobile/src/components/atoms/Divider/divider-component.tsx +2 -2
- package/templates/apps/mobile/src/components/atoms/ExcludedEdges/excluded-edges.component.tsx +37 -0
- package/templates/apps/mobile/src/components/atoms/ExcludedEdges/index.ts +1 -0
- package/templates/apps/mobile/src/components/atoms/InputLayout/input-layout.component.tsx +5 -6
- package/templates/apps/mobile/src/components/atoms/KeyboardAwareScrollView/index.ts +1 -0
- package/templates/apps/mobile/src/components/atoms/KeyboardAwareScrollView/keyboard-aware-scroll-view.component.tsx +54 -0
- 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 +2 -3
- package/templates/apps/mobile/src/components/atoms/ScreenLoader/screen-loader.component.tsx +3 -4
- package/templates/apps/mobile/src/components/atoms/Skeleton/skeleton.component.tsx +4 -4
- package/templates/apps/mobile/src/components/atoms/TextInput/text-input.component.tsx +3 -3
- package/templates/apps/mobile/src/components/atoms/index.ts +2 -1
- package/templates/apps/mobile/src/components/molecules/BackButton/back-button.component.tsx +3 -3
- package/templates/apps/mobile/src/components/molecules/ScreenContainer/screen-container.component.tsx +11 -16
- package/templates/apps/mobile/src/components/molecules/ScreenHeader/screen-header.component.tsx +7 -8
- package/templates/apps/mobile/src/screens/LandingScreen/landing.screen.tsx +13 -10
- package/templates/apps/mobile/src/utils/index.ts +0 -1
- package/templates/apps/mobile/src/utils/route.util.ts +1 -1
- package/templates/apps/mobile/tailwind.config.js +1 -1
- package/templates/apps/mobile/src/components/atoms/Box/box.component.tsx +0 -21
- package/templates/apps/mobile/src/components/atoms/Box/index.ts +0 -1
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { StyleProp, TextStyle } from 'react-native';
|
|
2
|
+
import { StyleProp, TextStyle, View } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { tw } from '../../../tailwind';
|
|
5
5
|
import { DefaultComponentProps } from '../../../types';
|
|
6
|
-
import { Box } from '../Box';
|
|
7
6
|
import { Typography } from '../Typography';
|
|
8
7
|
|
|
9
8
|
type Props = DefaultComponentProps & {
|
|
@@ -17,7 +16,7 @@ export function InputLayout(props: Props) {
|
|
|
17
16
|
const { children, error, isRequired, label, style, textStyle } = props;
|
|
18
17
|
|
|
19
18
|
return (
|
|
20
|
-
<
|
|
19
|
+
<View style={[style]}>
|
|
21
20
|
{label && (
|
|
22
21
|
<Typography style={[tw`mb-2 text-gray-600`, textStyle]}>
|
|
23
22
|
{label}
|
|
@@ -26,10 +25,10 @@ export function InputLayout(props: Props) {
|
|
|
26
25
|
)}
|
|
27
26
|
{children}
|
|
28
27
|
{!!error && (
|
|
29
|
-
<
|
|
28
|
+
<View style={tw`items-end`}>
|
|
30
29
|
<Typography style={tw`text-right text-red-500`}>{error}</Typography>
|
|
31
|
-
</
|
|
30
|
+
</View>
|
|
32
31
|
)}
|
|
33
|
-
</
|
|
32
|
+
</View>
|
|
34
33
|
);
|
|
35
34
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './keyboard-aware-scroll-view.component';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { NativeScrollEvent, NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { KeyboardAwareScrollView as RNKeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
|
4
|
+
import Animated from 'react-native-reanimated';
|
|
5
|
+
|
|
6
|
+
import { tw } from '../../../tailwind';
|
|
7
|
+
import { DefaultComponentProps } from '../../../types';
|
|
8
|
+
|
|
9
|
+
type Props = DefaultComponentProps & {
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
scrollViewRef?: React.RefObject<RNKeyboardAwareScrollView>;
|
|
12
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
13
|
+
extraBottomPadding?: number;
|
|
14
|
+
refreshControl?: ReactElement;
|
|
15
|
+
onScroll?: (event: NativeSyntheticEvent<NativeScrollEvent>) => void;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const defaultStyle = tw`grow`;
|
|
19
|
+
|
|
20
|
+
const AnimatedKeyboardAwareScrollView = Animated.createAnimatedComponent(RNKeyboardAwareScrollView);
|
|
21
|
+
|
|
22
|
+
export function KeyboardAwareScrollView(props: Props) {
|
|
23
|
+
const {
|
|
24
|
+
children,
|
|
25
|
+
containerStyle,
|
|
26
|
+
extraBottomPadding,
|
|
27
|
+
onScroll,
|
|
28
|
+
refreshControl,
|
|
29
|
+
scrollViewRef,
|
|
30
|
+
style,
|
|
31
|
+
} = props;
|
|
32
|
+
|
|
33
|
+
const defaultContainerStyle = [
|
|
34
|
+
defaultStyle,
|
|
35
|
+
containerStyle,
|
|
36
|
+
// eslint-disable-next-line no-magic-numbers
|
|
37
|
+
extraBottomPadding && tw`pb-[${extraBottomPadding + 50}px]`,
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<AnimatedKeyboardAwareScrollView
|
|
42
|
+
ref={scrollViewRef}
|
|
43
|
+
contentContainerStyle={[defaultContainerStyle, containerStyle]}
|
|
44
|
+
enableResetScrollToCoords={false}
|
|
45
|
+
keyboardShouldPersistTaps="handled"
|
|
46
|
+
refreshControl={refreshControl}
|
|
47
|
+
scrollEventThrottle={16}
|
|
48
|
+
style={style}
|
|
49
|
+
onScroll={onScroll}
|
|
50
|
+
>
|
|
51
|
+
{children}
|
|
52
|
+
</AnimatedKeyboardAwareScrollView>
|
|
53
|
+
);
|
|
54
|
+
}
|
package/templates/apps/mobile/src/components/atoms/ListLoadingItem/list-loading-item.component.tsx
CHANGED
|
@@ -2,8 +2,8 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { tw } from '../../../tailwind';
|
|
4
4
|
import { DefaultComponentProps } from '../../../types';
|
|
5
|
-
import { Box } from '../Box';
|
|
6
5
|
import { Skeleton } from '../Skeleton';
|
|
6
|
+
import { View } from 'react-native';
|
|
7
7
|
|
|
8
8
|
type Props = DefaultComponentProps & {
|
|
9
9
|
isLoading: boolean;
|
|
@@ -13,19 +13,19 @@ export function ListLoadingItemComponent(props: Props) {
|
|
|
13
13
|
const { isLoading, style } = props;
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
|
-
<
|
|
17
|
-
<
|
|
16
|
+
<View style={[style]}>
|
|
17
|
+
<View style={[tw`gap-2`, style]}>
|
|
18
18
|
<Skeleton isLoading={isLoading}>
|
|
19
|
-
{isLoading && <
|
|
19
|
+
{isLoading && <View style={tw`h-[100px] w-full`} />}
|
|
20
20
|
</Skeleton>
|
|
21
21
|
<Skeleton isLoading={isLoading}>
|
|
22
|
-
{isLoading && <
|
|
22
|
+
{isLoading && <View style={tw`h-[100px] w-full`} />}
|
|
23
23
|
</Skeleton>
|
|
24
24
|
<Skeleton isLoading={isLoading}>
|
|
25
|
-
{isLoading && <
|
|
25
|
+
{isLoading && <View style={tw`h-[100px] w-full`} />}
|
|
26
26
|
</Skeleton>
|
|
27
|
-
</
|
|
28
|
-
</
|
|
27
|
+
</View>
|
|
28
|
+
</View>
|
|
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
|
+
<View style={[style]}>
|
|
37
|
+
<View style={[tw`flex-row gap-2`, style]}>
|
|
38
38
|
<Skeleton isLoading={isLoading}>
|
|
39
|
-
{isLoading && <
|
|
39
|
+
{isLoading && <View style={tw`h-[200px] w-[100px]`} />}
|
|
40
40
|
</Skeleton>
|
|
41
41
|
<Skeleton isLoading={isLoading}>
|
|
42
|
-
{isLoading && <
|
|
42
|
+
{isLoading && <View style={tw`h-[200px] w-[100px]`} />}
|
|
43
43
|
</Skeleton>
|
|
44
44
|
<Skeleton isLoading={isLoading}>
|
|
45
|
-
{isLoading && <
|
|
45
|
+
{isLoading && <View style={tw`h-[200px] w-[100px]`} />}
|
|
46
46
|
</Skeleton>
|
|
47
47
|
<Skeleton isLoading={isLoading}>
|
|
48
|
-
{isLoading && <
|
|
48
|
+
{isLoading && <View style={tw`h-[200px] w-[100px]`} />}
|
|
49
49
|
</Skeleton>
|
|
50
50
|
<Skeleton isLoading={isLoading}>
|
|
51
|
-
{isLoading && <
|
|
51
|
+
{isLoading && <View style={tw`h-[200px] w-[100px]`} />}
|
|
52
52
|
</Skeleton>
|
|
53
|
-
</
|
|
54
|
-
</
|
|
53
|
+
</View>
|
|
54
|
+
</View>
|
|
55
55
|
);
|
|
56
56
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/* eslint-disable no-magic-numbers */
|
|
2
2
|
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
3
3
|
import React, { useCallback, useState } from 'react';
|
|
4
|
-
import { Keyboard, ModalBaseProps, StyleProp, ViewStyle } from 'react-native';
|
|
4
|
+
import { Keyboard, ModalBaseProps, StyleProp, View, 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';
|
|
10
9
|
|
|
11
10
|
export type ModalProps = DefaultComponentProps &
|
|
12
11
|
ModalBaseProps & {
|
|
@@ -32,7 +31,7 @@ export function Modal(props: ModalProps) {
|
|
|
32
31
|
onBackdropPress={onBackdropPress}
|
|
33
32
|
>
|
|
34
33
|
<BottomSheetModalProvider>
|
|
35
|
-
<
|
|
34
|
+
<View style={[tw`px-4`, containerStyle]}>{children}</View>
|
|
36
35
|
</BottomSheetModalProvider>
|
|
37
36
|
</RNModal>
|
|
38
37
|
);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ActivityIndicator } from 'react-native';
|
|
2
|
+
import { ActivityIndicator, View } 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';
|
|
7
6
|
|
|
8
7
|
type Props = DefaultComponentProps;
|
|
9
8
|
|
|
@@ -11,8 +10,8 @@ export function ScreenLoader(props: Props) {
|
|
|
11
10
|
const { style } = props;
|
|
12
11
|
|
|
13
12
|
return (
|
|
14
|
-
<
|
|
13
|
+
<View style={[tw`h-full w-full items-center justify-center bg-gray-50 p-8`, style]}>
|
|
15
14
|
<ActivityIndicator color={colors.primary[400]} />
|
|
16
|
-
</
|
|
15
|
+
</View>
|
|
17
16
|
);
|
|
18
17
|
}
|
|
@@ -6,11 +6,11 @@ import Animated, {
|
|
|
6
6
|
withTiming,
|
|
7
7
|
} from 'react-native-reanimated';
|
|
8
8
|
|
|
9
|
+
import { View } from 'react-native';
|
|
9
10
|
import { tw } from '../../../tailwind';
|
|
10
|
-
import { Box } from '../Box';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
children
|
|
12
|
+
type Props = {
|
|
13
|
+
children?: React.ReactNode;
|
|
14
14
|
isLoading: boolean;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -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
|
+
<View style={tw`opacity-0`}>{children}</View>
|
|
40
40
|
</Animated.View>
|
|
41
41
|
);
|
|
42
42
|
}
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
TextInputProps as RNTextInputProps,
|
|
5
5
|
StyleProp,
|
|
6
6
|
TextStyle,
|
|
7
|
+
View,
|
|
7
8
|
} from 'react-native';
|
|
8
9
|
|
|
9
10
|
import {
|
|
@@ -14,7 +15,6 @@ import {
|
|
|
14
15
|
focusedInputStyle,
|
|
15
16
|
} from '../../../tailwind';
|
|
16
17
|
import { DefaultComponentProps } from '../../../types';
|
|
17
|
-
import { Box } from '../Box';
|
|
18
18
|
|
|
19
19
|
import { DefaultNameInputProps, DefaultTextAreaInputProps } from './constants';
|
|
20
20
|
|
|
@@ -62,7 +62,7 @@ export function TextInput(props: TextInputProps) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
return (
|
|
65
|
-
<
|
|
65
|
+
<View
|
|
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
|
+
</View>
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -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,6 +6,7 @@ import {
|
|
|
6
6
|
PressableProps,
|
|
7
7
|
StyleProp,
|
|
8
8
|
TouchableOpacity,
|
|
9
|
+
View,
|
|
9
10
|
ViewStyle,
|
|
10
11
|
} from 'react-native';
|
|
11
12
|
|
|
@@ -14,7 +15,6 @@ import { ArrowLeftIcon } from '../../../icons';
|
|
|
14
15
|
import { Screens } from '../../../routes';
|
|
15
16
|
import { tw } from '../../../tailwind';
|
|
16
17
|
import { DefaultComponentProps } from '../../../types/component.type';
|
|
17
|
-
import { Box } from '../../atoms';
|
|
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
|
-
<
|
|
53
|
+
<View style={[tw`flex-1 items-center justify-center rounded-full`, style]}>
|
|
54
54
|
<ArrowLeftIcon style={tw`text-gray-950`} />
|
|
55
|
-
</
|
|
55
|
+
</View>
|
|
56
56
|
</TouchableOpacity>
|
|
57
57
|
);
|
|
58
58
|
}
|
|
@@ -6,18 +6,18 @@ import {
|
|
|
6
6
|
Platform,
|
|
7
7
|
StatusBar,
|
|
8
8
|
StyleProp,
|
|
9
|
+
View,
|
|
9
10
|
ViewStyle,
|
|
10
11
|
} from 'react-native';
|
|
11
|
-
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
|
12
|
-
import Animated from 'react-native-reanimated';
|
|
12
|
+
import { KeyboardAwareScrollView as RNKeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
|
13
13
|
import { Edge, SafeAreaProviderProps, SafeAreaView } from 'react-native-safe-area-context';
|
|
14
14
|
|
|
15
15
|
import CONFIG from '../../../config';
|
|
16
16
|
import { tw } from '../../../tailwind';
|
|
17
|
-
import {
|
|
17
|
+
import { KeyboardAwareScrollView } from '../../atoms';
|
|
18
18
|
|
|
19
19
|
type Props = SafeAreaProviderProps & {
|
|
20
|
-
scrollViewRef?: React.RefObject<
|
|
20
|
+
scrollViewRef?: React.RefObject<RNKeyboardAwareScrollView>;
|
|
21
21
|
containerStyle?: StyleProp<ViewStyle>;
|
|
22
22
|
excludedEdges?: Edge[];
|
|
23
23
|
extraBottomPadding?: number;
|
|
@@ -37,18 +37,16 @@ const safeAreaViewEdges: Edge[] = Platform.select({
|
|
|
37
37
|
ios: ['top', 'left', 'right', 'bottom'],
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
const AnimatedKeyboardAwareScrollView = Animated.createAnimatedComponent(KeyboardAwareScrollView);
|
|
41
|
-
|
|
42
40
|
export function ScreenContainer(props: Props) {
|
|
43
41
|
const {
|
|
44
42
|
children,
|
|
45
|
-
scrollViewRef,
|
|
46
43
|
containerStyle,
|
|
47
44
|
excludedEdges = [],
|
|
48
45
|
extraBottomPadding = 0,
|
|
49
46
|
hasScroll = true,
|
|
50
47
|
onScroll,
|
|
51
48
|
refreshControl,
|
|
49
|
+
scrollViewRef,
|
|
52
50
|
shouldBeTranslucent = false,
|
|
53
51
|
shouldShowStatusBar = true,
|
|
54
52
|
statusBarColor = 'transparent',
|
|
@@ -81,21 +79,18 @@ export function ScreenContainer(props: Props) {
|
|
|
81
79
|
];
|
|
82
80
|
|
|
83
81
|
return (
|
|
84
|
-
<SafeAreaView edges={edges} style={[tw`flex-1 bg-gray-50
|
|
82
|
+
<SafeAreaView edges={edges} style={[tw`flex-1 bg-gray-50`, style]}>
|
|
85
83
|
{hasScroll ? (
|
|
86
|
-
<
|
|
87
|
-
|
|
88
|
-
contentContainerStyle={defaultContainerStyle}
|
|
89
|
-
enableResetScrollToCoords={false}
|
|
90
|
-
keyboardShouldPersistTaps="handled"
|
|
84
|
+
<KeyboardAwareScrollView
|
|
85
|
+
containerStyle={defaultContainerStyle}
|
|
91
86
|
refreshControl={refreshControl}
|
|
92
|
-
|
|
87
|
+
scrollViewRef={scrollViewRef}
|
|
93
88
|
onScroll={onScroll}
|
|
94
89
|
>
|
|
95
90
|
{children}
|
|
96
|
-
</
|
|
91
|
+
</KeyboardAwareScrollView>
|
|
97
92
|
) : (
|
|
98
|
-
<
|
|
93
|
+
<View style={defaultContainerStyle}>{children}</View>
|
|
99
94
|
)}
|
|
100
95
|
</SafeAreaView>
|
|
101
96
|
);
|
package/templates/apps/mobile/src/components/molecules/ScreenHeader/screen-header.component.tsx
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
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
4
|
import { GearIcon } from '../../../icons';
|
|
5
5
|
import { tw } from '../../../tailwind';
|
|
6
6
|
import { DefaultComponentProps } from '../../../types/component.type';
|
|
7
|
-
import { Box } from '../../atoms';
|
|
8
7
|
import { Typography } from '../../atoms/Typography';
|
|
9
8
|
import { BackButton } from '../BackButton';
|
|
10
9
|
|
|
@@ -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
|
-
<
|
|
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
|
-
</
|
|
44
|
+
</View>
|
|
46
45
|
</TouchableOpacity>
|
|
47
46
|
);
|
|
48
47
|
|
|
49
48
|
return (
|
|
50
|
-
<
|
|
51
|
-
<
|
|
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
|
-
</
|
|
63
|
-
</
|
|
61
|
+
</View>
|
|
62
|
+
</View>
|
|
64
63
|
);
|
|
65
64
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
+
import { View } from 'react-native';
|
|
3
4
|
import {
|
|
4
5
|
BottomSheet,
|
|
5
|
-
Box,
|
|
6
6
|
Button,
|
|
7
7
|
OutlinedButton,
|
|
8
8
|
ScreenContainer,
|
|
@@ -10,27 +10,30 @@ import {
|
|
|
10
10
|
Typography,
|
|
11
11
|
useBottomSheet,
|
|
12
12
|
} from '../../components';
|
|
13
|
-
import { useToggleDarkMode } from '../../hooks';
|
|
14
13
|
import { PublicScreenProps, Screens } from '../../routes';
|
|
15
14
|
import { tw } from '../../tailwind';
|
|
15
|
+
import { toast } from '../../utils';
|
|
16
16
|
|
|
17
17
|
export function LandingScreen(props: PublicScreenProps<Screens.LANDING>) {
|
|
18
|
-
const toggleDarkMode = useToggleDarkMode();
|
|
19
18
|
const { expandSheet, sheetRef } = useBottomSheet();
|
|
20
19
|
|
|
20
|
+
function toastHi() {
|
|
21
|
+
toast('Hi!')
|
|
22
|
+
}
|
|
23
|
+
|
|
21
24
|
return (
|
|
22
25
|
<ScreenContainer>
|
|
23
|
-
<ScreenHeader title="Landing" onExtraActionPress={
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
+
<ScreenHeader title="Landing" onExtraActionPress={toastHi} />
|
|
27
|
+
<View style={tw`mx-4`}>
|
|
28
|
+
<View row style={tw`gap-2`}>
|
|
26
29
|
<Button title="Show Bottom Sheet" onPress={expandSheet} />
|
|
27
30
|
<OutlinedButton title="Login" />
|
|
28
|
-
</
|
|
29
|
-
</
|
|
31
|
+
</View>
|
|
32
|
+
</View>
|
|
30
33
|
<BottomSheet sheetRef={sheetRef}>
|
|
31
|
-
<
|
|
34
|
+
<View>
|
|
32
35
|
<Typography>Bottom Sheet</Typography>
|
|
33
|
-
</
|
|
36
|
+
</View>
|
|
34
37
|
</BottomSheet>
|
|
35
38
|
</ScreenContainer>
|
|
36
39
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable max-params */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
import { CommonActions, NavigationState, ParamListBase
|
|
3
|
+
import { CommonActions, NavigationState, ParamListBase } from '@react-navigation/native';
|
|
4
4
|
|
|
5
5
|
export function getPreviousRouteName(navigationState: NavigationState<ParamListBase>) {
|
|
6
6
|
const routes = navigationState.routes;
|
|
@@ -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';
|