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
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { View, Text, TextInput, TextInputProps } from "react-native";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import EText from "./EText";
|
|
4
|
+
import { SearchIcon } from "react-native-heroicons/solid";
|
|
5
|
+
import { Colors } from "../utils/Color";
|
|
6
|
+
import tw from "../lib/tailwind";
|
|
7
|
+
|
|
8
|
+
interface EInputProps extends TextInputProps {
|
|
9
|
+
label?: string;
|
|
10
|
+
size?: "lg";
|
|
11
|
+
hasBackground?: boolean;
|
|
12
|
+
icon?: JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default function EInput({
|
|
16
|
+
label,
|
|
17
|
+
size,
|
|
18
|
+
hasBackground,
|
|
19
|
+
icon,
|
|
20
|
+
...props
|
|
21
|
+
}: EInputProps) {
|
|
22
|
+
const [hasFocus, setHasFocus] = useState(false);
|
|
23
|
+
return (
|
|
24
|
+
<View style={[tw`mb-4`, {}]}>
|
|
25
|
+
{label ? (
|
|
26
|
+
<EText size="sm" style={[tw`font-semibold text-slate-800`, {
|
|
27
|
+
// color: Colors["text-primary"]
|
|
28
|
+
}]}>
|
|
29
|
+
{label}
|
|
30
|
+
</EText>
|
|
31
|
+
) : null}
|
|
32
|
+
|
|
33
|
+
<View
|
|
34
|
+
style={tw` mt-2 `}
|
|
35
|
+
>
|
|
36
|
+
<TextInput
|
|
37
|
+
style={tw`h-12 rounded-lg px-4 flex-row items-center border border-slate-300 ${
|
|
38
|
+
hasFocus ? "border-black shadow-md" : ""
|
|
39
|
+
}`}
|
|
40
|
+
{...props}
|
|
41
|
+
onFocus={() => setHasFocus(!hasFocus)}
|
|
42
|
+
onBlur={() => setHasFocus(!hasFocus)}
|
|
43
|
+
/>
|
|
44
|
+
{
|
|
45
|
+
icon ?
|
|
46
|
+
<>{icon}</>
|
|
47
|
+
: null
|
|
48
|
+
}
|
|
49
|
+
</View>
|
|
50
|
+
</View>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import tw from '../lib/tailwind'
|
|
3
|
+
import EText from './EText';
|
|
4
|
+
|
|
5
|
+
interface IProps{
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function ELabel( {label }: IProps ) {
|
|
10
|
+
return (
|
|
11
|
+
<EText style={tw`text-sm font-semibold text-slate-500`}>
|
|
12
|
+
{label}
|
|
13
|
+
</EText>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import tw from "../lib/tailwind";
|
|
4
|
+
import Avatar from "./Avatar";
|
|
5
|
+
import EText from "./EText";
|
|
6
|
+
|
|
7
|
+
interface IProps {
|
|
8
|
+
name: string;
|
|
9
|
+
subtitle?: string;
|
|
10
|
+
noBorder?: boolean;
|
|
11
|
+
firstLetter?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default function EListPerson({
|
|
15
|
+
name,
|
|
16
|
+
subtitle,
|
|
17
|
+
noBorder,
|
|
18
|
+
firstLetter,
|
|
19
|
+
}: IProps) {
|
|
20
|
+
return (
|
|
21
|
+
<View style={[tw`flex-row items-center justify-between`]}>
|
|
22
|
+
<Avatar size="sm" source={""} nameFirstLetter={firstLetter} />
|
|
23
|
+
<View
|
|
24
|
+
style={tw` ml-3 py-3 flex-1 ${
|
|
25
|
+
noBorder ? "" : "border-b border-slate-200"
|
|
26
|
+
}`}
|
|
27
|
+
>
|
|
28
|
+
<EText style={tw`font-bold text-slate-800 mb-0.5`} numberOfLines={1}>
|
|
29
|
+
{name}
|
|
30
|
+
</EText>
|
|
31
|
+
|
|
32
|
+
{subtitle ? (
|
|
33
|
+
<EText size="sm" style={tw`text-slate-500`}>
|
|
34
|
+
{subtitle}
|
|
35
|
+
</EText>
|
|
36
|
+
) : null}
|
|
37
|
+
</View>
|
|
38
|
+
</View>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
name: string;
|
|
8
|
+
code?: string;
|
|
9
|
+
district?: string;
|
|
10
|
+
noBorder?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function EListSchool({
|
|
14
|
+
name,
|
|
15
|
+
code,
|
|
16
|
+
district,
|
|
17
|
+
noBorder,
|
|
18
|
+
}: IProps) {
|
|
19
|
+
return (
|
|
20
|
+
<View style={tw`border-b border-slate-200 py-3`}>
|
|
21
|
+
<EText style={tw`font-bold text-slate-800 mb-0.5`} numberOfLines={1}>
|
|
22
|
+
{name}
|
|
23
|
+
</EText>
|
|
24
|
+
<View style={tw`flex-row items-center`}>
|
|
25
|
+
<EText size="sm" style={tw`text-slate-500`}>
|
|
26
|
+
{code}
|
|
27
|
+
</EText>
|
|
28
|
+
{district ? <><View style={tw`w-1 h-1 bg-slate-600 rounded-full mx-1.5`}></View>
|
|
29
|
+
<EText size="sm" style={tw`text-slate-500`}>
|
|
30
|
+
{district}
|
|
31
|
+
</EText></> : null}
|
|
32
|
+
</View>
|
|
33
|
+
</View>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 style={[tw`px-4 py-3 mr-2 border rounded-lg border-slate-300`, {
|
|
16
|
+
backgroundColor: active ? Colors['secondary-base'] : "transparent",
|
|
17
|
+
borderColor: active ? Colors['secondary-base'] : Colors['border'],
|
|
18
|
+
}]}
|
|
19
|
+
onPress={onPress}
|
|
20
|
+
>
|
|
21
|
+
<EText size={"sm"} style={tw`font-normal ${active ? "text-white" : "text-slate-500"}`}>
|
|
22
|
+
{title}
|
|
23
|
+
</EText>
|
|
24
|
+
</TouchableOpacity>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
|
|
18
|
+
export default function EProfile({ name, subjectName, border, children, titleSize, subTitleSize }: IProps) {
|
|
19
|
+
return (
|
|
20
|
+
<View style={[tw`flex-row items-center justify-between py-3 ${border ? "border-b" : ""}`, {borderBottomColor: Colors.border}]}>
|
|
21
|
+
<View style={tw`flex-row items-center`}>
|
|
22
|
+
<Avatar
|
|
23
|
+
size="sm"
|
|
24
|
+
source={""}
|
|
25
|
+
nameFirstLetter={"J"}
|
|
26
|
+
bg={"sky-400"}
|
|
27
|
+
/>
|
|
28
|
+
<View style={tw`ml-3`}>
|
|
29
|
+
<EText style={[tw`${titleSize}`, { color: Colors['text-primary'] }]}>{name}</EText>
|
|
30
|
+
{subjectName ? <EText style={[tw`mt-1 ${subTitleSize}`, { color: Colors['text-body'] }]}>
|
|
31
|
+
{subjectName}
|
|
32
|
+
</EText> : null}
|
|
33
|
+
</View>
|
|
34
|
+
</View>
|
|
35
|
+
{
|
|
36
|
+
children ? <>
|
|
37
|
+
{children}
|
|
38
|
+
</> : null
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
</View>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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-40"
|
|
34
|
+
),
|
|
35
|
+
style,
|
|
36
|
+
]}
|
|
37
|
+
>
|
|
38
|
+
{children}
|
|
39
|
+
</Text>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -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/outline'
|
|
5
|
+
import { onChange } from 'react-native-reanimated'
|
|
6
|
+
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
7
|
+
import tw from '../../../lib/tailwind'
|
|
8
|
+
import EText from './EText';
|
|
9
|
+
import ELabel from './ELabel';
|
|
10
|
+
|
|
11
|
+
interface IProps {
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
onChange: (value: string) => void;
|
|
15
|
+
style?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default function ETimeInput( { label, value,style, onChange }: IProps ) {
|
|
19
|
+
const [date, setDate] = useState(new Date());
|
|
20
|
+
const [show, setShow] = useState(false);
|
|
21
|
+
|
|
22
|
+
const handleOnChange = (event: any, selectedDate: any) => {
|
|
23
|
+
const currentDate = selectedDate;
|
|
24
|
+
setShow(false);
|
|
25
|
+
setDate(currentDate);
|
|
26
|
+
onChange(moment(currentDate).format("hh:mm A"));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
|
|
31
|
+
<View style={tw`flex-1 ${ style ? style : ""}`}>
|
|
32
|
+
<ELabel label={label} />
|
|
33
|
+
<TouchableOpacity
|
|
34
|
+
style={tw`h-12 rounded-lg px-4 flex-row justify-between items-center border border-slate-300 lowercase my-2 bg-white`}
|
|
35
|
+
onPress={() => setShow(true)}
|
|
36
|
+
>
|
|
37
|
+
<EText size={"sm"} style={tw`font-normal`}>
|
|
38
|
+
{
|
|
39
|
+
// value ? value : moment(date).format("hh:mm A")
|
|
40
|
+
value ? value : "Select Time"
|
|
41
|
+
}
|
|
42
|
+
</EText>
|
|
43
|
+
{show ? <DateTimePicker
|
|
44
|
+
testID="dateTimePicker"
|
|
45
|
+
value={date}
|
|
46
|
+
mode={"time"}
|
|
47
|
+
is24Hour={false}
|
|
48
|
+
onChange={handleOnChange}
|
|
49
|
+
/> : <></>}
|
|
50
|
+
<ClockIcon size={20} style={tw`text-slate-500`} />
|
|
51
|
+
</TouchableOpacity>
|
|
52
|
+
</View>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Dimensions, TouchableOpacity, View } from 'react-native'
|
|
3
|
+
import { ChevronRightIcon } from 'react-native-heroicons/solid';
|
|
4
|
+
import tw from '../lib/tailwind'
|
|
5
|
+
import { Colors } from '../utils/Color';
|
|
6
|
+
import EBadge from './EBadge'
|
|
7
|
+
import EButton from './EButton';
|
|
8
|
+
import EDateAndTimeCard from './EDateAndTimeCard'
|
|
9
|
+
import EText from './EText'
|
|
10
|
+
|
|
11
|
+
interface IProps {
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
completed: boolean;
|
|
15
|
+
skipButton?: boolean;
|
|
16
|
+
onPress?: () => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default function ETimeLineCard({ title, description, completed, skipButton, onPress }: IProps) {
|
|
20
|
+
return (
|
|
21
|
+
<TouchableOpacity
|
|
22
|
+
onPress={() => onPress && onPress()}
|
|
23
|
+
style={[
|
|
24
|
+
tw` rounded-lg p-4 mb-3 w-full border border}`,
|
|
25
|
+
{
|
|
26
|
+
backgroundColor: completed ? Colors['primary-light'] : Colors['white'],
|
|
27
|
+
borderColor: completed ? Colors['primary-base'] : Colors['border'],
|
|
28
|
+
}
|
|
29
|
+
]}
|
|
30
|
+
>
|
|
31
|
+
|
|
32
|
+
<View style={tw`flex-row justify-between `}>
|
|
33
|
+
<View style={tw`flex-1`}>
|
|
34
|
+
<EText size="lg" style={[tw`font-bold`, { color: Colors['text-primary'] }]}>
|
|
35
|
+
{title}
|
|
36
|
+
</EText>
|
|
37
|
+
<EText size='sm' style={[tw`font-normal mt-1`, {color: Colors['text-body']}]}>
|
|
38
|
+
{description}
|
|
39
|
+
</EText>
|
|
40
|
+
</View>
|
|
41
|
+
<View style={tw`ml-4`}>
|
|
42
|
+
<ChevronRightIcon style={[tw``,{ color: Colors['text-body']}]} size={16} />
|
|
43
|
+
</View>
|
|
44
|
+
</View>
|
|
45
|
+
|
|
46
|
+
<View style={tw`mt-6 flex-row items-center justify-between`}>
|
|
47
|
+
<EBadge
|
|
48
|
+
completed={completed}
|
|
49
|
+
text={completed ? "Complete" : "Pending"}
|
|
50
|
+
color={completed ? Colors['primary-base'] : Colors.warning}
|
|
51
|
+
textColor={completed ? "text-white" : ""}
|
|
52
|
+
size="xs"
|
|
53
|
+
padding='py-1 px-3'
|
|
54
|
+
fontWeight='font-bold'
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
{
|
|
58
|
+
skipButton ? (
|
|
59
|
+
<TouchableOpacity>
|
|
60
|
+
<EText size="sm" style={[tw`ml-2 font-semibold`, {color: Colors['primary-base']}]}>
|
|
61
|
+
Skip
|
|
62
|
+
</EText>
|
|
63
|
+
</TouchableOpacity>) : null
|
|
64
|
+
}
|
|
65
|
+
</View>
|
|
66
|
+
</TouchableOpacity>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
View,
|
|
3
|
+
Text,
|
|
4
|
+
TouchableOpacity,
|
|
5
|
+
Image,
|
|
6
|
+
TouchableOpacityProps,
|
|
7
|
+
} from "react-native";
|
|
8
|
+
import React from "react";
|
|
9
|
+
import tw from "../lib/tailwind";
|
|
10
|
+
import EText from "./EText";
|
|
11
|
+
import { Colors } from "../utils/Color";
|
|
12
|
+
// import { Tag } from "..";
|
|
13
|
+
|
|
14
|
+
interface ListFormViewProps {
|
|
15
|
+
label: string;
|
|
16
|
+
description: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default function ListFormView({
|
|
20
|
+
label,
|
|
21
|
+
description,
|
|
22
|
+
}: ListFormViewProps) {
|
|
23
|
+
return (
|
|
24
|
+
<View style={tw`flex-row items-center justify-between py-3 border-b border-[${Colors.border}]`}>
|
|
25
|
+
<View style={tw``}>
|
|
26
|
+
<EText size="sm" style={tw`font-normal text-[${Colors["text-secondary"]}]`}>
|
|
27
|
+
{label}
|
|
28
|
+
</EText>
|
|
29
|
+
</View>
|
|
30
|
+
<View style={tw`flex-1 ml-4 items-end`}>
|
|
31
|
+
<EText size="sm" style={tw`font-normal text-[${Colors["text-primary"]}]`}>
|
|
32
|
+
{description}
|
|
33
|
+
</EText>
|
|
34
|
+
</View>
|
|
35
|
+
</View>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SCREEN_WIDTH, SCREEN_HEIGHT } from '@gorhom/bottom-sheet'
|
|
2
|
+
// import { Colors, EText } from 'fln-espranza'
|
|
3
|
+
import EText from './EText';
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import { View, ActivityIndicator } from 'react-native'
|
|
6
|
+
import tw from '../lib/tailwind';
|
|
7
|
+
import { Colors } from '../utils/Color';
|
|
8
|
+
|
|
9
|
+
interface IProps{
|
|
10
|
+
show: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function Loader({show}: IProps) {
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
{show ? <View style={[tw`absolute justify-center items-center z-10 bg-slate-100 `, {
|
|
17
|
+
opacity: 0.9,
|
|
18
|
+
width: SCREEN_WIDTH,
|
|
19
|
+
height: SCREEN_HEIGHT,
|
|
20
|
+
}]}>
|
|
21
|
+
<View style={[tw`h-24 w-32 bg-white px-2 py-3 justify-center items-center rounded-xl`]}>
|
|
22
|
+
<ActivityIndicator size="large" color={Colors['primary-base']} />
|
|
23
|
+
<EText size="base" style={tw`text-black`}>Loading...</EText>
|
|
24
|
+
</View>
|
|
25
|
+
</View>
|
|
26
|
+
:
|
|
27
|
+
<></>
|
|
28
|
+
}
|
|
29
|
+
</>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TouchableOpacity, View } from "react-native";
|
|
3
|
+
import { HomeIcon } 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
|
+
title?: string;
|
|
10
|
+
icon?: JSX.Element;
|
|
11
|
+
onPress?: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default function MenuItems({ title, icon, onPress }: IProps) {
|
|
15
|
+
return (
|
|
16
|
+
<TouchableOpacity style={tw`flex-row items-center`} onPress={onPress}>
|
|
17
|
+
{/* <HomeIcon style={[tw`w-6 h-6`, { color: Colors["primary-base"] }]} /> */}
|
|
18
|
+
{icon ? (
|
|
19
|
+
icon
|
|
20
|
+
) : (
|
|
21
|
+
<HomeIcon style={[tw`w-6 h-6`, { color: Colors["primary-base"] }]} />
|
|
22
|
+
)}
|
|
23
|
+
<View
|
|
24
|
+
style={[
|
|
25
|
+
tw`py-4 ml-4 mr-8 w-[80%]`,
|
|
26
|
+
{
|
|
27
|
+
borderBottomWidth: 1,
|
|
28
|
+
borderBottomColor: Colors.border,
|
|
29
|
+
},
|
|
30
|
+
]}
|
|
31
|
+
>
|
|
32
|
+
<EText
|
|
33
|
+
size="base"
|
|
34
|
+
style={[
|
|
35
|
+
tw`font-medium `,
|
|
36
|
+
{
|
|
37
|
+
color: Colors["text-primary"],
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
>
|
|
41
|
+
{title ? title : "Dashboard"}
|
|
42
|
+
</EText>
|
|
43
|
+
</View>
|
|
44
|
+
</TouchableOpacity>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import {
|
|
2
|
+
View,
|
|
3
|
+
Dimensions,
|
|
4
|
+
ScrollView,
|
|
5
|
+
Platform,
|
|
6
|
+
} from "react-native";
|
|
7
|
+
import React, { } from "react";
|
|
8
|
+
import Constants from "expo-constants";
|
|
9
|
+
import tw from "../lib/tailwind";
|
|
10
|
+
import EButtonIcon from "./EButtonIcon";
|
|
11
|
+
import { StatusBar } from "expo-status-bar";
|
|
12
|
+
import PageHeaderSecondary from "./PageHeaderSecondary";
|
|
13
|
+
import { useNavigation } from "@react-navigation/native";
|
|
14
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
15
|
+
import { Container } from ".";
|
|
16
|
+
|
|
17
|
+
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
18
|
+
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
|
19
|
+
const HEADER_HEIGHT = Constants.statusBarHeight + 60;
|
|
20
|
+
const SCROLL_PADDING_BOTTOM = 100;
|
|
21
|
+
|
|
22
|
+
interface ModalLayoutProps {
|
|
23
|
+
title: string;
|
|
24
|
+
subtitle?: string;
|
|
25
|
+
children?: JSX.Element;
|
|
26
|
+
bottomButton?: JSX.Element;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default function ModalLayout({
|
|
30
|
+
title,
|
|
31
|
+
subtitle,
|
|
32
|
+
children,
|
|
33
|
+
bottomButton,
|
|
34
|
+
}: ModalLayoutProps) {
|
|
35
|
+
const insets = useSafeAreaInsets();
|
|
36
|
+
const navigation = useNavigation();
|
|
37
|
+
return (
|
|
38
|
+
<View style={[tw`flex-1 bg-white`, {}]}>
|
|
39
|
+
<StatusBar
|
|
40
|
+
style={Platform.OS === "android" ? "dark" : "light"}
|
|
41
|
+
animated
|
|
42
|
+
/>
|
|
43
|
+
|
|
44
|
+
{/* HEADER */}
|
|
45
|
+
<View
|
|
46
|
+
style={[
|
|
47
|
+
tw`absolute top-0 right-0 left-0 px-6 pr-3 pt-2 z-10 w-full bg-white ${title ? 'pb-1' : 'pb-0'}`,
|
|
48
|
+
// {height: 64},
|
|
49
|
+
]}
|
|
50
|
+
>
|
|
51
|
+
<PageHeaderSecondary
|
|
52
|
+
title={title}
|
|
53
|
+
subtitle={subtitle}
|
|
54
|
+
button={
|
|
55
|
+
<EButtonIcon
|
|
56
|
+
type="close"
|
|
57
|
+
iconColor="slate-800"
|
|
58
|
+
onPress={() => navigation.goBack()}
|
|
59
|
+
/>
|
|
60
|
+
}
|
|
61
|
+
/>
|
|
62
|
+
</View>
|
|
63
|
+
<ScrollView
|
|
64
|
+
style={[
|
|
65
|
+
tw`flex-1`,
|
|
66
|
+
{ paddingBottom: insets.bottom, paddingTop: title ? 80 : 56 },
|
|
67
|
+
]}
|
|
68
|
+
showsVerticalScrollIndicator={false}
|
|
69
|
+
decelerationRate={"fast"}
|
|
70
|
+
contentContainerStyle={{
|
|
71
|
+
paddingBottom: SCROLL_PADDING_BOTTOM,
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
{children}
|
|
75
|
+
</ScrollView>
|
|
76
|
+
{bottomButton ? <View style={tw` px-6 mb-4 `}>
|
|
77
|
+
{bottomButton}
|
|
78
|
+
</View> : <></>}
|
|
79
|
+
</View>
|
|
80
|
+
);
|
|
81
|
+
}
|