fln-espranza 0.0.41 → 0.0.42

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 (90) hide show
  1. package/.expo/README.md +15 -15
  2. package/.expo/settings.json +8 -8
  3. package/assets/images/icon-placeholder-schedule.png +0 -0
  4. package/components/Avatar.tsx +43 -43
  5. package/components/BaseLayout.tsx +174 -174
  6. package/components/Drawer.tsx +125 -125
  7. package/components/EBadge.tsx +24 -24
  8. package/components/EButton.tsx +70 -70
  9. package/components/EButtonIcon.tsx +3 -3
  10. package/components/EDateAndTimeCard.tsx +51 -51
  11. package/components/EDateInput.tsx +55 -55
  12. package/components/EEmptyPlaceholder.tsx +21 -21
  13. package/components/EErrorText.tsx +19 -19
  14. package/components/EInfoBox.tsx +41 -41
  15. package/components/EInput.tsx +54 -54
  16. package/components/ELabel.tsx +15 -15
  17. package/components/EListPerson.tsx +52 -52
  18. package/components/EListSchool.tsx +35 -35
  19. package/components/ENotFoundPlaceholder.tsx +43 -0
  20. package/components/EOption.tsx +98 -98
  21. package/components/EOtpInputBox.tsx +49 -49
  22. package/components/EPageDescription.tsx +19 -19
  23. package/components/EPillButton.tsx +33 -33
  24. package/components/EProfile.tsx +62 -62
  25. package/components/EProfileScreenLayout.tsx +111 -111
  26. package/components/EProgressBar.tsx +33 -33
  27. package/components/EQuestionSerialNumberLabel.tsx +17 -17
  28. package/components/EQuestionText.tsx +14 -14
  29. package/components/ESegment.tsx +36 -36
  30. package/components/EStat.tsx +24 -24
  31. package/components/EText.tsx +41 -41
  32. package/components/ETextArea.tsx +53 -53
  33. package/components/ETimeInput.tsx +54 -54
  34. package/components/ETimeLineCard.tsx +66 -66
  35. package/components/ListFormView.tsx +36 -36
  36. package/components/Loader.tsx +31 -31
  37. package/components/MenuItems.tsx +46 -46
  38. package/components/PageHeader.tsx +123 -123
  39. package/components/ProfileHeader.tsx +85 -85
  40. package/components/SecondaryBaseLayout.tsx +106 -106
  41. package/components/Timer.tsx +56 -56
  42. package/components/icons/EIconAdd.jsx +19 -19
  43. package/components/icons/EIconAddCircle.jsx +21 -21
  44. package/components/icons/EIconApplicationStatus.jsx +20 -20
  45. package/components/icons/EIconArrowDown.jsx +20 -20
  46. package/components/icons/EIconArrowLeft.jsx +21 -21
  47. package/components/icons/EIconArrowRight.jsx +21 -21
  48. package/components/icons/EIconArrowUp.jsx +20 -20
  49. package/components/icons/EIconBadge.jsx +20 -20
  50. package/components/icons/EIconBell.jsx +19 -19
  51. package/components/icons/EIconCalendar.jsx +21 -21
  52. package/components/icons/EIconCalendarCheck.jsx +24 -24
  53. package/components/icons/EIconCamera.jsx +20 -20
  54. package/components/icons/EIconCameraRotate.jsx +23 -23
  55. package/components/icons/EIconCheck.jsx +19 -19
  56. package/components/icons/EIconCheckCircle.jsx +20 -20
  57. package/components/icons/EIconCheckFill.jsx +19 -19
  58. package/components/icons/EIconChevronDown.jsx +19 -19
  59. package/components/icons/EIconChevronLeft.jsx +19 -19
  60. package/components/icons/EIconChevronRight.jsx +19 -19
  61. package/components/icons/EIconChevronUp.jsx +19 -19
  62. package/components/icons/EIconClock.jsx +19 -19
  63. package/components/icons/EIconClose.jsx +19 -19
  64. package/components/icons/EIconDashboard.jsx +20 -20
  65. package/components/icons/EIconDocumentCheck.jsx +14 -14
  66. package/components/icons/EIconEdit.jsx +19 -19
  67. package/components/icons/EIconFemale.jsx +20 -20
  68. package/components/icons/EIconFile.jsx +21 -21
  69. package/components/icons/EIconInfo.jsx +20 -20
  70. package/components/icons/EIconLogout.jsx +19 -19
  71. package/components/icons/EIconMale.jsx +21 -21
  72. package/components/icons/EIconMenu.jsx +19 -19
  73. package/components/icons/EIconMinus.jsx +19 -19
  74. package/components/icons/EIconPin.jsx +19 -19
  75. package/components/icons/EIconProfile.jsx +19 -19
  76. package/components/icons/EIconSchool.jsx +24 -24
  77. package/components/icons/EIconSearch.jsx +19 -19
  78. package/components/icons/EIconSettings.jsx +20 -20
  79. package/components/icons/EIconShare.jsx +21 -21
  80. package/components/icons/EIconStudent.jsx +23 -23
  81. package/components/icons/EIconSubject.jsx +21 -21
  82. package/components/icons/EIconTeach.jsx +21 -21
  83. package/components/icons/EIconTrash.jsx +19 -19
  84. package/components/icons/EIconUserCard.jsx +19 -19
  85. package/components/icons/EIconUserCheck.jsx +20 -20
  86. package/components/icons/EIconUsers.jsx +19 -19
  87. package/components/index.tsx +67 -67
  88. package/index.ts +184 -180
  89. package/package.json +26 -26
  90. package/utils/Color.ts +14 -14
@@ -1,111 +1,111 @@
1
- import { Animated, ImageBackground, View } from "react-native";
2
- // import tw from '../../../lib/tailwind'
3
- import tw from "../lib/tailwind"
4
- import EButtonIcon from "./EButtonIcon";
5
- import EText from "./EText";
6
- import React, { useCallback, useRef } from "react";
7
- import Constants from "expo-constants";
8
- import { SCREEN_HEIGHT } from "@gorhom/bottom-sheet";
9
- import { useFocusEffect, useNavigation } from "@react-navigation/native";
10
- import { StatusBar } from "expo-status-bar";
11
- import ProfileHeader from "./ProfileHeader";
12
-
13
-
14
- interface IProps {
15
- profileName: string;
16
- titleText?: string;
17
- uniqueCode: string;
18
- body: JSX.Element;
19
- }
20
-
21
- export default function EProfileScreenLayout( { profileName, uniqueCode, body, titleText } : IProps) {
22
- const opacity = useRef(new Animated.Value(0)).current;
23
- const [headerScrolled, setHeaderScrolled] = React.useState(false);
24
- const scrollY = useRef(new Animated.Value(0)).current;
25
- const navigation = useNavigation();
26
-
27
- React.useEffect(() => {
28
- Animated.spring(scrollY, {
29
- toValue: headerScrolled ? 0 : -100,
30
- speed: 2,
31
- delay: 1,
32
- bounciness: 1,
33
- useNativeDriver: true,
34
- }).start();
35
-
36
- Animated.spring(opacity, {
37
- toValue: headerScrolled ? 0.975 : 0,
38
- speed: 2,
39
- delay: 1,
40
- bounciness: 1,
41
- useNativeDriver: true,
42
- }).start();
43
- }, [headerScrolled]);
44
-
45
-
46
-
47
- return (
48
- <View style={tw``}>
49
- <StatusBar
50
- style={"light"}
51
- animated
52
- />
53
- <Animated.View
54
- style={[
55
- tw`absolute top-0 left-0 right-0 z-10`,
56
- {
57
- transform: [{ translateY: scrollY }],
58
- opacity,
59
- },
60
- ]}
61
- >
62
- <ImageBackground
63
- style={[tw`flex-1`, {}]}
64
- source={require("../assets/images/bg-profile.jpg")}
65
- >
66
- <View
67
- style={[
68
- tw`flex-1 pl-3 pb-3 flex-row items-center `,
69
- { paddingTop: Constants.statusBarHeight + 4 },
70
- ]}
71
- >
72
- <EButtonIcon
73
- iconColor={"white"}
74
- size={20}
75
- onPress={() => navigation.goBack()}
76
- />
77
- <EText size="lg" style={tw`text-white font-bold ml-2`}>
78
- Profile
79
- </EText>
80
- </View>
81
- </ImageBackground>
82
- </Animated.View>
83
-
84
- <Animated.ScrollView
85
- onScroll={(event) => {
86
- const scrolling = event.nativeEvent.contentOffset.y;
87
- scrolling > 40 ? setHeaderScrolled(true) : setHeaderScrolled(false);
88
- }}
89
- style={[tw`flex-1 bg-white`, { minHeight: SCREEN_HEIGHT, paddingBottom: 100 }]}
90
- scrollEventThrottle={16}
91
- showsVerticalScrollIndicator={false}
92
- decelerationRate={"fast"}
93
- contentContainerStyle={{
94
- paddingBottom: 100
95
- }}
96
- >
97
-
98
- <ProfileHeader
99
- name={profileName?.trim() || ""}
100
- title={uniqueCode || ""}
101
- titleText={titleText ? titleText : "Unique Code"}
102
- />
103
-
104
- <View style={tw`px-4 mt-8 flex-1`}>
105
- {body}
106
- </View>
107
-
108
- </Animated.ScrollView>
109
- </View>
110
- );
111
- }
1
+ import { Animated, ImageBackground, View } from "react-native";
2
+ // import tw from '../../../lib/tailwind'
3
+ import tw from "../lib/tailwind"
4
+ import EButtonIcon from "./EButtonIcon";
5
+ import EText from "./EText";
6
+ import React, { useCallback, useRef } from "react";
7
+ import Constants from "expo-constants";
8
+ import { SCREEN_HEIGHT } from "@gorhom/bottom-sheet";
9
+ import { useFocusEffect, useNavigation } from "@react-navigation/native";
10
+ import { StatusBar } from "expo-status-bar";
11
+ import ProfileHeader from "./ProfileHeader";
12
+
13
+
14
+ interface IProps {
15
+ profileName: string;
16
+ titleText?: string;
17
+ uniqueCode: string;
18
+ body: JSX.Element;
19
+ }
20
+
21
+ export default function EProfileScreenLayout( { profileName, uniqueCode, body, titleText } : IProps) {
22
+ const opacity = useRef(new Animated.Value(0)).current;
23
+ const [headerScrolled, setHeaderScrolled] = React.useState(false);
24
+ const scrollY = useRef(new Animated.Value(0)).current;
25
+ const navigation = useNavigation();
26
+
27
+ React.useEffect(() => {
28
+ Animated.spring(scrollY, {
29
+ toValue: headerScrolled ? 0 : -100,
30
+ speed: 2,
31
+ delay: 1,
32
+ bounciness: 1,
33
+ useNativeDriver: true,
34
+ }).start();
35
+
36
+ Animated.spring(opacity, {
37
+ toValue: headerScrolled ? 0.975 : 0,
38
+ speed: 2,
39
+ delay: 1,
40
+ bounciness: 1,
41
+ useNativeDriver: true,
42
+ }).start();
43
+ }, [headerScrolled]);
44
+
45
+
46
+
47
+ return (
48
+ <View style={tw``}>
49
+ <StatusBar
50
+ style={"light"}
51
+ animated
52
+ />
53
+ <Animated.View
54
+ style={[
55
+ tw`absolute top-0 left-0 right-0 z-10`,
56
+ {
57
+ transform: [{ translateY: scrollY }],
58
+ opacity,
59
+ },
60
+ ]}
61
+ >
62
+ <ImageBackground
63
+ style={[tw`flex-1`, {}]}
64
+ source={require("../assets/images/bg-profile.jpg")}
65
+ >
66
+ <View
67
+ style={[
68
+ tw`flex-1 pl-3 pb-3 flex-row items-center `,
69
+ { paddingTop: Constants.statusBarHeight + 4 },
70
+ ]}
71
+ >
72
+ <EButtonIcon
73
+ iconColor={"white"}
74
+ size={20}
75
+ onPress={() => navigation.goBack()}
76
+ />
77
+ <EText size="lg" style={tw`text-white font-bold ml-2`}>
78
+ Profile
79
+ </EText>
80
+ </View>
81
+ </ImageBackground>
82
+ </Animated.View>
83
+
84
+ <Animated.ScrollView
85
+ onScroll={(event) => {
86
+ const scrolling = event.nativeEvent.contentOffset.y;
87
+ scrolling > 40 ? setHeaderScrolled(true) : setHeaderScrolled(false);
88
+ }}
89
+ style={[tw`flex-1 bg-white`, { minHeight: SCREEN_HEIGHT, paddingBottom: 100 }]}
90
+ scrollEventThrottle={16}
91
+ showsVerticalScrollIndicator={false}
92
+ decelerationRate={"fast"}
93
+ contentContainerStyle={{
94
+ paddingBottom: 100
95
+ }}
96
+ >
97
+
98
+ <ProfileHeader
99
+ name={profileName?.trim() || ""}
100
+ title={uniqueCode || ""}
101
+ titleText={titleText ? titleText : "Unique Code"}
102
+ />
103
+
104
+ <View style={tw`px-4 mt-8 flex-1`}>
105
+ {body}
106
+ </View>
107
+
108
+ </Animated.ScrollView>
109
+ </View>
110
+ );
111
+ }
@@ -1,33 +1,33 @@
1
- import React, { useEffect, useRef, useState } from 'react'
2
- import { Animated,StyleSheet, View } from 'react-native';
3
- import tw from "fln-espranza/lib/tailwind";
4
- import { Colors } from "fln-espranza/utils/Color";
5
-
6
- interface IProps{
7
- progress: number;
8
- }
9
-
10
- export default function EProgressBar( {progress}: IProps) {
11
-
12
-
13
- const barWidth = useRef(new Animated.Value(0)).current;
14
-
15
- useEffect(() => {
16
- Animated.spring(barWidth, {
17
- toValue: progress,
18
- bounciness: 0,
19
- speed: 7,
20
- useNativeDriver: false,
21
- }).start();
22
- }, [progress]);
23
- return (
24
- <View style={[tw`h-2 w-14 bg-slate-200 overflow-hidden mr-2`, {
25
- borderRadius: 40,
26
- }]}>
27
- <Animated.View
28
- style={[StyleSheet.absoluteFill, { backgroundColor: Colors['primary-base'], width: barWidth }]}
29
-
30
- />
31
- </View>
32
- )
33
- }
1
+ import React, { useEffect, useRef, useState } from 'react'
2
+ import { Animated,StyleSheet, View } from 'react-native';
3
+ import tw from "fln-espranza/lib/tailwind";
4
+ import { Colors } from "fln-espranza/utils/Color";
5
+
6
+ interface IProps{
7
+ progress: number;
8
+ }
9
+
10
+ export default function EProgressBar( {progress}: IProps) {
11
+
12
+
13
+ const barWidth = useRef(new Animated.Value(0)).current;
14
+
15
+ useEffect(() => {
16
+ Animated.spring(barWidth, {
17
+ toValue: progress,
18
+ bounciness: 0,
19
+ speed: 7,
20
+ useNativeDriver: false,
21
+ }).start();
22
+ }, [progress]);
23
+ return (
24
+ <View style={[tw`h-2 w-14 bg-slate-200 overflow-hidden mr-2`, {
25
+ borderRadius: 40,
26
+ }]}>
27
+ <Animated.View
28
+ style={[StyleSheet.absoluteFill, { backgroundColor: Colors['primary-base'], width: barWidth }]}
29
+
30
+ />
31
+ </View>
32
+ )
33
+ }
@@ -1,17 +1,17 @@
1
- import React from 'react'
2
- import tw from '../lib/tailwind';
3
- import { Colors } from '../utils/Color';
4
- import EText from './EText';
5
- // import { EText } from '../../../components'
6
-
7
- interface IProps{
8
- label: string;
9
- }
10
-
11
- export default function EQuestionSerialNumberLabel( { label } : IProps) {
12
- return (
13
- <EText size={"sm"} style={[tw`font-extrabold`, {color: Colors['primary-base']}]}>
14
- {label}
15
- </EText>
16
- )
17
- }
1
+ import React from 'react'
2
+ import tw from '../lib/tailwind';
3
+ import { Colors } from '../utils/Color';
4
+ import EText from './EText';
5
+ // import { EText } from '../../../components'
6
+
7
+ interface IProps{
8
+ label: string;
9
+ }
10
+
11
+ export default function EQuestionSerialNumberLabel( { label } : IProps) {
12
+ return (
13
+ <EText size={"sm"} style={[tw`font-extrabold`, {color: Colors['primary-base']}]}>
14
+ {label}
15
+ </EText>
16
+ )
17
+ }
@@ -1,14 +1,14 @@
1
- import React from 'react'
2
- import tw from '../lib/tailwind';
3
- import EText from './EText';
4
- interface IProps{
5
- question: string;
6
- }
7
-
8
- export default function EQuestionText( { question } : IProps) {
9
- return (
10
- <EText size={"base"} style={ tw`font-medium mt-1`}>
11
- {question}
12
- </EText>
13
- )
14
- }
1
+ import React from 'react'
2
+ import tw from '../lib/tailwind';
3
+ import EText from './EText';
4
+ interface IProps{
5
+ question: string;
6
+ }
7
+
8
+ export default function EQuestionText( { question } : IProps) {
9
+ return (
10
+ <EText size={"base"} style={ tw`font-medium mt-1`}>
11
+ {question}
12
+ </EText>
13
+ )
14
+ }
@@ -1,36 +1,36 @@
1
- import { View, Text, Pressable, TouchableOpacity } from "react-native";
2
- import React from "react";
3
- import tw from '../lib/tailwind'
4
- import EText from "./EText";
5
- import { Colors } from "../utils/Color";
6
-
7
- export function ESegmentItem(props: any) {
8
- const { onPress, label, isActive } = props;
9
- return (
10
- <TouchableOpacity
11
- style={tw.style(
12
- "py-1.5 px-4 rounded-full items-center w-1/2",
13
- isActive && "bg-white shadow-lg shadow-slate-500 "
14
- )}
15
- onPress={onPress}
16
- >
17
- <View style={tw`items-center`}>
18
- <EText size="sm" style={tw`font-bold ${!isActive ? "text-white": ""}`}>{label}</EText>
19
- </View>
20
- </TouchableOpacity>
21
- );
22
- }
23
-
24
- export default function ESegment(props: any) {
25
- return (
26
- <View style={tw`justify-center items-center`}>
27
- <View
28
- style={[tw`flex-row rounded-full p-1 border border-slate-100 w-full`, {
29
- backgroundColor: Colors["text-body"],
30
- }]}
31
- >
32
- {props.children}
33
- </View>
34
- </View>
35
- );
36
- }
1
+ import { View, Text, Pressable, TouchableOpacity } from "react-native";
2
+ import React from "react";
3
+ import tw from '../lib/tailwind'
4
+ import EText from "./EText";
5
+ import { Colors } from "../utils/Color";
6
+
7
+ export function ESegmentItem(props: any) {
8
+ const { onPress, label, isActive } = props;
9
+ return (
10
+ <TouchableOpacity
11
+ style={tw.style(
12
+ "py-1.5 px-4 rounded-full items-center w-1/2",
13
+ isActive && "bg-white shadow-lg shadow-slate-500 "
14
+ )}
15
+ onPress={onPress}
16
+ >
17
+ <View style={tw`items-center`}>
18
+ <EText size="sm" style={tw`font-bold ${!isActive ? "text-white": ""}`}>{label}</EText>
19
+ </View>
20
+ </TouchableOpacity>
21
+ );
22
+ }
23
+
24
+ export default function ESegment(props: any) {
25
+ return (
26
+ <View style={tw`justify-center items-center`}>
27
+ <View
28
+ style={[tw`flex-row rounded-full p-1 border border-slate-100 w-full`, {
29
+ backgroundColor: Colors["text-body"],
30
+ }]}
31
+ >
32
+ {props.children}
33
+ </View>
34
+ </View>
35
+ );
36
+ }
@@ -1,24 +1,24 @@
1
- import React from "react";
2
- import { View } from "react-native";
3
- import tw from "../../../lib/tailwind";
4
- import EText from "./EText";
5
-
6
- interface IProps {
7
- stat: string;
8
- label: string;
9
- backgroundColor: string;
10
- lightText?: boolean;
11
- }
12
-
13
- export default function EStat({ stat, label, backgroundColor, lightText }: IProps) {
14
- return (
15
- <View style={tw`mr-1 mt-1 w-[140px] h-[110px] p-3 justify-between shadow-lg shadow-slate-400 rounded-tl-lg rounded-tr-[44px] bg-[${backgroundColor}]`}>
16
- <EText style={tw`font-bold tracking-tight text-2xl ${lightText ? 'text-white' : 'text-slate-900'}`}>
17
- {stat}
18
- </EText>
19
- <EText size="xs" style={tw`mb-1 ${lightText ? 'text-white/90' : 'text-slate-900/90'}`}>
20
- {label}
21
- </EText>
22
- </View>
23
- );
24
- }
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import tw from "../../../lib/tailwind";
4
+ import EText from "./EText";
5
+
6
+ interface IProps {
7
+ stat: string;
8
+ label: string;
9
+ backgroundColor: string;
10
+ lightText?: boolean;
11
+ }
12
+
13
+ export default function EStat({ stat, label, backgroundColor, lightText }: IProps) {
14
+ return (
15
+ <View style={tw`mr-1 mt-1 w-[140px] h-[110px] p-3 justify-between shadow-lg shadow-slate-400 rounded-tl-lg rounded-tr-[44px] bg-[${backgroundColor}]`}>
16
+ <EText style={tw`font-bold tracking-tight text-2xl ${lightText ? 'text-white' : 'text-slate-900'}`}>
17
+ {stat}
18
+ </EText>
19
+ <EText size="xs" style={tw`mb-1 ${lightText ? 'text-white/90' : 'text-slate-900/90'}`}>
20
+ {label}
21
+ </EText>
22
+ </View>
23
+ );
24
+ }
@@ -1,41 +1,41 @@
1
- import { Text, TextProps } from "react-native";
2
- import React from "react";
3
- import tw from "../lib/tailwind";
4
-
5
- interface ETextProps extends TextProps {
6
- size?: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "title";
7
- muted?: boolean;
8
- style?: any;
9
- children?: any;
10
- }
11
-
12
- export default function EText({
13
- size,
14
- muted,
15
- style,
16
- children,
17
- ...props
18
- }: ETextProps) {
19
- return (
20
- <Text
21
- {...props}
22
- style={[
23
- tw.style(
24
- "text-base leading-6",
25
- size === "xs" && "text-xs",
26
- size === "sm" && "text-sm",
27
- size === "base" && "text-base",
28
- size == "lg" && "font-semibold text-lg",
29
- size === "xl" && "font-bold text-xl",
30
- size === "2xl" && "font-bold text-2xl",
31
- size === "3xl" && "font-bold text-3xl",
32
- size === "title" && "font-extrabold text-title text-2xl",
33
- muted && "opacity-60"
34
- ),
35
- style,
36
- ]}
37
- >
38
- {children}
39
- </Text>
40
- );
41
- }
1
+ import { Text, TextProps } from "react-native";
2
+ import React from "react";
3
+ import tw from "../lib/tailwind";
4
+
5
+ interface ETextProps extends TextProps {
6
+ size?: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "title";
7
+ muted?: boolean;
8
+ style?: any;
9
+ children?: any;
10
+ }
11
+
12
+ export default function EText({
13
+ size,
14
+ muted,
15
+ style,
16
+ children,
17
+ ...props
18
+ }: ETextProps) {
19
+ return (
20
+ <Text
21
+ {...props}
22
+ style={[
23
+ tw.style(
24
+ "text-base leading-6",
25
+ size === "xs" && "text-xs",
26
+ size === "sm" && "text-sm",
27
+ size === "base" && "text-base",
28
+ size == "lg" && "font-semibold text-lg",
29
+ size === "xl" && "font-bold text-xl",
30
+ size === "2xl" && "font-bold text-2xl",
31
+ size === "3xl" && "font-bold text-3xl",
32
+ size === "title" && "font-extrabold text-title text-2xl",
33
+ muted && "opacity-60"
34
+ ),
35
+ style,
36
+ ]}
37
+ >
38
+ {children}
39
+ </Text>
40
+ );
41
+ }
@@ -1,53 +1,53 @@
1
- import { View, Text, TextInput, TextInputProps } from "react-native";
2
- import React, { useState } from "react";
3
- import EText from "./EText";
4
- import tw from "../lib/tailwind";
5
-
6
- interface EInputProps extends TextInputProps {
7
- label?: string;
8
- size?: "lg";
9
- hasBackground?: boolean;
10
- icon?: JSX.Element;
11
- }
12
-
13
- export default function ETextArea({
14
- label,
15
- size,
16
- hasBackground,
17
- icon,
18
- ...props
19
- }: EInputProps) {
20
- const [hasFocus, setHasFocus] = useState(false);
21
- return (
22
- <View style={[tw``, {}]}>
23
- {label ? (
24
- <EText size="sm" style={[tw`font-semibold text-slate-800`, {
25
- // color: Colors["text-primary"]
26
- }]}>
27
- {label}
28
- </EText>
29
- ) : null}
30
-
31
- <View
32
- style={tw` mt-2 `}
33
- >
34
- <TextInput
35
- style={[tw`h-24 rounded-lg p-4 border border-slate-300 ${
36
- hasFocus ? "border-black " : ""
37
- }`, {
38
- textAlignVertical: 'top'
39
- }]}
40
- {...props}
41
- multiline = {true}
42
- onFocus={() => setHasFocus(!hasFocus)}
43
- onBlur={() => setHasFocus(!hasFocus)}
44
- />
45
- {
46
- icon ?
47
- <>{icon}</>
48
- : null
49
- }
50
- </View>
51
- </View>
52
- );
53
- }
1
+ import { View, Text, TextInput, TextInputProps } from "react-native";
2
+ import React, { useState } from "react";
3
+ import EText from "./EText";
4
+ import tw from "../lib/tailwind";
5
+
6
+ interface EInputProps extends TextInputProps {
7
+ label?: string;
8
+ size?: "lg";
9
+ hasBackground?: boolean;
10
+ icon?: JSX.Element;
11
+ }
12
+
13
+ export default function ETextArea({
14
+ label,
15
+ size,
16
+ hasBackground,
17
+ icon,
18
+ ...props
19
+ }: EInputProps) {
20
+ const [hasFocus, setHasFocus] = useState(false);
21
+ return (
22
+ <View style={[tw``, {}]}>
23
+ {label ? (
24
+ <EText size="sm" style={[tw`font-semibold text-slate-800`, {
25
+ // color: Colors["text-primary"]
26
+ }]}>
27
+ {label}
28
+ </EText>
29
+ ) : null}
30
+
31
+ <View
32
+ style={tw` mt-2 `}
33
+ >
34
+ <TextInput
35
+ style={[tw`h-24 rounded-lg p-4 border border-slate-300 ${
36
+ hasFocus ? "border-black " : ""
37
+ }`, {
38
+ textAlignVertical: 'top'
39
+ }]}
40
+ {...props}
41
+ multiline = {true}
42
+ onFocus={() => setHasFocus(!hasFocus)}
43
+ onBlur={() => setHasFocus(!hasFocus)}
44
+ />
45
+ {
46
+ icon ?
47
+ <>{icon}</>
48
+ : null
49
+ }
50
+ </View>
51
+ </View>
52
+ );
53
+ }