fln-espranza 0.0.1 → 0.0.2
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 -15
- package/.expo/settings.json +8 -8
- package/components/BaseLayout.tsx +174 -174
- package/components/Drawer.tsx +96 -96
- package/components/EBadge.tsx +23 -23
- package/components/EButton.tsx +73 -73
- package/components/EDateAndTimeCard.tsx +50 -50
- package/components/EDateInput.tsx +55 -55
- package/components/EErrorText.tsx +19 -19
- package/components/EInfoBox.tsx +41 -41
- package/components/EInput.tsx +52 -52
- package/components/ELabel.tsx +15 -15
- package/components/EListPerson.tsx +40 -40
- package/components/EListSchool.tsx +35 -35
- package/components/EOtpInputBox.tsx +49 -49
- package/components/EPageDescription.tsx +19 -19
- package/components/EPillButton.tsx +26 -26
- package/components/EProfile.tsx +42 -43
- package/components/ESegment.tsx +36 -36
- package/components/ETimeInput.tsx +55 -55
- package/components/ETimeLineCard.tsx +68 -68
- package/components/ListFormView.tsx +36 -36
- package/components/Loader.tsx +31 -31
- package/components/MenuItems.tsx +46 -46
- package/components/PageHeader.tsx +129 -129
- package/components/ProgressBar.tsx +33 -33
- package/components/SecondaryBaseLayout.tsx +120 -120
- package/components/Timer.tsx +56 -56
- package/index.ts +76 -76
- package/package.json +26 -26
- package/utils/Color.ts +14 -14
|
@@ -1,40 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,35 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -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,26 +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
|
-
}
|
|
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
|
+
}
|
package/components/EProfile.tsx
CHANGED
|
@@ -1,43 +1,42 @@
|
|
|
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={"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<EText style={[tw
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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={name.split(" ")[0].charAt(0)}
|
|
26
|
+
/>
|
|
27
|
+
<View style={tw`ml-3`}>
|
|
28
|
+
<EText style={[tw`${titleSize}`, { color: Colors['text-primary'] }]}>{name}</EText>
|
|
29
|
+
{subjectName ? <EText style={[tw`mt-1 ${subTitleSize}`, { color: Colors['text-body'] }]}>
|
|
30
|
+
{subjectName}
|
|
31
|
+
</EText> : null}
|
|
32
|
+
</View>
|
|
33
|
+
</View>
|
|
34
|
+
{
|
|
35
|
+
children ? <>
|
|
36
|
+
{children}
|
|
37
|
+
</> : null
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
</View>
|
|
41
|
+
)
|
|
42
|
+
}
|
package/components/ESegment.tsx
CHANGED
|
@@ -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,55 +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
|
-
|
|
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
|
+
|