fln-espranza 0.0.22 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/.expo/README.md +15 -15
  2. package/.expo/settings.json +8 -8
  3. package/assets/images/bg-profile.jpg +0 -0
  4. package/components/Avatar.tsx +43 -43
  5. package/components/BaseLayout.tsx +174 -174
  6. package/components/Drawer.tsx +98 -98
  7. package/components/EBadge.tsx +23 -23
  8. package/components/EButton.tsx +71 -71
  9. package/components/EDateAndTimeCard.tsx +51 -51
  10. package/components/EDateInput.tsx +55 -55
  11. package/components/EEmptyPlaceholder.tsx +21 -21
  12. package/components/EErrorText.tsx +19 -19
  13. package/components/EInfoBox.tsx +41 -41
  14. package/components/EInput.tsx +52 -52
  15. package/components/ELabel.tsx +15 -15
  16. package/components/EListPerson.tsx +48 -48
  17. package/components/EListSchool.tsx +35 -35
  18. package/components/EOption.tsx +85 -85
  19. package/components/EOtpInputBox.tsx +49 -49
  20. package/components/EPageDescription.tsx +19 -19
  21. package/components/EPillButton.tsx +33 -33
  22. package/components/EProfile.tsx +62 -62
  23. package/components/EProfileScreenLayout.tsx +110 -0
  24. package/components/EProgressBar.tsx +33 -33
  25. package/components/EQuestionSerialNumberLabel.tsx +17 -17
  26. package/components/EQuestionText.tsx +14 -14
  27. package/components/ESegment.tsx +36 -36
  28. package/components/EText.tsx +41 -41
  29. package/components/ETimeInput.tsx +55 -55
  30. package/components/ETimeLineCard.tsx +69 -69
  31. package/components/ListFormView.tsx +36 -36
  32. package/components/Loader.tsx +31 -31
  33. package/components/MenuItems.tsx +46 -46
  34. package/components/PageHeader.tsx +116 -115
  35. package/components/ProfileHeader.tsx +85 -0
  36. package/components/SecondaryBaseLayout.tsx +102 -102
  37. package/components/Timer.tsx +56 -56
  38. package/components/icons/EIconAdd.jsx +19 -19
  39. package/components/icons/EIconAddCircle.jsx +21 -21
  40. package/components/icons/EIconApplicationStatus.jsx +20 -20
  41. package/components/icons/EIconArrowDown.jsx +20 -20
  42. package/components/icons/EIconArrowLeft.jsx +21 -21
  43. package/components/icons/EIconArrowRight.jsx +21 -21
  44. package/components/icons/EIconArrowUp.jsx +20 -20
  45. package/components/icons/EIconBadge.jsx +20 -20
  46. package/components/icons/EIconBell.jsx +19 -19
  47. package/components/icons/EIconCalendar.jsx +21 -21
  48. package/components/icons/EIconCalendarCheck.jsx +24 -24
  49. package/components/icons/EIconCamera.jsx +20 -20
  50. package/components/icons/EIconCameraRotate.jsx +23 -23
  51. package/components/icons/EIconCheck.jsx +19 -19
  52. package/components/icons/EIconCheckCircle.jsx +20 -20
  53. package/components/icons/EIconCheckFill.jsx +19 -19
  54. package/components/icons/EIconChevronDown.jsx +19 -19
  55. package/components/icons/EIconChevronLeft.jsx +19 -19
  56. package/components/icons/EIconChevronRight.jsx +19 -19
  57. package/components/icons/EIconChevronUp.jsx +19 -19
  58. package/components/icons/EIconClock.jsx +19 -19
  59. package/components/icons/EIconClose.jsx +19 -19
  60. package/components/icons/EIconDashboard.jsx +20 -20
  61. package/components/icons/EIconEdit.jsx +19 -19
  62. package/components/icons/EIconFile.jsx +21 -21
  63. package/components/icons/EIconInfo.jsx +20 -20
  64. package/components/icons/EIconLogout.jsx +19 -19
  65. package/components/icons/EIconMenu.jsx +19 -19
  66. package/components/icons/EIconMinus.jsx +19 -19
  67. package/components/icons/EIconPin.jsx +19 -19
  68. package/components/icons/EIconProfile.jsx +19 -19
  69. package/components/icons/EIconSchool.jsx +24 -24
  70. package/components/icons/EIconSearch.jsx +19 -19
  71. package/components/icons/EIconSettings.jsx +20 -20
  72. package/components/icons/EIconShare.jsx +21 -21
  73. package/components/icons/EIconStudent.jsx +23 -23
  74. package/components/icons/EIconSubject.jsx +21 -21
  75. package/components/icons/EIconTeach.jsx +21 -21
  76. package/components/icons/EIconTrash.jsx +19 -19
  77. package/components/icons/EIconUserCard.jsx +19 -19
  78. package/components/icons/EIconUserCheck.jsx +20 -20
  79. package/components/icons/EIconUsers.jsx +19 -19
  80. package/components/index.tsx +65 -65
  81. package/index.ts +174 -172
  82. package/package.json +26 -26
  83. package/utils/Color.ts +14 -14
@@ -1,115 +1,116 @@
1
- import { View, Animated, Dimensions, TouchableOpacity } from "react-native";
2
- import React, { useEffect, useRef } from "react";
3
- import tw from "../lib/tailwind";
4
- import { useNavigation } from "@react-navigation/native";
5
- import EText from "./EText";
6
- import Constants from "expo-constants";
7
- import { EIconArrowLeft, EIconMenu } from "fln-espranza";
8
-
9
- const SCREEN_WIDTH = Dimensions.get("window").width;
10
- const HEADER_HEIGHT = 90;
11
-
12
- interface PageHeaderProps {
13
- title: string;
14
- subtitle?: string;
15
- curved?: boolean;
16
- children?: JSX.Element;
17
- iconEnd?: JSX.Element;
18
- border?: boolean;
19
- menuButton?: boolean;
20
- }
21
-
22
- export default function PageHeader({
23
- title,
24
- subtitle,
25
- curved,
26
- children,
27
- iconEnd,
28
- border,
29
- menuButton,
30
- }: PageHeaderProps) {
31
- const navigation = useNavigation();
32
-
33
- const translateX = useRef(new Animated.Value(60)).current;
34
- const opacity = useRef(new Animated.Value(0)).current;
35
-
36
- useEffect(() => {
37
- Animated.spring(translateX, {
38
- toValue: 0,
39
- stiffness: 40,
40
- damping: 10,
41
- useNativeDriver: true,
42
- }).start();
43
- Animated.spring(opacity, {
44
- toValue: 1,
45
- delay: 250,
46
- useNativeDriver: true,
47
- }).start();
48
- });
49
- return (
50
- <View style={[tw`${"border-none border-slate-300 bg-white shadow-lg py-3"} `, {}]}>
51
- <View style={tw`overflow-hidden`}>
52
- <View
53
- style={[
54
- tw`flex-row items-center px-3`,
55
- {
56
- paddingTop: Constants.statusBarHeight + 8,
57
- },
58
- ]}
59
- >
60
- {/* LEFT ICON */}
61
- <View
62
- style={[tw`` ]}
63
- >
64
- {menuButton ?
65
- <TouchableOpacity activeOpacity={0.6}
66
- onPress={() => navigation?.openDrawer()}>
67
- <EIconMenu
68
- size={24}
69
- style={tw`text-slate-800`}
70
- />
71
- </TouchableOpacity>
72
-
73
- :
74
- <TouchableOpacity activeOpacity={0.6}
75
- onPress={() => navigation.goBack()}>
76
- <EIconArrowLeft
77
- iconColor={curved ? "white" : "tint-slate-900"}
78
- size={24}
79
- // onPress={() => navigation.navigate("Dashboard")}
80
- style={tw`text-slate-800`}
81
- />
82
- </TouchableOpacity>
83
- }
84
- </View>
85
- {/* TITLE */}
86
- <View style={tw`flex-1 items-start px-3`}>
87
- <EText
88
- size="lg"
89
- style={tw.style("text-slate-800 font-bold")}
90
- >
91
- {title}
92
- </EText>
93
- {subtitle ? (
94
- <EText
95
- style={tw.style(
96
- "text-slate-800 opacity-40 font-semibold mt-0.25"
97
- )}
98
- >
99
- {subtitle}
100
- </EText>
101
- ) : null}
102
- </View>
103
-
104
- {/* RIGHT ICON */}
105
- {iconEnd ? (
106
- <View style={[tw``, {}]}>
107
- {iconEnd}
108
- </View>
109
- ) : null}
110
- </View>
111
- {children ? <View style={tw.style("pb-6")}>{children}</View> : null}
112
- </View>
113
- </View>
114
- );
115
- }
1
+ import { View, Animated, Dimensions, TouchableOpacity } from "react-native";
2
+ import React, { useEffect, useRef } from "react";
3
+ import tw from "../lib/tailwind";
4
+ import { useNavigation } from "@react-navigation/native";
5
+ import EText from "./EText";
6
+ import Constants from "expo-constants";
7
+ import EIconArrowLeft from "./icons/EIconArrowLeft";
8
+ import EIconMenu from "./icons/EIconMenu";
9
+
10
+ const SCREEN_WIDTH = Dimensions.get("window").width;
11
+ const HEADER_HEIGHT = 90;
12
+
13
+ interface PageHeaderProps {
14
+ title: string;
15
+ subtitle?: string;
16
+ curved?: boolean;
17
+ children?: JSX.Element;
18
+ iconEnd?: JSX.Element;
19
+ border?: boolean;
20
+ menuButton?: boolean;
21
+ }
22
+
23
+ export default function PageHeader({
24
+ title,
25
+ subtitle,
26
+ curved,
27
+ children,
28
+ iconEnd,
29
+ border,
30
+ menuButton,
31
+ }: PageHeaderProps) {
32
+ const navigation = useNavigation();
33
+
34
+ const translateX = useRef(new Animated.Value(60)).current;
35
+ const opacity = useRef(new Animated.Value(0)).current;
36
+
37
+ useEffect(() => {
38
+ Animated.spring(translateX, {
39
+ toValue: 0,
40
+ stiffness: 40,
41
+ damping: 10,
42
+ useNativeDriver: true,
43
+ }).start();
44
+ Animated.spring(opacity, {
45
+ toValue: 1,
46
+ delay: 250,
47
+ useNativeDriver: true,
48
+ }).start();
49
+ });
50
+ return (
51
+ <View style={[tw`${"border-none border-slate-300 bg-white shadow-lg py-3"} `, {}]}>
52
+ <View style={tw`overflow-hidden`}>
53
+ <View
54
+ style={[
55
+ tw`flex-row items-center px-3`,
56
+ {
57
+ paddingTop: Constants.statusBarHeight + 8,
58
+ },
59
+ ]}
60
+ >
61
+ {/* LEFT ICON */}
62
+ <View
63
+ style={[tw`` ]}
64
+ >
65
+ {menuButton ?
66
+ <TouchableOpacity activeOpacity={0.6}
67
+ onPress={() => navigation?.openDrawer()}>
68
+ <EIconMenu
69
+ size={24}
70
+ style={tw`text-slate-800`}
71
+ />
72
+ </TouchableOpacity>
73
+
74
+ :
75
+ <TouchableOpacity activeOpacity={0.6}
76
+ onPress={() => navigation.goBack()}>
77
+ <EIconArrowLeft
78
+ iconColor={curved ? "white" : "tint-slate-900"}
79
+ size={24}
80
+ // onPress={() => navigation.navigate("Dashboard")}
81
+ style={tw`text-slate-800`}
82
+ />
83
+ </TouchableOpacity>
84
+ }
85
+ </View>
86
+ {/* TITLE */}
87
+ <View style={tw`flex-1 items-start px-3`}>
88
+ <EText
89
+ size="lg"
90
+ style={tw.style("text-slate-800 font-bold")}
91
+ >
92
+ {title}
93
+ </EText>
94
+ {subtitle ? (
95
+ <EText
96
+ style={tw.style(
97
+ "text-slate-800 opacity-40 font-semibold mt-0.25"
98
+ )}
99
+ >
100
+ {subtitle}
101
+ </EText>
102
+ ) : null}
103
+ </View>
104
+
105
+ {/* RIGHT ICON */}
106
+ {iconEnd ? (
107
+ <View style={[tw``, {}]}>
108
+ {iconEnd}
109
+ </View>
110
+ ) : null}
111
+ </View>
112
+ {children ? <View style={tw.style("pb-6")}>{children}</View> : null}
113
+ </View>
114
+ </View>
115
+ );
116
+ }
@@ -0,0 +1,85 @@
1
+ import { useNavigation } from "@react-navigation/native";
2
+ import React, { useRef } from "react";
3
+ import { Animated, ImageBackground, View } from "react-native";
4
+ import EButtonIcon from "./EButtonIcon";
5
+ import Avatar from "./Avatar";
6
+ import EText from "./EText";
7
+ import tw from "../../../lib/tailwind";
8
+ import Constants from "expo-constants";
9
+
10
+ interface IProps {
11
+ name: string;
12
+ titleText?: string;
13
+ title: string;
14
+ }
15
+
16
+ export default function ProfileHeader({ name, title, titleText }: IProps) {
17
+ const translateX = useRef(new Animated.Value(60)).current;
18
+ const opacity = useRef(new Animated.Value(0)).current;
19
+ const navigation = useNavigation();
20
+
21
+ React.useEffect(() => {
22
+ Animated.spring(translateX, {
23
+ toValue: 0,
24
+ stiffness: 40,
25
+ damping: 10,
26
+ useNativeDriver: true,
27
+ }).start();
28
+ Animated.spring(opacity, {
29
+ toValue: 1,
30
+ delay: 250,
31
+ useNativeDriver: true,
32
+ }).start();
33
+ });
34
+
35
+ return (
36
+ <View style={tw`flex-1 overflow-hidden h-full`}>
37
+ <ImageBackground
38
+ style={[tw`h-full w-full`, {}]}
39
+ source={require("../assets/images/bg-profile.jpg")}
40
+ >
41
+ <Animated.View
42
+ style={[
43
+ tw`flex-row pr-4 pl-3 pb-3`,
44
+ {
45
+ paddingTop: Constants.statusBarHeight + 8,
46
+ transform: [{ translateX }],
47
+ opacity,
48
+ },
49
+ ]}
50
+ >
51
+ <Animated.View
52
+ style={[
53
+ tw`-mt-2 left-3 absolute `,
54
+ {
55
+ transform: [{ translateX }],
56
+ opacity,
57
+ paddingTop: Constants.statusBarHeight + 8,
58
+ },
59
+ ]}
60
+ >
61
+ <EButtonIcon
62
+ iconColor={"tint-white"}
63
+ size={20}
64
+ onPress={() => navigation.goBack()}
65
+ />
66
+ </Animated.View>
67
+ </Animated.View>
68
+ <View style={[tw`flex items-center mt-5 rounded-4xl `, {}]}>
69
+ <Avatar size="5xl" source={""} nameFirstLetter={name?.split("")[0]} />
70
+ <View style={tw`mt-6 mb-8 items-center`}>
71
+ <EText size="2xl" style={tw`font-bold text-white capitalize`}>
72
+ {name.toLocaleLowerCase().trim()}
73
+ </EText>
74
+ <EText
75
+ size="sm"
76
+ style={tw`mt-0.5 font-normal opacity-50 text-white`}
77
+ >
78
+ {titleText ? titleText : "Unique Code"} : {title}
79
+ </EText>
80
+ </View>
81
+ </View>
82
+ </ImageBackground>
83
+ </View>
84
+ );
85
+ }
@@ -1,102 +1,102 @@
1
- import { View, Dimensions, ScrollView, Platform } from "react-native";
2
- import React from "react";
3
- import { useSafeAreaInsets } from "react-native-safe-area-context";
4
- import tw from "../lib/tailwind";
5
- import { StatusBar } from "expo-status-bar";
6
- import { PageHeader } from ".";
7
- import Constants from "expo-constants";
8
- import { useNavigation } from "@react-navigation/native";
9
-
10
- const SCREEN_WIDTH = Dimensions.get("window").width;
11
- const SCREEN_HEIGHT = Dimensions.get("window").height;
12
- const HEADER_HEIGHT = Constants.statusBarHeight + 60;
13
- const SCROLL_PADDING_BOTTOM = 100;
14
-
15
- interface BaseLayoutProps {
16
- title: string;
17
- subtitle?: string;
18
- curved?: boolean;
19
- headerContent?: JSX.Element;
20
- children?: JSX.Element | JSX.Element[];
21
- iconEnd?: JSX.Element;
22
- noScroll?: boolean;
23
- bottomButton?: JSX.Element;
24
- border?: boolean;
25
- menuButton?: boolean;
26
- }
27
-
28
- export default function SecondaryBaseLayout({
29
- title,
30
- subtitle,
31
- curved,
32
- headerContent,
33
- children,
34
- noScroll,
35
- iconEnd,
36
- bottomButton,
37
- border,
38
- menuButton,
39
- }: BaseLayoutProps) {
40
- const insets = useSafeAreaInsets();
41
-
42
- const navigation = useNavigation();
43
-
44
- return (
45
- <View
46
- style={[
47
- tw`flex-1 bg-white`,
48
- {
49
- paddingBottom: Platform.OS === "ios" ? insets.bottom : 0,
50
- paddingTop: Platform.OS === "ios" ? 44 : 24,
51
- },
52
- ]}
53
- >
54
- <StatusBar style="dark" animated />
55
-
56
- {/* HEADER */}
57
- <View
58
- style={[
59
- tw`absolute top-0 right-0 left-0 pt-0 z-10 w-full bg-white ${
60
- title ? "mb-1" : "pb-0"
61
- }`,
62
- ]}
63
- >
64
- <PageHeader
65
- border={border}
66
- title={title}
67
- subtitle={subtitle}
68
- curved={curved}
69
- iconEnd={iconEnd}
70
- menuButton={menuButton}
71
- >
72
- {headerContent}
73
- </PageHeader>
74
- </View>
75
- <ScrollView
76
- style={[
77
- tw`flex-1`,
78
- { paddingBottom: insets.bottom, paddingTop: !title ? 80 : 80 },
79
- ]}
80
- showsVerticalScrollIndicator={false}
81
- decelerationRate={"fast"}
82
- contentContainerStyle={{
83
- paddingBottom: SCROLL_PADDING_BOTTOM,
84
- }}
85
- >
86
- {children}
87
- </ScrollView>
88
- {bottomButton ? (
89
- <View
90
- style={[
91
- tw` px-4 `,
92
- { paddingBottom: Platform.OS === "android" ? 8 : 0 },
93
- ]}
94
- >
95
- {bottomButton}
96
- </View>
97
- ) : (
98
- <></>
99
- )}
100
- </View>
101
- );
102
- }
1
+ import { View, Dimensions, ScrollView, Platform } from "react-native";
2
+ import React from "react";
3
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
4
+ import tw from "../lib/tailwind";
5
+ import { StatusBar } from "expo-status-bar";
6
+ import { PageHeader } from ".";
7
+ import Constants from "expo-constants";
8
+ import { useNavigation } from "@react-navigation/native";
9
+
10
+ const SCREEN_WIDTH = Dimensions.get("window").width;
11
+ const SCREEN_HEIGHT = Dimensions.get("window").height;
12
+ const HEADER_HEIGHT = Constants.statusBarHeight + 60;
13
+ const SCROLL_PADDING_BOTTOM = 100;
14
+
15
+ interface BaseLayoutProps {
16
+ title: string;
17
+ subtitle?: string;
18
+ curved?: boolean;
19
+ headerContent?: JSX.Element;
20
+ children?: JSX.Element | JSX.Element[];
21
+ iconEnd?: JSX.Element;
22
+ noScroll?: boolean;
23
+ bottomButton?: JSX.Element;
24
+ border?: boolean;
25
+ menuButton?: boolean;
26
+ }
27
+
28
+ export default function SecondaryBaseLayout({
29
+ title,
30
+ subtitle,
31
+ curved,
32
+ headerContent,
33
+ children,
34
+ noScroll,
35
+ iconEnd,
36
+ bottomButton,
37
+ border,
38
+ menuButton,
39
+ }: BaseLayoutProps) {
40
+ const insets = useSafeAreaInsets();
41
+
42
+ const navigation = useNavigation();
43
+
44
+ return (
45
+ <View
46
+ style={[
47
+ tw`flex-1 bg-white`,
48
+ {
49
+ paddingBottom: Platform.OS === "ios" ? insets.bottom : 0,
50
+ paddingTop: Platform.OS === "ios" ? 44 : 24,
51
+ },
52
+ ]}
53
+ >
54
+ <StatusBar style="dark" animated />
55
+
56
+ {/* HEADER */}
57
+ <View
58
+ style={[
59
+ tw`absolute top-0 right-0 left-0 pt-0 z-10 w-full bg-white ${
60
+ title ? "mb-1" : "pb-0"
61
+ }`,
62
+ ]}
63
+ >
64
+ <PageHeader
65
+ border={border}
66
+ title={title}
67
+ subtitle={subtitle}
68
+ curved={curved}
69
+ iconEnd={iconEnd}
70
+ menuButton={menuButton}
71
+ >
72
+ {headerContent}
73
+ </PageHeader>
74
+ </View>
75
+ <ScrollView
76
+ style={[
77
+ tw`flex-1`,
78
+ { paddingBottom: insets.bottom, paddingTop: !title ? 80 : 80 },
79
+ ]}
80
+ showsVerticalScrollIndicator={false}
81
+ decelerationRate={"fast"}
82
+ contentContainerStyle={{
83
+ paddingBottom: SCROLL_PADDING_BOTTOM,
84
+ }}
85
+ >
86
+ {children}
87
+ </ScrollView>
88
+ {bottomButton ? (
89
+ <View
90
+ style={[
91
+ tw` px-4 `,
92
+ { paddingBottom: Platform.OS === "android" ? 8 : 0 },
93
+ ]}
94
+ >
95
+ {bottomButton}
96
+ </View>
97
+ ) : (
98
+ <></>
99
+ )}
100
+ </View>
101
+ );
102
+ }
@@ -1,57 +1,57 @@
1
- import React from "react";
2
- import { useState } from "react";
3
- import { TouchableOpacity } from "react-native";
4
- import tw from "../lib/tailwind";
5
- import { Colors } from "../utils/Color";
6
- import EText from "./EText";
7
-
8
- interface IProps {
9
- time: number;
10
- text: string;
11
- subtext: string;
12
- handleGetOTP: () => void;
13
- sendOtp: boolean;
14
- email: string;
15
- }
16
-
17
- export default function Timer({ time, text, subtext, sendOtp, handleGetOTP,email }: IProps) {
18
-
19
- const [timer, setTimer] = useState(time);
20
- React.useEffect(() => {
21
- setTimer(30);
22
- return () => {
23
- setTimer(0);
24
- }
25
- }, [sendOtp]);
26
-
27
- React.useEffect(() => {
28
- timer > 0 &&
29
- setTimeout(() => {
30
- setTimer(timer - 1);
31
- }, 1000);
32
-
33
- return () => {
34
- clearTimeout();
35
- }
36
- }, [timer]);
37
-
38
- return(
39
-
40
- <>
41
- {timer > 0 ? <TouchableOpacity style={[tw`mt-2`, {}]}>
42
- <EText size="sm" style={[tw`font-bold text-[${Colors["text-primary"]}]`, {}]}>
43
- {timer > 0 && `${text}${timer >= 10 ? timer : "0" + timer}`}
44
- </EText>
45
- </TouchableOpacity> :
46
- <TouchableOpacity style={[tw`mt-2`, {}]}
47
- onPress={() => handleGetOTP()}
48
- >
49
- <EText size="sm" style={[tw`font-bold text-[${Colors["text-primary"]}]`, {}]}>
50
- {subtext}
51
- </EText>
52
- </TouchableOpacity>
53
- }
54
- </>
55
-
56
- )
1
+ import React from "react";
2
+ import { useState } from "react";
3
+ import { TouchableOpacity } from "react-native";
4
+ import tw from "../lib/tailwind";
5
+ import { Colors } from "../utils/Color";
6
+ import EText from "./EText";
7
+
8
+ interface IProps {
9
+ time: number;
10
+ text: string;
11
+ subtext: string;
12
+ handleGetOTP: () => void;
13
+ sendOtp: boolean;
14
+ email: string;
15
+ }
16
+
17
+ export default function Timer({ time, text, subtext, sendOtp, handleGetOTP,email }: IProps) {
18
+
19
+ const [timer, setTimer] = useState(time);
20
+ React.useEffect(() => {
21
+ setTimer(30);
22
+ return () => {
23
+ setTimer(0);
24
+ }
25
+ }, [sendOtp]);
26
+
27
+ React.useEffect(() => {
28
+ timer > 0 &&
29
+ setTimeout(() => {
30
+ setTimer(timer - 1);
31
+ }, 1000);
32
+
33
+ return () => {
34
+ clearTimeout();
35
+ }
36
+ }, [timer]);
37
+
38
+ return(
39
+
40
+ <>
41
+ {timer > 0 ? <TouchableOpacity style={[tw`mt-2`, {}]}>
42
+ <EText size="sm" style={[tw`font-bold text-[${Colors["text-primary"]}]`, {}]}>
43
+ {timer > 0 && `${text}${timer >= 10 ? timer : "0" + timer}`}
44
+ </EText>
45
+ </TouchableOpacity> :
46
+ <TouchableOpacity style={[tw`mt-2`, {}]}
47
+ onPress={() => handleGetOTP()}
48
+ >
49
+ <EText size="sm" style={[tw`font-bold text-[${Colors["text-primary"]}]`, {}]}>
50
+ {subtext}
51
+ </EText>
52
+ </TouchableOpacity>
53
+ }
54
+ </>
55
+
56
+ )
57
57
  }
@@ -1,19 +1,19 @@
1
- import * as React from "react"
2
- import Svg, { G, Path } from "react-native-svg"
3
-
4
- function EIconAdd(props) {
5
- const size = props.size || '100%';
6
- return (
7
- <Svg height={size} width={size} viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" {...props}>
8
- <Path
9
- fillRule="evenodd"
10
- clipRule="evenodd"
11
- d="M12 5.25a.75.75 0 01.75.75v5.25H18a.75.75 0 010 1.5h-5.25V18a.75.75 0 01-1.5 0v-5.25H6a.75.75 0 010-1.5h5.25V6a.75.75 0 01.75-.75z"
12
- fill="currentColor"
13
- className=""
14
- />
15
- </Svg>
16
- )
17
- }
18
-
19
- export default EIconAdd;
1
+ import * as React from "react"
2
+ import Svg, { G, Path } from "react-native-svg"
3
+
4
+ function EIconAdd(props) {
5
+ const size = props.size || '100%';
6
+ return (
7
+ <Svg height={size} width={size} viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" {...props}>
8
+ <Path
9
+ fillRule="evenodd"
10
+ clipRule="evenodd"
11
+ d="M12 5.25a.75.75 0 01.75.75v5.25H18a.75.75 0 010 1.5h-5.25V18a.75.75 0 01-1.5 0v-5.25H6a.75.75 0 010-1.5h5.25V6a.75.75 0 01.75-.75z"
12
+ fill="currentColor"
13
+ className=""
14
+ />
15
+ </Svg>
16
+ )
17
+ }
18
+
19
+ export default EIconAdd;