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,49 +1,49 @@
1
- import { View, Image, TextInput, TextInputProps } from "react-native";
2
- import React, { useState } from "react";
3
- import EText from "./EText";
4
- import tw from "../lib/tailwind";
5
- import { AtSymbolIcon } from "react-native-heroicons/outline";
6
- import { Colors } from "../utils/Color";
7
-
8
- interface EInputProps extends TextInputProps {
9
- label?: string;
10
- icon?:string;
11
- val?: string;
12
- setVal?: any;
13
- maxLength?: number;
14
- reff?: any;
15
- }
16
-
17
- export default function EOtpInput({label, icon,val,setVal, maxLength, reff, ...props }:EInputProps) {
18
- const [hasFocus, setHasFocus] = useState(false);
19
- return (
20
- <View>
21
- <EText size="sm" style={tw`font-bold opacity-50`}>
22
- {label}
23
- </EText>
24
- <View
25
- style={tw`bg-[${Colors["primary-light"]}] h-12 rounded-lg px-4 flex-row items-center border border-blue-100 ${
26
- hasFocus ? `border-black bg-white shadow-lg shadow-blue-400` : ""
27
- }`}
28
- >
29
- {icon ? <Image
30
- source={icon}
31
- style={[
32
- tw`mr-2 opacity-40 ${hasFocus ? "opacity-100 tint-blue-700" : ""}`,
33
- { width: 24, height: 24 },
34
- ]}
35
- /> : null}
36
- <TextInput
37
- {...props}
38
- style={[tw`flex-1 text-base`, { lineHeight: 20 }]}
39
- onFocus={() => setHasFocus(!hasFocus)}
40
- onBlur={() => setHasFocus(!hasFocus)}
41
- placeholderTextColor={"#AEB3BC"}
42
- onChangeText={(val) => setVal(val)}
43
- maxLength={maxLength}
44
- ref={reff}
45
- />
46
- </View>
47
- </View>
48
- );
49
- }
1
+ import { View, Image, TextInput, TextInputProps } from "react-native";
2
+ import React, { useState } from "react";
3
+ import EText from "./EText";
4
+ import tw from "../lib/tailwind";
5
+ import { AtSymbolIcon } from "react-native-heroicons/outline";
6
+ import { Colors } from "../utils/Color";
7
+
8
+ interface EInputProps extends TextInputProps {
9
+ label?: string;
10
+ icon?:string;
11
+ val?: string;
12
+ setVal?: any;
13
+ maxLength?: number;
14
+ reff?: any;
15
+ }
16
+
17
+ export default function EOtpInput({label, icon,val,setVal, maxLength, reff, ...props }:EInputProps) {
18
+ const [hasFocus, setHasFocus] = useState(false);
19
+ return (
20
+ <View>
21
+ <EText size="sm" style={tw`font-bold opacity-50`}>
22
+ {label}
23
+ </EText>
24
+ <View
25
+ style={tw`bg-[${Colors["primary-light"]}] h-12 rounded-lg px-4 flex-row items-center border border-blue-100 ${
26
+ hasFocus ? `border-black bg-white shadow-lg shadow-blue-400` : ""
27
+ }`}
28
+ >
29
+ {icon ? <Image
30
+ source={icon}
31
+ style={[
32
+ tw`mr-2 opacity-40 ${hasFocus ? "opacity-100 tint-blue-700" : ""}`,
33
+ { width: 24, height: 24 },
34
+ ]}
35
+ /> : null}
36
+ <TextInput
37
+ {...props}
38
+ style={[tw`flex-1 text-base`, { lineHeight: 20 }]}
39
+ onFocus={() => setHasFocus(!hasFocus)}
40
+ onBlur={() => setHasFocus(!hasFocus)}
41
+ placeholderTextColor={"#AEB3BC"}
42
+ onChangeText={(val) => setVal(val)}
43
+ maxLength={maxLength}
44
+ ref={reff}
45
+ />
46
+ </View>
47
+ </View>
48
+ );
49
+ }
@@ -1,19 +1,19 @@
1
- import React from 'react'
2
- import tw from '../lib/tailwind'
3
- import { Colors } from '../utils/Color';
4
- import EText from './EText';
5
-
6
- interface IProps{
7
- text: string;
8
- }
9
-
10
- export default function EPageDescription({text}: IProps) {
11
- return (
12
- <EText
13
- size='sm'
14
- style={[tw`font-normal`, {color: Colors['text-body']}]}
15
- >
16
- {text}
17
- </EText>
18
- )
19
- }
1
+ import React from 'react'
2
+ import tw from '../lib/tailwind'
3
+ import { Colors } from '../utils/Color';
4
+ import EText from './EText';
5
+
6
+ interface IProps{
7
+ text: string;
8
+ }
9
+
10
+ export default function EPageDescription({text}: IProps) {
11
+ return (
12
+ <EText
13
+ size='sm'
14
+ style={[tw`font-normal`, {color: Colors['text-body']}]}
15
+ >
16
+ {text}
17
+ </EText>
18
+ )
19
+ }
@@ -1,33 +1,33 @@
1
- import React from "react";
2
- import { TouchableOpacity, View } from "react-native";
3
- import tw from "../lib/tailwind";
4
- import { Colors } from "../utils/Color";
5
- import EText from "./EText";
6
-
7
- interface IProps {
8
- title: string;
9
- active?: boolean;
10
- onPress?: () => void;
11
- }
12
-
13
- export default function EPillButton({ title, active, onPress }: IProps) {
14
- return (
15
- <TouchableOpacity
16
- style={[
17
- tw`px-4 py-3 mr-2 border rounded-lg border-slate-300`,
18
- {
19
- backgroundColor: active ? Colors["secondary-base"] : "transparent",
20
- borderColor: active ? Colors["secondary-base"] : Colors["border"],
21
- },
22
- ]}
23
- onPress={onPress}
24
- >
25
- <EText
26
- size={"base"}
27
- style={tw`font-normal ${active ? "text-white" : "text-slate-500"}`}
28
- >
29
- {title}
30
- </EText>
31
- </TouchableOpacity>
32
- );
33
- }
1
+ import React from "react";
2
+ import { TouchableOpacity, View } from "react-native";
3
+ import tw from "../lib/tailwind";
4
+ import { Colors } from "../utils/Color";
5
+ import EText from "./EText";
6
+
7
+ interface IProps {
8
+ title: string;
9
+ active?: boolean;
10
+ onPress?: () => void;
11
+ }
12
+
13
+ export default function EPillButton({ title, active, onPress }: IProps) {
14
+ return (
15
+ <TouchableOpacity
16
+ style={[
17
+ tw`px-4 py-3 mr-2 border rounded-lg border-slate-300`,
18
+ {
19
+ backgroundColor: active ? Colors["secondary-base"] : "transparent",
20
+ borderColor: active ? Colors["secondary-base"] : Colors["border"],
21
+ },
22
+ ]}
23
+ onPress={onPress}
24
+ >
25
+ <EText
26
+ size={"base"}
27
+ style={tw`font-normal ${active ? "text-white" : "text-slate-500"}`}
28
+ >
29
+ {title}
30
+ </EText>
31
+ </TouchableOpacity>
32
+ );
33
+ }
@@ -1,62 +1,62 @@
1
- import React from "react";
2
- import { View } from "react-native";
3
- import tw from "../lib/tailwind";
4
- import { Colors } from "../utils/Color";
5
- import Avatar from "./Avatar";
6
- import EText from "./EText";
7
-
8
- interface IProps {
9
- name: string;
10
- subjectName?: string;
11
- border?: boolean;
12
- children?: JSX.Element;
13
- titleSize: string;
14
- subTitleSize: string;
15
- }
16
-
17
- export default function EProfile({
18
- name,
19
- subjectName,
20
- border,
21
- children,
22
- titleSize,
23
- subTitleSize,
24
- }: IProps) {
25
- return (
26
- <View
27
- style={[
28
- tw`flex-row items-center justify-between py-3 ${
29
- border ? "border-b" : ""
30
- }`,
31
- { borderBottomColor: Colors.border },
32
- ]}
33
- >
34
- <View style={tw`flex-row items-center`}>
35
- <Avatar
36
- size="sm"
37
- source={""}
38
- nameFirstLetter={name.split(" ")[0].charAt(0)}
39
- />
40
- <View style={tw`ml-3`}>
41
- <EText
42
- style={[
43
- tw`font-bold text-slate-800 mb-0.5 capitalize ${titleSize}`,
44
- { color: Colors["text-primary"] },
45
- ]}
46
- >
47
- {name}
48
- </EText>
49
- {subjectName ? (
50
- <EText
51
- size="sm"
52
- style={[tw` ${subTitleSize}`, { color: Colors["text-body"] }]}
53
- >
54
- {subjectName}
55
- </EText>
56
- ) : null}
57
- </View>
58
- </View>
59
- {children ? <>{children}</> : null}
60
- </View>
61
- );
62
- }
1
+ import React from "react";
2
+ import { View } from "react-native";
3
+ import tw from "../lib/tailwind";
4
+ import { Colors } from "../utils/Color";
5
+ import Avatar from "./Avatar";
6
+ import EText from "./EText";
7
+
8
+ interface IProps {
9
+ name: string;
10
+ subjectName?: string;
11
+ border?: boolean;
12
+ children?: JSX.Element;
13
+ titleSize: string;
14
+ subTitleSize: string;
15
+ }
16
+
17
+ export default function EProfile({
18
+ name,
19
+ subjectName,
20
+ border,
21
+ children,
22
+ titleSize,
23
+ subTitleSize,
24
+ }: IProps) {
25
+ return (
26
+ <View
27
+ style={[
28
+ tw`flex-row items-center justify-between py-3 ${
29
+ border ? "border-b" : ""
30
+ }`,
31
+ { borderBottomColor: Colors.border },
32
+ ]}
33
+ >
34
+ <View style={tw`flex-row items-center`}>
35
+ <Avatar
36
+ size="sm"
37
+ source={""}
38
+ nameFirstLetter={name.split(" ")[0].charAt(0)}
39
+ />
40
+ <View style={tw`ml-3`}>
41
+ <EText
42
+ style={[
43
+ tw`font-bold text-slate-800 mb-0.5 capitalize ${titleSize}`,
44
+ { color: Colors["text-primary"] },
45
+ ]}
46
+ >
47
+ {name}
48
+ </EText>
49
+ {subjectName ? (
50
+ <EText
51
+ size="sm"
52
+ style={[tw` ${subTitleSize}`, { color: Colors["text-body"] }]}
53
+ >
54
+ {subjectName}
55
+ </EText>
56
+ ) : null}
57
+ </View>
58
+ </View>
59
+ {children ? <>{children}</> : null}
60
+ </View>
61
+ );
62
+ }
@@ -0,0 +1,110 @@
1
+ import { Animated, ImageBackground, View } from "react-native";
2
+ import tw from "../../lib/tailwind";
3
+ import EButtonIcon from "./EButtonIcon";
4
+ import EText from "./EText";
5
+ import React, { useCallback, useRef } from "react";
6
+ import Constants from "expo-constants";
7
+ import { SCREEN_HEIGHT } from "@gorhom/bottom-sheet";
8
+ import { useFocusEffect, useNavigation } from "@react-navigation/native";
9
+ import { StatusBar } from "expo-status-bar";
10
+ import ProfileHeader from "./ProfileHeader";
11
+
12
+
13
+ interface IProps {
14
+ profileName: string;
15
+ titleText?: string;
16
+ uniqueCode: string;
17
+ body: JSX.Element;
18
+ }
19
+
20
+ export default function EProfileScreenLayout( { profileName, uniqueCode, body, titleText } : IProps) {
21
+ const opacity = useRef(new Animated.Value(0)).current;
22
+ const [headerScrolled, setHeaderScrolled] = React.useState(false);
23
+ const scrollY = useRef(new Animated.Value(0)).current;
24
+ const navigation = useNavigation();
25
+
26
+ React.useEffect(() => {
27
+ Animated.spring(scrollY, {
28
+ toValue: headerScrolled ? 0 : -100,
29
+ speed: 2,
30
+ delay: 1,
31
+ bounciness: 1,
32
+ useNativeDriver: true,
33
+ }).start();
34
+
35
+ Animated.spring(opacity, {
36
+ toValue: headerScrolled ? 0.975 : 0,
37
+ speed: 2,
38
+ delay: 1,
39
+ bounciness: 1,
40
+ useNativeDriver: true,
41
+ }).start();
42
+ }, [headerScrolled]);
43
+
44
+
45
+
46
+ return (
47
+ <View style={tw``}>
48
+ <StatusBar
49
+ style={"light"}
50
+ animated
51
+ />
52
+ <Animated.View
53
+ style={[
54
+ tw`absolute top-0 left-0 right-0 z-10`,
55
+ {
56
+ transform: [{ translateY: scrollY }],
57
+ opacity,
58
+ },
59
+ ]}
60
+ >
61
+ <ImageBackground
62
+ style={[tw`flex-1`, {}]}
63
+ source={require("../assets/images/bg-profile.jpg")}
64
+ >
65
+ <View
66
+ style={[
67
+ tw`flex-1 pl-3 pb-3 flex-row items-center `,
68
+ { paddingTop: Constants.statusBarHeight + 4 },
69
+ ]}
70
+ >
71
+ <EButtonIcon
72
+ iconColor={"white"}
73
+ size={20}
74
+ onPress={() => navigation.goBack()}
75
+ />
76
+ <EText size="lg" style={tw`text-white font-bold ml-2`}>
77
+ Profile
78
+ </EText>
79
+ </View>
80
+ </ImageBackground>
81
+ </Animated.View>
82
+
83
+ <Animated.ScrollView
84
+ onScroll={(event) => {
85
+ const scrolling = event.nativeEvent.contentOffset.y;
86
+ scrolling > 40 ? setHeaderScrolled(true) : setHeaderScrolled(false);
87
+ }}
88
+ style={[tw`flex-1 bg-white`, { minHeight: SCREEN_HEIGHT, paddingBottom: 100 }]}
89
+ scrollEventThrottle={16}
90
+ showsVerticalScrollIndicator={false}
91
+ decelerationRate={"fast"}
92
+ contentContainerStyle={{
93
+ paddingBottom: 100
94
+ }}
95
+ >
96
+
97
+ <ProfileHeader
98
+ name={profileName?.trim() || ""}
99
+ title={uniqueCode || ""}
100
+ titleText={titleText ? titleText : "Unique Code"}
101
+ />
102
+
103
+ <View style={tw`px-4 mt-8 flex-1`}>
104
+ {body}
105
+ </View>
106
+
107
+ </Animated.ScrollView>
108
+ </View>
109
+ );
110
+ }
@@ -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
+ }