fln-espranza 0.0.1
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/.expo/README.md +15 -0
- package/.expo/settings.json +8 -0
- package/Readme.md +1 -0
- package/assets/images/bg-header.jpg +0 -0
- package/components/Avatar.tsx +42 -0
- package/components/BaseLayout.tsx +174 -0
- package/components/Container.tsx +12 -0
- package/components/Drawer.tsx +97 -0
- package/components/EBadge.tsx +23 -0
- package/components/EButton.tsx +73 -0
- package/components/EButtonIcon.tsx +37 -0
- package/components/EDateAndTimeCard.tsx +50 -0
- package/components/EDateInput.tsx +55 -0
- package/components/EErrorText.tsx +19 -0
- package/components/EIcon.tsx +28 -0
- package/components/EInfoBox.tsx +41 -0
- package/components/EInput.tsx +52 -0
- package/components/ELabel.tsx +15 -0
- package/components/EListPerson.tsx +40 -0
- package/components/EListSchool.tsx +35 -0
- package/components/EOtpInputBox.tsx +49 -0
- package/components/EPageDescription.tsx +19 -0
- package/components/EPillButton.tsx +26 -0
- package/components/EProfile.tsx +43 -0
- package/components/ESegment.tsx +36 -0
- package/components/EText.tsx +41 -0
- package/components/ETimeInput.tsx +55 -0
- package/components/ETimeLineCard.tsx +68 -0
- package/components/ListFormView.tsx +37 -0
- package/components/Loader.tsx +31 -0
- package/components/MenuItems.tsx +46 -0
- package/components/ModalLayout.tsx +81 -0
- package/components/PageHeader.tsx +129 -0
- package/components/PageHeaderSecondary.tsx +44 -0
- package/components/ProgressBar.tsx +33 -0
- package/components/SecondaryBaseLayout.tsx +120 -0
- package/components/Spacer.tsx +14 -0
- package/components/Timer.tsx +57 -0
- package/components/index.tsx +65 -0
- package/index.ts +76 -0
- package/lib/tailwind.js +8 -0
- package/package.json +26 -0
- package/tailwind.config.js +33 -0
- package/utils/Color.ts +15 -0
package/.expo/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
> Why do I have a folder named ".expo" in my project?
|
|
2
|
+
|
|
3
|
+
The ".expo" folder is created when an Expo project is started using "expo start" command.
|
|
4
|
+
|
|
5
|
+
> What do the files contain?
|
|
6
|
+
|
|
7
|
+
- "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
|
|
8
|
+
- "packager-info.json": contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator.
|
|
9
|
+
- "settings.json": contains the server configuration that is used to serve the application manifest.
|
|
10
|
+
|
|
11
|
+
> Should I commit the ".expo" folder?
|
|
12
|
+
|
|
13
|
+
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
|
|
14
|
+
|
|
15
|
+
Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
|
package/Readme.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# All components which is used to develop the FLN-Espranza Project.
|
|
Binary file
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { View, Image, ImageProps } from "react-native";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import tw from "../lib/tailwind";
|
|
4
|
+
import EText from "./EText";
|
|
5
|
+
|
|
6
|
+
interface AvatarProps {
|
|
7
|
+
size?: "xxs" | "xs" | "sm" | "lg" | "5xl";
|
|
8
|
+
source: string;
|
|
9
|
+
nameFirstLetter?: string;
|
|
10
|
+
textColor?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function Avatar({ size, source, nameFirstLetter, textColor }: AvatarProps) {
|
|
14
|
+
let colors = [
|
|
15
|
+
"#00BE9B",
|
|
16
|
+
"#0993BF",
|
|
17
|
+
"#64748B",
|
|
18
|
+
"#3F3D84",
|
|
19
|
+
"#0993BF",
|
|
20
|
+
"#525252",
|
|
21
|
+
"#EA580C",
|
|
22
|
+
"#2D3A5D",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
let color = colors[Math.floor(Math.random() * colors.length)]
|
|
26
|
+
return (
|
|
27
|
+
<View
|
|
28
|
+
style={tw.style(
|
|
29
|
+
"flex items-center justify-center w-16 h-16 rounded-full overflow-hidden",
|
|
30
|
+
size === "lg" && "w-16 h-16",
|
|
31
|
+
size === "sm" && "w-12 h-12",
|
|
32
|
+
size === "xs" && "w-10 h-10",
|
|
33
|
+
size === "xxs" && "w-7 h-7",
|
|
34
|
+
size === "5xl" && "w-20 h-20",
|
|
35
|
+
`bg-[${color}]`
|
|
36
|
+
)}
|
|
37
|
+
>
|
|
38
|
+
{source ? <Image style={tw`w-full h-full `} source={source} /> :
|
|
39
|
+
<EText style={tw`text-2xl font-extrabold text-white`}>{nameFirstLetter}</EText>}
|
|
40
|
+
</View>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { View, ImageBackground, Dimensions, Animated } from "react-native";
|
|
2
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
4
|
+
import tw from "../lib/tailwind";
|
|
5
|
+
import EText from "./EText";
|
|
6
|
+
import { StatusBar } from "expo-status-bar";
|
|
7
|
+
import { Container, EButton, EButtonIcon, PageHeader } from ".";
|
|
8
|
+
import Constants from "expo-constants";
|
|
9
|
+
import { useNavigation } from "@react-navigation/native";
|
|
10
|
+
|
|
11
|
+
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
12
|
+
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
|
13
|
+
const HEADER_HEIGHT = Constants.statusBarHeight + 60;
|
|
14
|
+
const SCROLL_PADDING_BOTTOM = 100;
|
|
15
|
+
|
|
16
|
+
interface BaseLayoutProps {
|
|
17
|
+
title: string;
|
|
18
|
+
subtitle?: string;
|
|
19
|
+
curved?: boolean;
|
|
20
|
+
headerContent?: JSX.Element;
|
|
21
|
+
children?: JSX.Element;
|
|
22
|
+
iconEnd?: JSX.Element;
|
|
23
|
+
noScroll?: boolean;
|
|
24
|
+
bottomButton?: JSX.Element;
|
|
25
|
+
border?: boolean;
|
|
26
|
+
menuButton?: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default function BaseLayout({
|
|
30
|
+
title,
|
|
31
|
+
subtitle,
|
|
32
|
+
curved,
|
|
33
|
+
headerContent,
|
|
34
|
+
children,
|
|
35
|
+
noScroll,
|
|
36
|
+
iconEnd,
|
|
37
|
+
bottomButton,
|
|
38
|
+
border,
|
|
39
|
+
menuButton,
|
|
40
|
+
}: BaseLayoutProps) {
|
|
41
|
+
const insets = useSafeAreaInsets();
|
|
42
|
+
const [headerScrolled, setHeaderScrolled] = useState(false);
|
|
43
|
+
const scrollY = useRef(new Animated.Value(0)).current;
|
|
44
|
+
const opacity = useRef(new Animated.Value(0)).current;
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
Animated.spring(scrollY, {
|
|
48
|
+
toValue: headerScrolled ? 0 : -40,
|
|
49
|
+
speed: 2,
|
|
50
|
+
delay: 1,
|
|
51
|
+
bounciness: 1,
|
|
52
|
+
useNativeDriver: true,
|
|
53
|
+
}).start();
|
|
54
|
+
|
|
55
|
+
Animated.spring(opacity, {
|
|
56
|
+
toValue: headerScrolled ? 0.975 : 0,
|
|
57
|
+
speed: 2,
|
|
58
|
+
delay: 1,
|
|
59
|
+
bounciness: 1,
|
|
60
|
+
useNativeDriver: true,
|
|
61
|
+
}).start();
|
|
62
|
+
}, [headerScrolled]);
|
|
63
|
+
|
|
64
|
+
const navigation = useNavigation();
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<View
|
|
68
|
+
style={[
|
|
69
|
+
tw`flex-1 bg-white`,
|
|
70
|
+
{
|
|
71
|
+
paddingBottom: noScroll ? 0 : insets.bottom,
|
|
72
|
+
},
|
|
73
|
+
]}
|
|
74
|
+
>
|
|
75
|
+
<StatusBar
|
|
76
|
+
style={headerScrolled ? "light" : curved ? "light" : "dark"}
|
|
77
|
+
animated
|
|
78
|
+
/>
|
|
79
|
+
{/* COLLAPSED HEADER */}
|
|
80
|
+
<Animated.View
|
|
81
|
+
style={[
|
|
82
|
+
tw`absolute top-0 left-0 right-0 bg-white z-10 shadow-2xl`,
|
|
83
|
+
{
|
|
84
|
+
transform: [{ translateY: scrollY }],
|
|
85
|
+
opacity,
|
|
86
|
+
},
|
|
87
|
+
]}
|
|
88
|
+
>
|
|
89
|
+
<ImageBackground
|
|
90
|
+
style={[tw`flex-1`, {}]}
|
|
91
|
+
source={require("../assets/images/bg-header.jpg")}
|
|
92
|
+
>
|
|
93
|
+
<View
|
|
94
|
+
style={[
|
|
95
|
+
tw`flex-1 pl-3 pb-3 flex-row items-center`,
|
|
96
|
+
{ paddingTop: Constants.statusBarHeight + 4 },
|
|
97
|
+
]}
|
|
98
|
+
>
|
|
99
|
+
<EButtonIcon
|
|
100
|
+
iconColor={"white"}
|
|
101
|
+
size={20}
|
|
102
|
+
onPress={() => navigation.goBack()}
|
|
103
|
+
/>
|
|
104
|
+
<View style={tw`ml-2`}>
|
|
105
|
+
<EText size="base" style={tw`font-semibold text-white mb-0.5`}>
|
|
106
|
+
{title}
|
|
107
|
+
</EText>
|
|
108
|
+
{subtitle ? (
|
|
109
|
+
<EText
|
|
110
|
+
size="xs"
|
|
111
|
+
style={tw`font-semibold text-white opacity-40`}
|
|
112
|
+
>
|
|
113
|
+
{subtitle}
|
|
114
|
+
</EText>
|
|
115
|
+
) : null}
|
|
116
|
+
</View>
|
|
117
|
+
</View>
|
|
118
|
+
</ImageBackground>
|
|
119
|
+
</Animated.View>
|
|
120
|
+
|
|
121
|
+
{noScroll ? (
|
|
122
|
+
<View style={tw`flex-1`}>
|
|
123
|
+
<PageHeader
|
|
124
|
+
title={title}
|
|
125
|
+
subtitle={subtitle}
|
|
126
|
+
curved={curved}
|
|
127
|
+
iconEnd={iconEnd}
|
|
128
|
+
>
|
|
129
|
+
{headerContent}
|
|
130
|
+
</PageHeader>
|
|
131
|
+
{children}
|
|
132
|
+
</View>
|
|
133
|
+
) : (
|
|
134
|
+
<Animated.ScrollView
|
|
135
|
+
onScroll={(event) => {
|
|
136
|
+
const scrolling = event.nativeEvent.contentOffset.y;
|
|
137
|
+
scrolling > 60 ? setHeaderScrolled(true) : setHeaderScrolled(false);
|
|
138
|
+
}}
|
|
139
|
+
style={[
|
|
140
|
+
tw`flex-1`,
|
|
141
|
+
{ minHeight: SCREEN_HEIGHT, paddingBottom: SCROLL_PADDING_BOTTOM },
|
|
142
|
+
]}
|
|
143
|
+
scrollEventThrottle={16}
|
|
144
|
+
showsVerticalScrollIndicator={false}
|
|
145
|
+
decelerationRate={"fast"}
|
|
146
|
+
// fadingEdgeLength={1s00}
|
|
147
|
+
// alwaysBounceVertical={false}
|
|
148
|
+
contentContainerStyle={{
|
|
149
|
+
paddingBottom: SCROLL_PADDING_BOTTOM,
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
<PageHeader
|
|
153
|
+
menuButton={menuButton}
|
|
154
|
+
title={title}
|
|
155
|
+
subtitle={subtitle}
|
|
156
|
+
curved={curved}
|
|
157
|
+
iconEnd={iconEnd}
|
|
158
|
+
border={border}
|
|
159
|
+
>
|
|
160
|
+
{headerContent}
|
|
161
|
+
</PageHeader>
|
|
162
|
+
{children}
|
|
163
|
+
</Animated.ScrollView>
|
|
164
|
+
)}
|
|
165
|
+
{bottomButton ? (
|
|
166
|
+
<Container style={tw`flex-1 justify-end mb-4 `}>
|
|
167
|
+
{bottomButton}
|
|
168
|
+
</Container>
|
|
169
|
+
) : (
|
|
170
|
+
<></>
|
|
171
|
+
)}
|
|
172
|
+
</View>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { View, Text } from "react-native";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import tw from "../lib/tailwind";
|
|
4
|
+
|
|
5
|
+
export default function Container(props: any) {
|
|
6
|
+
const { fullWidth, style } = props;
|
|
7
|
+
return (
|
|
8
|
+
<View style={tw.style("flex-1 px-4 ", fullWidth && "px-0 ", style)}>
|
|
9
|
+
{props.children}
|
|
10
|
+
</View>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ScrollView, View, TouchableOpacity } from "react-native";
|
|
3
|
+
import { HomeIcon,CalendarIcon, TemplateIcon, ViewBoardsIcon } from 'react-native-heroicons/solid';
|
|
4
|
+
import { StyleSheet } from 'react-native';
|
|
5
|
+
import tw from "../lib/tailwind";
|
|
6
|
+
import EText from "./EText";
|
|
7
|
+
import Spacer from "./Spacer";
|
|
8
|
+
import Avatar from "./Avatar";
|
|
9
|
+
import { Colors } from "../utils/Color";
|
|
10
|
+
import MenuItems from "./MenuItems";
|
|
11
|
+
|
|
12
|
+
type menuItems = {
|
|
13
|
+
title: string,
|
|
14
|
+
icon: any,
|
|
15
|
+
screen: string,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface IProps{
|
|
19
|
+
name: string,
|
|
20
|
+
profile: string,
|
|
21
|
+
menuItems: menuItems[];
|
|
22
|
+
navigation: any;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const Drawer = ({name,profile, menuItems,navigation }: IProps) => {
|
|
26
|
+
return (
|
|
27
|
+
<ScrollView
|
|
28
|
+
scrollEnabled={true}
|
|
29
|
+
showsVerticalScrollIndicator={false}
|
|
30
|
+
style={{
|
|
31
|
+
position: 'relative',
|
|
32
|
+
backgroundColor: '#ffffff',
|
|
33
|
+
}}>
|
|
34
|
+
<View style={tw`mx-4 pt-4`}>
|
|
35
|
+
<Spacer height={30} />
|
|
36
|
+
|
|
37
|
+
<View style={tw`flex w-full mt-5`}>
|
|
38
|
+
<View style={tw`flex-row items-center`}>
|
|
39
|
+
<Avatar
|
|
40
|
+
size="sm"
|
|
41
|
+
source={""}
|
|
42
|
+
nameFirstLetter={name?.split("")[0]}
|
|
43
|
+
/>
|
|
44
|
+
<View style={tw`ml-3`}>
|
|
45
|
+
<EText size={"xl"} style={tw`font-bold -mt-1`}>{name}</EText>
|
|
46
|
+
<EText size="sm" style={[tw`font-normal`, {
|
|
47
|
+
color: Colors["text-body"]
|
|
48
|
+
}]}>
|
|
49
|
+
{profile}
|
|
50
|
+
</EText>
|
|
51
|
+
</View>
|
|
52
|
+
</View>
|
|
53
|
+
</View>
|
|
54
|
+
|
|
55
|
+
<Spacer height={30} />
|
|
56
|
+
{
|
|
57
|
+
menuItems.map((item, index) => {
|
|
58
|
+
return (
|
|
59
|
+
<MenuItems
|
|
60
|
+
key={index}
|
|
61
|
+
title={item.title}
|
|
62
|
+
icon={item.icon}
|
|
63
|
+
onPress={() => navigation.navigate(item.screen)}
|
|
64
|
+
/>
|
|
65
|
+
)
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
<Spacer />
|
|
69
|
+
<Spacer />
|
|
70
|
+
<MenuItems
|
|
71
|
+
title="Profile"
|
|
72
|
+
onPress={() => navigation.navigate("ProfileScreen")}
|
|
73
|
+
/>
|
|
74
|
+
<MenuItems
|
|
75
|
+
title="Settings"
|
|
76
|
+
/>
|
|
77
|
+
<MenuItems
|
|
78
|
+
title="Logout"
|
|
79
|
+
/>
|
|
80
|
+
</View>
|
|
81
|
+
</ScrollView>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const styles = StyleSheet.create({
|
|
86
|
+
container: {
|
|
87
|
+
backgroundColor: '#fff',
|
|
88
|
+
padding: 10,
|
|
89
|
+
},
|
|
90
|
+
logoStyle: {
|
|
91
|
+
height: 20,
|
|
92
|
+
width: '80%',
|
|
93
|
+
alignSelf: 'center',
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export default Drawer;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { View } from 'react-native'
|
|
3
|
+
import tw from '../lib/tailwind';
|
|
4
|
+
import EText from './EText';
|
|
5
|
+
import { CheckCircleIcon } from 'react-native-heroicons/solid';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
interface IProps {
|
|
9
|
+
text: string;
|
|
10
|
+
color?: string;
|
|
11
|
+
completed?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default function EBadge({ text, completed, color }: IProps) {
|
|
15
|
+
return (
|
|
16
|
+
<View style={[tw`rounded-full flex-row p-1 px-2 ${completed ? 'bg-green-600' : color}`, ]}>
|
|
17
|
+
{completed ? <CheckCircleIcon style={tw`text-white -ml-1 mr-1`} size={16} /> : null}
|
|
18
|
+
<EText size='xs' style={tw`font-semibold text-white`}>
|
|
19
|
+
{text}
|
|
20
|
+
</EText>
|
|
21
|
+
</View>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
View,
|
|
3
|
+
Text,
|
|
4
|
+
TouchableOpacity,
|
|
5
|
+
TouchableOpacityProps,
|
|
6
|
+
} from "react-native";
|
|
7
|
+
import React from "react";
|
|
8
|
+
import tw from "../lib/tailwind";
|
|
9
|
+
import EText from "./EText";
|
|
10
|
+
import { Colors } from "../utils/Color";
|
|
11
|
+
|
|
12
|
+
interface EButtonProps extends TouchableOpacityProps {
|
|
13
|
+
iconL?: JSX.Element;
|
|
14
|
+
iconR?: JSX.Element;
|
|
15
|
+
secondary?: boolean;
|
|
16
|
+
inline?: boolean;
|
|
17
|
+
small?: boolean;
|
|
18
|
+
type?: "secondary" | "clear" | "primary";
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
children: any;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default function EButton({
|
|
24
|
+
// label,
|
|
25
|
+
children,
|
|
26
|
+
iconL,
|
|
27
|
+
iconR,
|
|
28
|
+
secondary,
|
|
29
|
+
inline,
|
|
30
|
+
small,
|
|
31
|
+
type,
|
|
32
|
+
disabled,
|
|
33
|
+
...props
|
|
34
|
+
}: EButtonProps) {
|
|
35
|
+
return (
|
|
36
|
+
<TouchableOpacity
|
|
37
|
+
activeOpacity={0.8}
|
|
38
|
+
disabled={disabled}
|
|
39
|
+
{...props}
|
|
40
|
+
style={[tw`${inline ? "items-start" : ""}`, {}]}
|
|
41
|
+
>
|
|
42
|
+
<View
|
|
43
|
+
style={[
|
|
44
|
+
tw`h-14 flex-row justify-center items-center px-8 rounded-full ${disabled ? "opacity-60" : ""} ${
|
|
45
|
+
type === "clear"
|
|
46
|
+
? "bg-transparent"
|
|
47
|
+
: type === "secondary"
|
|
48
|
+
? `bg-[${Colors["secondary-base"]}] self-start px-5 h-11`
|
|
49
|
+
: `bg-[${Colors["primary-base"]}]`
|
|
50
|
+
}`,
|
|
51
|
+
]}
|
|
52
|
+
>
|
|
53
|
+
{/* ICON LEFT */}
|
|
54
|
+
{iconL ? <View style={tw`mr-1 -ml-2`}>{iconL}</View> : null}
|
|
55
|
+
{/* LABEL */}
|
|
56
|
+
<EText
|
|
57
|
+
size={"base"}
|
|
58
|
+
style={[
|
|
59
|
+
tw`font-semibold ${
|
|
60
|
+
type === "clear" ? `text-[${Colors["primary-base"]}]` : "text-white"
|
|
61
|
+
}`,
|
|
62
|
+
]}
|
|
63
|
+
>
|
|
64
|
+
{children }
|
|
65
|
+
</EText>
|
|
66
|
+
|
|
67
|
+
{/* ICON RIGHT */}
|
|
68
|
+
{iconR ? <View style={tw`ml-1 -mr-2`}>{iconR}</View> : null}
|
|
69
|
+
</View>
|
|
70
|
+
</TouchableOpacity>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { View, TouchableOpacity, TouchableOpacityProps } from "react-native";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import tw from "../lib/tailwind";
|
|
4
|
+
import { ArrowNarrowLeftIcon, XIcon } from "react-native-heroicons/solid";
|
|
5
|
+
|
|
6
|
+
interface EButtonIconProps extends TouchableOpacityProps {
|
|
7
|
+
type?: "close";
|
|
8
|
+
backgroundColor?: string;
|
|
9
|
+
iconColor?: string | "slate-900";
|
|
10
|
+
size?: number | 20;
|
|
11
|
+
shadow?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default function EButtonIcon({
|
|
15
|
+
type,
|
|
16
|
+
backgroundColor,
|
|
17
|
+
iconColor,
|
|
18
|
+
size,
|
|
19
|
+
shadow,
|
|
20
|
+
...props
|
|
21
|
+
}: EButtonIconProps) {
|
|
22
|
+
return (
|
|
23
|
+
<TouchableOpacity {...props}>
|
|
24
|
+
<View
|
|
25
|
+
style={tw`h-9 w-9 items-center justify-center bg-${backgroundColor ? backgroundColor : ""} rounded-full ${
|
|
26
|
+
shadow ? "shadow-xl shadow-slate-400" : ""
|
|
27
|
+
}`}
|
|
28
|
+
>
|
|
29
|
+
{type === "close" ? (
|
|
30
|
+
<XIcon size={20} style={tw`text-${iconColor? iconColor: ""}`} />
|
|
31
|
+
) : (
|
|
32
|
+
<ArrowNarrowLeftIcon size={20} style={tw`text-${iconColor? iconColor : ""}`} />
|
|
33
|
+
)}
|
|
34
|
+
</View>
|
|
35
|
+
</TouchableOpacity>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import { ClockIcon } from "react-native-heroicons/solid";
|
|
4
|
+
import tw from "../lib/tailwind";
|
|
5
|
+
import { Colors } from "../utils/Color";
|
|
6
|
+
import EText from "./EText";
|
|
7
|
+
|
|
8
|
+
interface IProps{
|
|
9
|
+
date: string;
|
|
10
|
+
month: string;
|
|
11
|
+
day: string;
|
|
12
|
+
time: string;
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default function EDateAndTimeCard( {date, month, day, time}: IProps) {
|
|
17
|
+
return (
|
|
18
|
+
<View
|
|
19
|
+
style={[tw`flex-row pb-4 border-b`, { borderBottomColor: Colors.border }]}
|
|
20
|
+
>
|
|
21
|
+
<View
|
|
22
|
+
style={[
|
|
23
|
+
tw`rounded-xl mb-2 px-3 py-1 items-center justify-center`,
|
|
24
|
+
{ backgroundColor: Colors["primary-base"] },
|
|
25
|
+
]}
|
|
26
|
+
>
|
|
27
|
+
<EText size="xl" style={tw`font-bold text-white -mb-1`}>
|
|
28
|
+
{date}
|
|
29
|
+
</EText>
|
|
30
|
+
<EText size="xs" style={tw`font-bold text-white`}>
|
|
31
|
+
{month}
|
|
32
|
+
</EText>
|
|
33
|
+
</View>
|
|
34
|
+
<View style={tw`ml-3`}>
|
|
35
|
+
<EText size="base" style={tw`font-bold text-black opacity-80 -mb-1`}>
|
|
36
|
+
{day}
|
|
37
|
+
</EText>
|
|
38
|
+
<View style={tw`flex-row justify-center items-center mt-2`}>
|
|
39
|
+
<ClockIcon size={14} style={tw`text-slate-400`} />
|
|
40
|
+
<EText
|
|
41
|
+
size="sm"
|
|
42
|
+
style={tw`ml-0.5 text-slate-400 font-medium`}
|
|
43
|
+
>
|
|
44
|
+
{time}
|
|
45
|
+
</EText>
|
|
46
|
+
</View>
|
|
47
|
+
</View>
|
|
48
|
+
</View>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import moment from 'moment'
|
|
2
|
+
import React, { useState } from 'react'
|
|
3
|
+
import { View, TouchableOpacity } from 'react-native'
|
|
4
|
+
import { ClockIcon } from 'react-native-heroicons/solid'
|
|
5
|
+
import { onChange } from 'react-native-reanimated'
|
|
6
|
+
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
7
|
+
import tw from '../../../lib/tailwind'
|
|
8
|
+
import { CalendarIcon } from 'react-native-heroicons/outline';
|
|
9
|
+
import EText from './EText';
|
|
10
|
+
import ELabel from './ELabel';
|
|
11
|
+
|
|
12
|
+
interface IProps {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
onChange: (value: string) => void;
|
|
16
|
+
style?: string;
|
|
17
|
+
maxDate?: Date;
|
|
18
|
+
minDate?: Date;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default function EDateInput({ label, value, style, maxDate, minDate, onChange }: IProps) {
|
|
22
|
+
const [show, setShow] = useState(false);
|
|
23
|
+
|
|
24
|
+
const handleOnChange = (event: any, selectedDate: any) => {
|
|
25
|
+
const currentDate = selectedDate;
|
|
26
|
+
setShow(false);
|
|
27
|
+
onChange(currentDate)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
|
|
32
|
+
<View style={tw`flex-1 ${style ? style : ""}`}>
|
|
33
|
+
<ELabel label={label} />
|
|
34
|
+
<TouchableOpacity
|
|
35
|
+
style={tw`h-12 rounded-lg px-4 flex-row justify-between items-center border border-slate-300 lowercase my-2 bg-white`}
|
|
36
|
+
onPress={() => setShow(true)}
|
|
37
|
+
>
|
|
38
|
+
<EText size={"sm"} style={tw`font-normal`}>
|
|
39
|
+
{
|
|
40
|
+
value ? moment(value).format("DD/MM/YYYY") : "Select Date"
|
|
41
|
+
}
|
|
42
|
+
</EText>
|
|
43
|
+
{show ? <DateTimePicker
|
|
44
|
+
testID="dateTimePicker"
|
|
45
|
+
value={value ? new Date(value) : new Date()}
|
|
46
|
+
mode={"date"}
|
|
47
|
+
onChange={handleOnChange}
|
|
48
|
+
minimumDate={minDate}
|
|
49
|
+
maximumDate={maxDate}
|
|
50
|
+
/> : <></>}
|
|
51
|
+
<CalendarIcon size={20} style={tw`text-slate-500`} />
|
|
52
|
+
</TouchableOpacity>
|
|
53
|
+
</View>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import tw from '../lib/tailwind';
|
|
4
|
+
import EText from './EText';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
interface IProps {
|
|
8
|
+
error: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default function EErrorText( { error }: IProps ) {
|
|
12
|
+
return (
|
|
13
|
+
<View>
|
|
14
|
+
<EText size={"xs"} style={tw`text-red-500`}>
|
|
15
|
+
{error}
|
|
16
|
+
</EText>
|
|
17
|
+
</View>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { View, Text, Image, ImagePropTypes, ImageProps } from "react-native";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import tw from "../lib/tailwind";
|
|
4
|
+
|
|
5
|
+
interface EIconProps extends ImageProps {
|
|
6
|
+
source: string;
|
|
7
|
+
size?: number | 24;
|
|
8
|
+
tintColor?: string | "slate-900";
|
|
9
|
+
opacity?: number;
|
|
10
|
+
style?: string,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function EIcon({
|
|
14
|
+
source,
|
|
15
|
+
size,
|
|
16
|
+
tintColor,
|
|
17
|
+
opacity,
|
|
18
|
+
style,
|
|
19
|
+
}: EIconProps) {
|
|
20
|
+
return (
|
|
21
|
+
<View style={[{height: size, width: size}, style]}>
|
|
22
|
+
<Image
|
|
23
|
+
source={source}
|
|
24
|
+
style={[tw`w-full h-full tint-${tintColor ? tintColor : "slate-900"} opacity-${opacity ? opacity : "100"}`, {}]}
|
|
25
|
+
/>
|
|
26
|
+
</View>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { View, Text } from "react-native";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import tw from "../lib/tailwind";
|
|
4
|
+
import EText from "./EText";
|
|
5
|
+
import { Style } from "twrnc/dist/esm/types";
|
|
6
|
+
|
|
7
|
+
interface InfoBoxProps {
|
|
8
|
+
title?: string;
|
|
9
|
+
icon: JSX.Element;
|
|
10
|
+
children: string;
|
|
11
|
+
color?: string;
|
|
12
|
+
style?: Style;
|
|
13
|
+
childTextColor?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default function InfoBox({
|
|
17
|
+
title,
|
|
18
|
+
icon,
|
|
19
|
+
color,
|
|
20
|
+
children,
|
|
21
|
+
style,
|
|
22
|
+
childTextColor,
|
|
23
|
+
}: InfoBoxProps) {
|
|
24
|
+
return (
|
|
25
|
+
<View style={[tw.style("rounded-lg"), style]}>
|
|
26
|
+
<View style={tw`flex-row`}>
|
|
27
|
+
<View style={tw`w-5 h-5 mr-1`}>{icon}</View>
|
|
28
|
+
<View style={tw`flex-1`}>
|
|
29
|
+
{title ? (
|
|
30
|
+
<EText size="sm" style={tw`font-semibold mb-1 text-${color ? color : "white"}`}>
|
|
31
|
+
{title}
|
|
32
|
+
</EText>
|
|
33
|
+
) : null}
|
|
34
|
+
<EText size="xs" style={[tw`font-medium`, {color: childTextColor}]}>
|
|
35
|
+
{children}
|
|
36
|
+
</EText>
|
|
37
|
+
</View>
|
|
38
|
+
</View>
|
|
39
|
+
</View>
|
|
40
|
+
);
|
|
41
|
+
}
|