app-expo-cli 1.0.5 → 1.0.7
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/README.md +11 -5
- package/package.json +1 -1
- package/src/copy-template.js +19 -1
- package/src/install-deps.js +6 -0
- package/template/assets/fonts/Inter_18pt-Black.ttf +0 -0
- package/template/assets/fonts/Inter_18pt-BlackItalic.ttf +0 -0
- package/template/assets/icon/index.ts +146 -0
- package/template/assets/images/about_us.png +0 -0
- package/template/assets/images/index.ts +6 -0
- package/template/assets/images/logo.png +0 -0
- package/template/assets/images/privacy_policy.png +0 -0
- package/template/assets/images/terms_and_conditions.png +0 -0
- package/template/src/app/_layout.tsx +3 -3
- package/template/src/app/auth/change_pass.tsx +18 -15
- package/template/src/app/auth/change_pass_modal.tsx +32 -51
- package/template/src/app/auth/forgot.tsx +74 -88
- package/template/src/app/auth/index.tsx +161 -192
- package/template/src/app/auth/opt_verify.tsx +93 -103
- package/template/src/app/auth/register.tsx +198 -260
- package/template/src/app/auth/reset_pass.tsx +102 -105
- package/template/src/app/index.tsx +70 -7
- package/template/src/app/modals/confirmation_logout_modal.tsx +0 -5
- package/template/src/app/modals/success_modal.tsx +28 -48
- package/template/src/app/settings/about_us.tsx +1 -1
- package/template/src/app/settings/privacy_policy.tsx +1 -1
- package/template/src/app/settings/terms_and_conditions.tsx +1 -1
- package/template/src/lib/DateTimePicker/DateTimePicker.tsx +63 -0
- package/template/src/lib/Empty/EmptyCard.tsx +67 -0
- package/template/src/lib/Error/GlobalErrorBoundary.tsx +111 -0
- package/template/src/lib/animate/AniImage.tsx +32 -0
- package/template/src/lib/backHeader/BackButton.tsx +62 -0
- package/template/src/lib/backHeader/BackWithCoponent.tsx +112 -0
- package/template/src/lib/backHeader/BackWithHeader.tsx +46 -0
- package/template/src/lib/backHeader/BackWithTitle.tsx +53 -0
- package/template/src/lib/buttons/IButton.tsx +69 -0
- package/template/src/lib/buttons/IwtButton.tsx +199 -0
- package/template/src/lib/buttons/Or.tsx +27 -0
- package/template/src/lib/buttons/SimpleButton.tsx +45 -0
- package/template/src/lib/buttons/TButton.tsx +70 -0
- package/template/src/lib/cards/Card.tsx +175 -0
- package/template/src/lib/cards/OptionSelect.tsx +44 -0
- package/template/src/lib/cards/SearchCard.tsx +35 -0
- package/template/src/lib/editor/TextEditor.tsx +81 -0
- package/template/src/lib/expend/ExpendComponent.tsx +36 -0
- package/template/src/lib/imageViewer/ImageViwer.tsx +332 -0
- package/template/src/lib/imageZoomer/ImageZoomer.tsx +104 -0
- package/template/src/lib/inputs/CheckBox.tsx +86 -0
- package/template/src/lib/inputs/InputText.tsx +232 -0
- package/template/src/lib/loader/GLoading.tsx +26 -0
- package/template/src/lib/loading/MLoading.tsx +14 -0
- package/template/src/lib/loading/SLoading.tsx +14 -0
- package/template/src/lib/modals/ActionModal.tsx +97 -0
- package/template/src/lib/modals/BottomModal.tsx +224 -0
- package/template/src/lib/modals/ConfrimationModal.tsx +116 -0
- package/template/src/lib/modals/DateModal.tsx +152 -0
- package/template/src/lib/modals/NormalModal.tsx +73 -0
- package/template/src/lib/modals/SideModal.tsx +57 -0
- package/template/src/lib/modals/Toaster.tsx +256 -0
- package/template/src/lib/payment/PaymentCardForD.tsx +47 -0
- package/template/src/lib/progressBar/ProgressBar.tsx +64 -0
- package/template/src/lib/tailwind.js +9 -0
- package/template/src/lib/ui/Avatar.tsx +55 -0
- package/template/src/redux/api-config/baseApi.ts +0 -22
- package/template/src/redux/interface/interface.ts +11 -193
- package/template/src/redux/store.ts +2 -2
- package/template/src/app/home/_layout.tsx +0 -29
- package/template/src/app/home/drawer/_layout.tsx +0 -27
- package/template/src/app/home/tabs/_layout.tsx +0 -75
- package/template/src/app/home/tabs/index.tsx +0 -11
- package/template/src/app/modals/payment_modal.tsx +0 -105
- package/template/src/hooks/useCheckLocation.ts +0 -36
- package/template/src/hooks/useDocPicker.ts +0 -83
- package/template/src/hooks/useSuggestionLocation.ts +0 -36
- package/template/src/hooks/useUploadProgress.ts +0 -127
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Text, TouchableOpacity, View } from "react-native";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import tw from "../tailwind";
|
|
5
|
+
|
|
6
|
+
export default class GlobalErrorBoundary extends React.Component {
|
|
7
|
+
constructor(props = {}) {
|
|
8
|
+
super(props);
|
|
9
|
+
this.state = { hasError: false, error: null } as any;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
static getDerivedStateFromError(error = null) {
|
|
13
|
+
return { hasError: true, error };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
componentDidCatch(error, info) {
|
|
17
|
+
console.log("GLOBAL ERROR:", error, info);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
resetError = () => {
|
|
21
|
+
this.setState({ hasError: false, error: null });
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
render() {
|
|
25
|
+
if (this.state.hasError) {
|
|
26
|
+
return (
|
|
27
|
+
<View
|
|
28
|
+
style={{
|
|
29
|
+
flex: 1,
|
|
30
|
+
justifyContent: "center",
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
padding: 24,
|
|
33
|
+
backgroundColor: tw.color("base"),
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
{/* Error Illustration */}
|
|
37
|
+
<View
|
|
38
|
+
style={{
|
|
39
|
+
width: 120,
|
|
40
|
+
height: 120,
|
|
41
|
+
borderRadius: 60,
|
|
42
|
+
backgroundColor: "#FFE5E0",
|
|
43
|
+
justifyContent: "center",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
marginBottom: 25,
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
<Text style={{ fontSize: 55 }}>⚠️</Text>
|
|
49
|
+
</View>
|
|
50
|
+
|
|
51
|
+
{/* Title */}
|
|
52
|
+
<Text
|
|
53
|
+
style={{
|
|
54
|
+
fontSize: 22,
|
|
55
|
+
fontWeight: "700",
|
|
56
|
+
color: "#333",
|
|
57
|
+
textAlign: "center",
|
|
58
|
+
marginBottom: 10,
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
Something went wrong
|
|
62
|
+
</Text>
|
|
63
|
+
|
|
64
|
+
{/* Subtitle */}
|
|
65
|
+
<Text
|
|
66
|
+
style={{
|
|
67
|
+
fontSize: 15,
|
|
68
|
+
color: "#666",
|
|
69
|
+
textAlign: "center",
|
|
70
|
+
marginBottom: 30,
|
|
71
|
+
lineHeight: 20,
|
|
72
|
+
width: "85%",
|
|
73
|
+
}}
|
|
74
|
+
>
|
|
75
|
+
An unexpected error occurred. Please try again or restart the app.
|
|
76
|
+
</Text>
|
|
77
|
+
|
|
78
|
+
{/* Button */}
|
|
79
|
+
<TouchableOpacity
|
|
80
|
+
onPress={this.resetError}
|
|
81
|
+
style={{
|
|
82
|
+
backgroundColor: "#ED6237",
|
|
83
|
+
paddingVertical: 12,
|
|
84
|
+
paddingHorizontal: 28,
|
|
85
|
+
borderRadius: 10,
|
|
86
|
+
shadowColor: "#000",
|
|
87
|
+
shadowOpacity: 0.1,
|
|
88
|
+
shadowRadius: 4,
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
<Text
|
|
92
|
+
style={{
|
|
93
|
+
color: "#fff",
|
|
94
|
+
fontSize: 16,
|
|
95
|
+
fontWeight: "600",
|
|
96
|
+
}}
|
|
97
|
+
>
|
|
98
|
+
Try Again
|
|
99
|
+
</Text>
|
|
100
|
+
</TouchableOpacity>
|
|
101
|
+
</View>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return this.props.children;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const GlobalErrorBoundaryProvider = ({ children }: any) => {
|
|
110
|
+
return <GlobalErrorBoundary>{children}</GlobalErrorBoundary>;
|
|
111
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ActivityIndicator } from "react-native";
|
|
2
|
+
import { AnimatedImage } from "react-native-ui-lib";
|
|
3
|
+
import { AnimatedImageProps } from "react-native-ui-lib/src/components/animatedImage";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import tw from "../tailwind";
|
|
6
|
+
|
|
7
|
+
interface IAniImage extends AnimatedImageProps {
|
|
8
|
+
source: { uri: string };
|
|
9
|
+
containerStyle?: any;
|
|
10
|
+
imageStyle?: any;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const AniImage = ({
|
|
14
|
+
source,
|
|
15
|
+
containerStyle,
|
|
16
|
+
imageStyle,
|
|
17
|
+
...props
|
|
18
|
+
}: IAniImage) => {
|
|
19
|
+
return (
|
|
20
|
+
<AnimatedImage
|
|
21
|
+
containerStyle={[tw` items-center rounded-md`, containerStyle]}
|
|
22
|
+
errorSource={source}
|
|
23
|
+
animationDuration={500}
|
|
24
|
+
style={[tw` rounded-md`, imageStyle]}
|
|
25
|
+
loader={<ActivityIndicator color="white" size={"small"} />}
|
|
26
|
+
source={source}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default AniImage;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Text, TouchableOpacity, View } from "react-native";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { SvgXml } from "react-native-svg";
|
|
5
|
+
import tw from "../tailwind";
|
|
6
|
+
|
|
7
|
+
interface BackButtonProps {
|
|
8
|
+
onPress?: () => void;
|
|
9
|
+
titleStyle?: any;
|
|
10
|
+
title?: any;
|
|
11
|
+
containerStyle?: any;
|
|
12
|
+
buttonStyle?: any;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const BackButton = ({
|
|
16
|
+
onPress,
|
|
17
|
+
containerStyle,
|
|
18
|
+
titleStyle,
|
|
19
|
+
title,
|
|
20
|
+
buttonStyle,
|
|
21
|
+
}: BackButtonProps) => {
|
|
22
|
+
return (
|
|
23
|
+
<TouchableOpacity
|
|
24
|
+
activeOpacity={0.5}
|
|
25
|
+
onPress={onPress}
|
|
26
|
+
style={[
|
|
27
|
+
tw` flex-row px-4 pt-4 pb-3 items-center gap-2 `,
|
|
28
|
+
containerStyle,
|
|
29
|
+
]}
|
|
30
|
+
>
|
|
31
|
+
<TouchableOpacity
|
|
32
|
+
onPress={onPress}
|
|
33
|
+
style={tw`flex-row items-center gap-3 `}
|
|
34
|
+
>
|
|
35
|
+
<View
|
|
36
|
+
style={[
|
|
37
|
+
tw`bg-[#3D3D3D] w-12 h-12 justify-center items-center rounded-full `,
|
|
38
|
+
buttonStyle,
|
|
39
|
+
]}
|
|
40
|
+
>
|
|
41
|
+
<SvgXml
|
|
42
|
+
xml={`<svg width="12" height="18" viewBox="0 0 12 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
43
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.477124 9.99984L9.69575 18L12 16.0003L3.9335 9L12 1.99969L9.69575 0L0.477124 8.00016C0.171621 8.26536 0 8.625 0 9C0 9.375 0.171621 9.73464 0.477124 9.99984Z" fill="white"/>
|
|
44
|
+
</svg>
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
`}
|
|
49
|
+
/>
|
|
50
|
+
</View>
|
|
51
|
+
<Text
|
|
52
|
+
numberOfLines={1}
|
|
53
|
+
style={[tw`text-white font-InterSemiBold text-base`, titleStyle]}
|
|
54
|
+
>
|
|
55
|
+
{title ? title : null}
|
|
56
|
+
</Text>
|
|
57
|
+
</TouchableOpacity>
|
|
58
|
+
</TouchableOpacity>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default BackButton;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Platform, Text, TouchableOpacity, View } from "react-native";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { SvgXml } from "react-native-svg";
|
|
5
|
+
import tw from "../tailwind";
|
|
6
|
+
|
|
7
|
+
interface BackButtonProps {
|
|
8
|
+
onPress?: () => void;
|
|
9
|
+
titleStyle?: any;
|
|
10
|
+
title?: any;
|
|
11
|
+
containerStyle?: any;
|
|
12
|
+
ComponentBtn?: React.ReactNode;
|
|
13
|
+
offBack?: boolean;
|
|
14
|
+
togather?: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const BackWithComponent = ({
|
|
18
|
+
onPress,
|
|
19
|
+
containerStyle,
|
|
20
|
+
titleStyle,
|
|
21
|
+
ComponentBtn,
|
|
22
|
+
title,
|
|
23
|
+
offBack,
|
|
24
|
+
togather,
|
|
25
|
+
}: BackButtonProps) => {
|
|
26
|
+
return (
|
|
27
|
+
<View
|
|
28
|
+
style={[
|
|
29
|
+
tw`flex-row items-center justify-between gap-2 `,
|
|
30
|
+
containerStyle,
|
|
31
|
+
{
|
|
32
|
+
paddingTop: Platform.OS === "android" ? 5 : 0,
|
|
33
|
+
// paddingBottom: 5,
|
|
34
|
+
},
|
|
35
|
+
]}
|
|
36
|
+
>
|
|
37
|
+
{!togather ? (
|
|
38
|
+
<>
|
|
39
|
+
{!offBack ? (
|
|
40
|
+
<TouchableOpacity
|
|
41
|
+
onPress={onPress}
|
|
42
|
+
style={tw`flex-row items-center gap-3 `}
|
|
43
|
+
>
|
|
44
|
+
<View
|
|
45
|
+
style={tw`bg-[#3D3D3D] w-12 h-12 justify-center items-center rounded-full`}
|
|
46
|
+
>
|
|
47
|
+
<SvgXml
|
|
48
|
+
xml={`<svg width="12" height="18" viewBox="0 0 12 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
49
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.477124 9.99984L9.69575 18L12 16.0003L3.9335 9L12 1.99969L9.69575 0L0.477124 8.00016C0.171621 8.26536 0 8.625 0 9C0 9.375 0.171621 9.73464 0.477124 9.99984Z" fill="white"/>
|
|
50
|
+
</svg>
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
`}
|
|
55
|
+
/>
|
|
56
|
+
</View>
|
|
57
|
+
</TouchableOpacity>
|
|
58
|
+
) : (
|
|
59
|
+
title && <View style={tw`w-10 h-10`} />
|
|
60
|
+
)}
|
|
61
|
+
<Text
|
|
62
|
+
numberOfLines={1}
|
|
63
|
+
style={[tw`text-white font-InterBold text-base`, titleStyle]}
|
|
64
|
+
>
|
|
65
|
+
{title}
|
|
66
|
+
</Text>
|
|
67
|
+
</>
|
|
68
|
+
) : (
|
|
69
|
+
<>
|
|
70
|
+
{!offBack ? (
|
|
71
|
+
<TouchableOpacity
|
|
72
|
+
activeOpacity={0.5}
|
|
73
|
+
onPress={onPress}
|
|
74
|
+
style={[tw` flex-row pl-4 items-center gap-2 `, containerStyle]}
|
|
75
|
+
>
|
|
76
|
+
<TouchableOpacity
|
|
77
|
+
onPress={onPress}
|
|
78
|
+
style={tw`flex-row items-center gap-3 `}
|
|
79
|
+
>
|
|
80
|
+
<View
|
|
81
|
+
style={tw`bg-[#3D3D3D] w-12 h-12 justify-center items-center rounded-full`}
|
|
82
|
+
>
|
|
83
|
+
<SvgXml
|
|
84
|
+
xml={`<svg width="12" height="18" viewBox="0 0 12 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
85
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.477124 9.99984L9.69575 18L12 16.0003L3.9335 9L12 1.99969L9.69575 0L0.477124 8.00016C0.171621 8.26536 0 8.625 0 9C0 9.375 0.171621 9.73464 0.477124 9.99984Z" fill="white"/>
|
|
86
|
+
</svg>
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
`}
|
|
91
|
+
/>
|
|
92
|
+
</View>
|
|
93
|
+
<Text
|
|
94
|
+
numberOfLines={1}
|
|
95
|
+
style={[tw`text-white font-InterBold text-base`, titleStyle]}
|
|
96
|
+
>
|
|
97
|
+
{title ? title : null}
|
|
98
|
+
</Text>
|
|
99
|
+
</TouchableOpacity>
|
|
100
|
+
</TouchableOpacity>
|
|
101
|
+
) : (
|
|
102
|
+
<View style={tw`w-10 h-10`} />
|
|
103
|
+
)}
|
|
104
|
+
</>
|
|
105
|
+
)}
|
|
106
|
+
|
|
107
|
+
{ComponentBtn ? ComponentBtn : null}
|
|
108
|
+
</View>
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export default BackWithComponent;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Platform, Text, TouchableOpacity, View } from "react-native";
|
|
2
|
+
|
|
3
|
+
import { IconRightArrayGray } from "../../icons/icons";
|
|
4
|
+
import { NavigProps } from "../../interfaces/NaviProps";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { SvgXml } from "react-native-svg";
|
|
7
|
+
import tw from "../tailwind";
|
|
8
|
+
|
|
9
|
+
interface IBackWithHeader extends NavigProps<null> {
|
|
10
|
+
svgIcon?: any;
|
|
11
|
+
title?: string;
|
|
12
|
+
titleStyle?: any;
|
|
13
|
+
containerStyle?: any;
|
|
14
|
+
offBack?: boolean;
|
|
15
|
+
}
|
|
16
|
+
const BackWithHeader = ({
|
|
17
|
+
navigation,
|
|
18
|
+
svgIcon,
|
|
19
|
+
title,
|
|
20
|
+
titleStyle,
|
|
21
|
+
containerStyle,
|
|
22
|
+
offBack,
|
|
23
|
+
}: IBackWithHeader) => {
|
|
24
|
+
return (
|
|
25
|
+
<View
|
|
26
|
+
style={[
|
|
27
|
+
tw`px-[4%] ${
|
|
28
|
+
Platform.OS === "android" ? "pt-5" : "pt-0"
|
|
29
|
+
} pb-4 flex-row gap-3 items-center`,
|
|
30
|
+
containerStyle,
|
|
31
|
+
]}
|
|
32
|
+
>
|
|
33
|
+
{!offBack && (
|
|
34
|
+
<TouchableOpacity onPress={() => navigation?.goBack()}>
|
|
35
|
+
<SvgXml xml={svgIcon || IconRightArrayGray} />
|
|
36
|
+
</TouchableOpacity>
|
|
37
|
+
)}
|
|
38
|
+
|
|
39
|
+
<Text style={[tw`text-base text-white200 font-RobotoBlack `, titleStyle]}>
|
|
40
|
+
{title}
|
|
41
|
+
</Text>
|
|
42
|
+
</View>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default React.memo(BackWithHeader);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Text, TouchableOpacity, View } from "react-native";
|
|
2
|
+
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { SvgXml } from "react-native-svg";
|
|
5
|
+
import tw from "../tailwind";
|
|
6
|
+
|
|
7
|
+
interface BackWithTitleProps {
|
|
8
|
+
onPress?: () => void;
|
|
9
|
+
title: string;
|
|
10
|
+
titleStyle?: any;
|
|
11
|
+
containerStyle?: any;
|
|
12
|
+
backOff?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const BackWithTitle = ({
|
|
16
|
+
onPress,
|
|
17
|
+
title,
|
|
18
|
+
containerStyle,
|
|
19
|
+
titleStyle,
|
|
20
|
+
backOff,
|
|
21
|
+
}: BackWithTitleProps) => {
|
|
22
|
+
return (
|
|
23
|
+
<TouchableOpacity
|
|
24
|
+
activeOpacity={0.5}
|
|
25
|
+
onPress={onPress}
|
|
26
|
+
style={[tw`flex-row items-center gap-3 p-[4%]`, containerStyle]}
|
|
27
|
+
>
|
|
28
|
+
<View
|
|
29
|
+
style={tw`bg-[#3D3D3D] w-12 h-12 justify-center items-center rounded-full`}
|
|
30
|
+
>
|
|
31
|
+
<SvgXml
|
|
32
|
+
xml={`<svg width="12" height="18" viewBox="0 0 12 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
33
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.477124 9.99984L9.69575 18L12 16.0003L3.9335 9L12 1.99969L9.69575 0L0.477124 8.00016C0.171621 8.26536 0 8.625 0 9C0 9.375 0.171621 9.73464 0.477124 9.99984Z" fill="white"/>
|
|
34
|
+
</svg>
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
`}
|
|
39
|
+
/>
|
|
40
|
+
</View>
|
|
41
|
+
<Text
|
|
42
|
+
style={[
|
|
43
|
+
tw`text-white50 font-DegularDisplaySemibold text-xl `,
|
|
44
|
+
titleStyle,
|
|
45
|
+
]}
|
|
46
|
+
>
|
|
47
|
+
{title}
|
|
48
|
+
</Text>
|
|
49
|
+
</TouchableOpacity>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default React.memo(BackWithTitle);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ActivityIndicator, StyleSheet, TouchableOpacity } from "react-native";
|
|
2
|
+
import { SvgProps, SvgXml } from "react-native-svg";
|
|
3
|
+
|
|
4
|
+
import React from "react";
|
|
5
|
+
import tw from "../tailwind";
|
|
6
|
+
|
|
7
|
+
interface IButton {
|
|
8
|
+
containerStyle?: {};
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
svg?: string;
|
|
11
|
+
onPress?: () => void;
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
loadingColor?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
svgProps?: SvgProps;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const IButton = ({
|
|
19
|
+
containerStyle,
|
|
20
|
+
icon,
|
|
21
|
+
svg,
|
|
22
|
+
onPress,
|
|
23
|
+
disabled,
|
|
24
|
+
isLoading,
|
|
25
|
+
loadingColor,
|
|
26
|
+
svgProps,
|
|
27
|
+
}: IButton) => {
|
|
28
|
+
return (
|
|
29
|
+
<TouchableOpacity
|
|
30
|
+
onPress={onPress}
|
|
31
|
+
disabled={isLoading || disabled}
|
|
32
|
+
activeOpacity={0.5}
|
|
33
|
+
style={[
|
|
34
|
+
tw`bg-primary items-center px-3 flex-row justify-center gap-3 rounded-2xl ${
|
|
35
|
+
disabled ? "opacity-60" : "opacity-100"
|
|
36
|
+
}`,
|
|
37
|
+
containerStyle,
|
|
38
|
+
]}
|
|
39
|
+
>
|
|
40
|
+
{isLoading ? (
|
|
41
|
+
<ActivityIndicator
|
|
42
|
+
color={loadingColor ? loadingColor : tw.color("white")}
|
|
43
|
+
/>
|
|
44
|
+
) : (
|
|
45
|
+
<>
|
|
46
|
+
{icon ? (
|
|
47
|
+
icon
|
|
48
|
+
) : (
|
|
49
|
+
<SvgXml
|
|
50
|
+
xml={
|
|
51
|
+
svg
|
|
52
|
+
? svg
|
|
53
|
+
: `<svg width="16" height="20" viewBox="0 0 16 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
54
|
+
<path d="M15.3337 1.54972e-05L0.666992 0V19.3333C0.666992 19.5896 0.813889 19.8232 1.04487 19.9342C1.27584 20.0452 1.55001 20.014 1.75012 19.8539L8.00033 14.8538L14.2505 19.8539C14.4506 20.014 14.7248 20.0452 14.9558 19.9342C15.1868 19.8232 15.3337 19.5896 15.3337 19.3333V1.54972e-05Z" fill="white"/>
|
|
55
|
+
</svg>
|
|
56
|
+
`
|
|
57
|
+
}
|
|
58
|
+
{...svgProps}
|
|
59
|
+
/>
|
|
60
|
+
)}
|
|
61
|
+
</>
|
|
62
|
+
)}
|
|
63
|
+
</TouchableOpacity>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default IButton;
|
|
68
|
+
|
|
69
|
+
const styles = StyleSheet.create({});
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { ActivityIndicator, Text, TouchableOpacity, View } from "react-native";
|
|
2
|
+
import { SvgProps, SvgXml } from "react-native-svg";
|
|
3
|
+
|
|
4
|
+
import { LinearGradient } from "expo-linear-gradient";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import tw from "../tailwind";
|
|
7
|
+
|
|
8
|
+
interface IButton {
|
|
9
|
+
containerStyle?: {};
|
|
10
|
+
titleStyle?: {};
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
svg?: string;
|
|
13
|
+
svg2?: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
firstSvgTitleTogether?: boolean;
|
|
16
|
+
onPress?: () => void;
|
|
17
|
+
isLoading?: boolean;
|
|
18
|
+
loadingColor?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
svgProps?: SvgProps;
|
|
21
|
+
svg2Props?: SvgProps;
|
|
22
|
+
offGradient?: boolean;
|
|
23
|
+
gradinLayoutStyle?: {};
|
|
24
|
+
svgTogether?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const IwtButton = ({
|
|
28
|
+
containerStyle,
|
|
29
|
+
icon,
|
|
30
|
+
svg,
|
|
31
|
+
title,
|
|
32
|
+
titleStyle,
|
|
33
|
+
onPress,
|
|
34
|
+
disabled,
|
|
35
|
+
isLoading,
|
|
36
|
+
loadingColor,
|
|
37
|
+
svg2,
|
|
38
|
+
firstSvgTitleTogether,
|
|
39
|
+
svgProps,
|
|
40
|
+
svg2Props,
|
|
41
|
+
offGradient,
|
|
42
|
+
gradinLayoutStyle,
|
|
43
|
+
svgTogether,
|
|
44
|
+
}: IButton) => {
|
|
45
|
+
return (
|
|
46
|
+
<TouchableOpacity
|
|
47
|
+
onPress={onPress}
|
|
48
|
+
disabled={isLoading || disabled}
|
|
49
|
+
activeOpacity={0.5}
|
|
50
|
+
style={[
|
|
51
|
+
tw` h-14 gap-3 rounded-full overflow-hidden ${
|
|
52
|
+
disabled ? "opacity-60" : "opacity-100"
|
|
53
|
+
}`,
|
|
54
|
+
containerStyle,
|
|
55
|
+
]}
|
|
56
|
+
>
|
|
57
|
+
<LinearGradient
|
|
58
|
+
// Background Linear Gradient
|
|
59
|
+
colors={
|
|
60
|
+
offGradient ? ["transparent", "transparent"] : ["#FF8787", "#8578B4"]
|
|
61
|
+
}
|
|
62
|
+
style={[
|
|
63
|
+
tw`w-full h-full flex-row justify-center items-center gap-3 `,
|
|
64
|
+
gradinLayoutStyle,
|
|
65
|
+
]}
|
|
66
|
+
>
|
|
67
|
+
{firstSvgTitleTogether ? (
|
|
68
|
+
<View style={tw`flex-row justify-center items-center gap-2`}>
|
|
69
|
+
{isLoading ? (
|
|
70
|
+
<ActivityIndicator
|
|
71
|
+
color={loadingColor ? loadingColor : "white"}
|
|
72
|
+
/>
|
|
73
|
+
) : (
|
|
74
|
+
<>
|
|
75
|
+
{icon ? (
|
|
76
|
+
icon
|
|
77
|
+
) : svg ? (
|
|
78
|
+
<SvgXml
|
|
79
|
+
xml={
|
|
80
|
+
svg
|
|
81
|
+
? svg
|
|
82
|
+
: `<svg width="16" height="20" viewBox="0 0 16 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
83
|
+
<path d="M15.3337 1.54972e-05L0.666992 0V19.3333C0.666992 19.5896 0.813889 19.8232 1.04487 19.9342C1.27584 20.0452 1.55001 20.014 1.75012 19.8539L8.00033 14.8538L14.2505 19.8539C14.4506 20.014 14.7248 20.0452 14.9558 19.9342C15.1868 19.8232 15.3337 19.5896 15.3337 19.3333V1.54972e-05Z" fill="white"/>
|
|
84
|
+
</svg>
|
|
85
|
+
`
|
|
86
|
+
}
|
|
87
|
+
{...svgProps}
|
|
88
|
+
/>
|
|
89
|
+
) : null}
|
|
90
|
+
{svgTogether && (
|
|
91
|
+
<>
|
|
92
|
+
{svg2 && (
|
|
93
|
+
<SvgXml
|
|
94
|
+
xml={
|
|
95
|
+
svg2
|
|
96
|
+
? svg2
|
|
97
|
+
: `<svg width="16" height="20" viewBox="0 0 16 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
98
|
+
<path d="M15.3337 1.54972e-05L0.666992 0V19.3333C0.666992 19.5896 0.813889 19.8232 1.04487 19.9342C1.27584 20.0452 1.55001 20.014 1.75012 19.8539L8.00033 14.8538L14.2505 19.8539C14.4506 20.014 14.7248 20.0452 14.9558 19.9342C15.1868 19.8232 15.3337 19.5896 15.3337 19.3333V1.54972e-05Z" fill="white"/>
|
|
99
|
+
</svg>
|
|
100
|
+
`
|
|
101
|
+
}
|
|
102
|
+
{...svgProps}
|
|
103
|
+
{...svg2Props}
|
|
104
|
+
/>
|
|
105
|
+
)}
|
|
106
|
+
</>
|
|
107
|
+
)}
|
|
108
|
+
</>
|
|
109
|
+
)}
|
|
110
|
+
|
|
111
|
+
{title && (
|
|
112
|
+
<Text
|
|
113
|
+
style={[
|
|
114
|
+
tw`text-white font-InterSemiBold text-base `,
|
|
115
|
+
titleStyle,
|
|
116
|
+
]}
|
|
117
|
+
>
|
|
118
|
+
{title}
|
|
119
|
+
</Text>
|
|
120
|
+
)}
|
|
121
|
+
</View>
|
|
122
|
+
) : (
|
|
123
|
+
<>
|
|
124
|
+
{isLoading ? (
|
|
125
|
+
<ActivityIndicator
|
|
126
|
+
color={loadingColor ? loadingColor : "white"}
|
|
127
|
+
/>
|
|
128
|
+
) : (
|
|
129
|
+
<>
|
|
130
|
+
{icon ? (
|
|
131
|
+
icon
|
|
132
|
+
) : svg ? (
|
|
133
|
+
<SvgXml
|
|
134
|
+
xml={
|
|
135
|
+
svg
|
|
136
|
+
? svg
|
|
137
|
+
: `<svg width="16" height="20" viewBox="0 0 16 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
138
|
+
<path d="M15.3337 1.54972e-05L0.666992 0V19.3333C0.666992 19.5896 0.813889 19.8232 1.04487 19.9342C1.27584 20.0452 1.55001 20.014 1.75012 19.8539L8.00033 14.8538L14.2505 19.8539C14.4506 20.014 14.7248 20.0452 14.9558 19.9342C15.1868 19.8232 15.3337 19.5896 15.3337 19.3333V1.54972e-05Z" fill="white"/>
|
|
139
|
+
</svg>
|
|
140
|
+
`
|
|
141
|
+
}
|
|
142
|
+
{...svgProps}
|
|
143
|
+
/>
|
|
144
|
+
) : null}
|
|
145
|
+
{svgTogether && (
|
|
146
|
+
<>
|
|
147
|
+
{svg2 && (
|
|
148
|
+
<SvgXml
|
|
149
|
+
xml={
|
|
150
|
+
svg2
|
|
151
|
+
? svg2
|
|
152
|
+
: `<svg width="16" height="20" viewBox="0 0 16 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
153
|
+
<path d="M15.3337 1.54972e-05L0.666992 0V19.3333C0.666992 19.5896 0.813889 19.8232 1.04487 19.9342C1.27584 20.0452 1.55001 20.014 1.75012 19.8539L8.00033 14.8538L14.2505 19.8539C14.4506 20.014 14.7248 20.0452 14.9558 19.9342C15.1868 19.8232 15.3337 19.5896 15.3337 19.3333V1.54972e-05Z" fill="white"/>
|
|
154
|
+
</svg>
|
|
155
|
+
`
|
|
156
|
+
}
|
|
157
|
+
{...svgProps}
|
|
158
|
+
{...svg2Props}
|
|
159
|
+
/>
|
|
160
|
+
)}
|
|
161
|
+
</>
|
|
162
|
+
)}
|
|
163
|
+
</>
|
|
164
|
+
)}
|
|
165
|
+
|
|
166
|
+
{title && (
|
|
167
|
+
<Text
|
|
168
|
+
style={[
|
|
169
|
+
tw`text-white font-InterSemiBold text-base `,
|
|
170
|
+
titleStyle,
|
|
171
|
+
]}
|
|
172
|
+
>
|
|
173
|
+
{title}
|
|
174
|
+
</Text>
|
|
175
|
+
)}
|
|
176
|
+
</>
|
|
177
|
+
)}
|
|
178
|
+
<>
|
|
179
|
+
{svg2 && !svgTogether && (
|
|
180
|
+
<SvgXml
|
|
181
|
+
xml={
|
|
182
|
+
svg2
|
|
183
|
+
? svg2
|
|
184
|
+
: `<svg width="16" height="20" viewBox="0 0 16 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
185
|
+
<path d="M15.3337 1.54972e-05L0.666992 0V19.3333C0.666992 19.5896 0.813889 19.8232 1.04487 19.9342C1.27584 20.0452 1.55001 20.014 1.75012 19.8539L8.00033 14.8538L14.2505 19.8539C14.4506 20.014 14.7248 20.0452 14.9558 19.9342C15.1868 19.8232 15.3337 19.5896 15.3337 19.3333V1.54972e-05Z" fill="white"/>
|
|
186
|
+
</svg>
|
|
187
|
+
`
|
|
188
|
+
}
|
|
189
|
+
{...svgProps}
|
|
190
|
+
{...svg2Props}
|
|
191
|
+
/>
|
|
192
|
+
)}
|
|
193
|
+
</>
|
|
194
|
+
</LinearGradient>
|
|
195
|
+
</TouchableOpacity>
|
|
196
|
+
);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export default IwtButton;
|