fln-espranza 0.0.19 → 0.0.20
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/Avatar.tsx +43 -43
- package/components/BaseLayout.tsx +174 -174
- package/components/Drawer.tsx +98 -98
- package/components/EBadge.tsx +23 -23
- package/components/EButton.tsx +71 -71
- package/components/EDateAndTimeCard.tsx +51 -51
- package/components/EDateInput.tsx +55 -55
- package/components/EEmptyPlaceholder.tsx +21 -21
- 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/EOption.tsx +86 -34
- package/components/EOtpInputBox.tsx +49 -49
- package/components/EPageDescription.tsx +19 -19
- package/components/EPillButton.tsx +33 -33
- package/components/EProfile.tsx +62 -62
- package/components/EProgressBar.tsx +33 -33
- package/components/EQuestionSerialNumberLabel.tsx +17 -17
- package/components/EQuestionText.tsx +14 -14
- package/components/ESegment.tsx +36 -36
- package/components/EText.tsx +41 -41
- package/components/ETimeInput.tsx +55 -55
- package/components/ETimeLineCard.tsx +69 -69
- package/components/ListFormView.tsx +36 -36
- package/components/Loader.tsx +31 -31
- package/components/MenuItems.tsx +46 -46
- package/components/PageHeader.tsx +115 -115
- package/components/SecondaryBaseLayout.tsx +102 -102
- package/components/Timer.tsx +56 -56
- package/components/icons/EIconAdd.jsx +19 -19
- package/components/icons/EIconAddCircle.jsx +21 -21
- package/components/icons/EIconApplicationStatus.jsx +20 -20
- package/components/icons/EIconArrowDown.jsx +20 -20
- package/components/icons/EIconArrowLeft.jsx +21 -21
- package/components/icons/EIconArrowRight.jsx +21 -21
- package/components/icons/EIconArrowUp.jsx +20 -20
- package/components/icons/EIconBadge.jsx +20 -20
- package/components/icons/EIconBell.jsx +19 -19
- package/components/icons/EIconCalendar.jsx +21 -21
- package/components/icons/EIconCalendarCheck.jsx +24 -24
- package/components/icons/EIconCamera.jsx +20 -20
- package/components/icons/EIconCameraRotate.jsx +23 -23
- package/components/icons/EIconCheck.jsx +19 -19
- package/components/icons/EIconCheckCircle.jsx +20 -20
- package/components/icons/EIconCheckFill.jsx +19 -19
- package/components/icons/EIconChevronDown.jsx +19 -19
- package/components/icons/EIconChevronLeft.jsx +19 -19
- package/components/icons/EIconChevronRight.jsx +19 -19
- package/components/icons/EIconChevronUp.jsx +19 -19
- package/components/icons/EIconClock.jsx +19 -19
- package/components/icons/EIconClose.jsx +19 -19
- package/components/icons/EIconDashboard.jsx +20 -20
- package/components/icons/EIconEdit.jsx +19 -19
- package/components/icons/EIconFile.jsx +21 -21
- package/components/icons/EIconInfo.jsx +20 -20
- package/components/icons/EIconLogout.jsx +19 -19
- package/components/icons/EIconMenu.jsx +19 -19
- package/components/icons/EIconMinus.jsx +19 -19
- package/components/icons/EIconPin.jsx +19 -19
- package/components/icons/EIconProfile.jsx +19 -19
- package/components/icons/EIconSchool.jsx +24 -24
- package/components/icons/EIconSearch.jsx +19 -19
- package/components/icons/EIconSettings.jsx +20 -20
- package/components/icons/EIconShare.jsx +21 -21
- package/components/icons/EIconStudent.jsx +23 -23
- package/components/icons/EIconSubject.jsx +21 -21
- package/components/icons/EIconTeach.jsx +21 -21
- package/components/icons/EIconTrash.jsx +19 -19
- package/components/icons/EIconUserCard.jsx +19 -19
- package/components/icons/EIconUserCheck.jsx +20 -20
- package/components/icons/EIconUsers.jsx +19 -19
- package/components/index.tsx +65 -65
- package/index.ts +172 -172
- package/package.json +26 -26
- package/utils/Color.ts +14 -14
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { EIconAdd } from 'fln-espranza';
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { Dimensions, TouchableOpacity, View } from 'react-native'
|
|
4
|
-
import { ChevronRightIcon } from 'react-native-heroicons/solid';
|
|
5
|
-
import tw from '../lib/tailwind'
|
|
6
|
-
import { Colors } from '../utils/Color';
|
|
7
|
-
import EBadge from './EBadge'
|
|
8
|
-
import EButton from './EButton';
|
|
9
|
-
import EDateAndTimeCard from './EDateAndTimeCard'
|
|
10
|
-
import EText from './EText'
|
|
11
|
-
|
|
12
|
-
interface IProps {
|
|
13
|
-
title: string;
|
|
14
|
-
description: string;
|
|
15
|
-
completed: boolean;
|
|
16
|
-
anotherButton?: boolean;
|
|
17
|
-
onPress?: () => void;
|
|
18
|
-
onAnotherButtonPress?: () => void;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default function ETimeLineCard({ title, description, completed, anotherButton, onPress, onAnotherButtonPress }: IProps) {
|
|
22
|
-
return (
|
|
23
|
-
<TouchableOpacity
|
|
24
|
-
onPress={() => onPress && onPress()}
|
|
25
|
-
style={[
|
|
26
|
-
tw` rounded-lg p-4 mb-3 w-full border border}`,
|
|
27
|
-
{
|
|
28
|
-
backgroundColor: completed ? Colors['primary-light'] : Colors['white'],
|
|
29
|
-
borderColor: completed ? Colors['primary-base'] : Colors['border'],
|
|
30
|
-
}
|
|
31
|
-
]}
|
|
32
|
-
>
|
|
33
|
-
|
|
34
|
-
<View style={tw`flex-row justify-between `}>
|
|
35
|
-
<View style={tw`flex-1`}>
|
|
36
|
-
<EText size="lg" style={[tw`font-bold`, { color: Colors['text-primary'] }]}>
|
|
37
|
-
{title}
|
|
38
|
-
</EText>
|
|
39
|
-
<EText size='sm' style={[tw`font-normal mt-1`, {color: Colors['text-body']}]}>
|
|
40
|
-
{description}
|
|
41
|
-
</EText>
|
|
42
|
-
</View>
|
|
43
|
-
<View style={tw`ml-4`}>
|
|
44
|
-
<ChevronRightIcon style={[tw``,{ color: Colors['text-body']}]} size={16} />
|
|
45
|
-
</View>
|
|
46
|
-
</View>
|
|
47
|
-
|
|
48
|
-
<View style={tw`mt-6 flex-row items-center justify-between`}>
|
|
49
|
-
<EBadge
|
|
50
|
-
completed={completed}
|
|
51
|
-
text={completed ? "Complete" : "Pending"}
|
|
52
|
-
color={completed ? Colors['primary-base'] : Colors.warning}
|
|
53
|
-
/>
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
-
anotherButton ? (
|
|
57
|
-
<TouchableOpacity style={tw`flex-row`} onPress={onAnotherButtonPress}>
|
|
58
|
-
<EText size="sm" style={[tw`ml-2 font-semibold`, {color: Colors['primary-base']}]}>
|
|
59
|
-
Another Assessment
|
|
60
|
-
</EText>
|
|
61
|
-
<EIconAdd size={20} style={[tw`ml-2`, {color: Colors['primary-base']}]}/>
|
|
62
|
-
</TouchableOpacity>
|
|
63
|
-
|
|
64
|
-
) : <></>
|
|
65
|
-
}
|
|
66
|
-
</View>
|
|
67
|
-
</TouchableOpacity>
|
|
68
|
-
)
|
|
69
|
-
}
|
|
1
|
+
import { EIconAdd } from 'fln-espranza';
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { Dimensions, TouchableOpacity, View } from 'react-native'
|
|
4
|
+
import { ChevronRightIcon } from 'react-native-heroicons/solid';
|
|
5
|
+
import tw from '../lib/tailwind'
|
|
6
|
+
import { Colors } from '../utils/Color';
|
|
7
|
+
import EBadge from './EBadge'
|
|
8
|
+
import EButton from './EButton';
|
|
9
|
+
import EDateAndTimeCard from './EDateAndTimeCard'
|
|
10
|
+
import EText from './EText'
|
|
11
|
+
|
|
12
|
+
interface IProps {
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
15
|
+
completed: boolean;
|
|
16
|
+
anotherButton?: boolean;
|
|
17
|
+
onPress?: () => void;
|
|
18
|
+
onAnotherButtonPress?: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default function ETimeLineCard({ title, description, completed, anotherButton, onPress, onAnotherButtonPress }: IProps) {
|
|
22
|
+
return (
|
|
23
|
+
<TouchableOpacity
|
|
24
|
+
onPress={() => onPress && onPress()}
|
|
25
|
+
style={[
|
|
26
|
+
tw` rounded-lg p-4 mb-3 w-full border border}`,
|
|
27
|
+
{
|
|
28
|
+
backgroundColor: completed ? Colors['primary-light'] : Colors['white'],
|
|
29
|
+
borderColor: completed ? Colors['primary-base'] : Colors['border'],
|
|
30
|
+
}
|
|
31
|
+
]}
|
|
32
|
+
>
|
|
33
|
+
|
|
34
|
+
<View style={tw`flex-row justify-between `}>
|
|
35
|
+
<View style={tw`flex-1`}>
|
|
36
|
+
<EText size="lg" style={[tw`font-bold`, { color: Colors['text-primary'] }]}>
|
|
37
|
+
{title}
|
|
38
|
+
</EText>
|
|
39
|
+
<EText size='sm' style={[tw`font-normal mt-1`, {color: Colors['text-body']}]}>
|
|
40
|
+
{description}
|
|
41
|
+
</EText>
|
|
42
|
+
</View>
|
|
43
|
+
<View style={tw`ml-4`}>
|
|
44
|
+
<ChevronRightIcon style={[tw``,{ color: Colors['text-body']}]} size={16} />
|
|
45
|
+
</View>
|
|
46
|
+
</View>
|
|
47
|
+
|
|
48
|
+
<View style={tw`mt-6 flex-row items-center justify-between`}>
|
|
49
|
+
<EBadge
|
|
50
|
+
completed={completed}
|
|
51
|
+
text={completed ? "Complete" : "Pending"}
|
|
52
|
+
color={completed ? Colors['primary-base'] : Colors.warning}
|
|
53
|
+
/>
|
|
54
|
+
|
|
55
|
+
{
|
|
56
|
+
anotherButton ? (
|
|
57
|
+
<TouchableOpacity style={tw`flex-row`} onPress={onAnotherButtonPress}>
|
|
58
|
+
<EText size="sm" style={[tw`ml-2 font-semibold`, {color: Colors['primary-base']}]}>
|
|
59
|
+
Another Assessment
|
|
60
|
+
</EText>
|
|
61
|
+
<EIconAdd size={20} style={[tw`ml-2`, {color: Colors['primary-base']}]}/>
|
|
62
|
+
</TouchableOpacity>
|
|
63
|
+
|
|
64
|
+
) : <></>
|
|
65
|
+
}
|
|
66
|
+
</View>
|
|
67
|
+
</TouchableOpacity>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
@@ -1,37 +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
|
-
);
|
|
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
37
|
}
|
package/components/Loader.tsx
CHANGED
|
@@ -1,31 +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
|
-
}
|
|
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
|
+
}
|
package/components/MenuItems.tsx
CHANGED
|
@@ -1,46 +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-semibold `,
|
|
36
|
-
{
|
|
37
|
-
color: Colors["text-primary"],
|
|
38
|
-
},
|
|
39
|
-
]}
|
|
40
|
-
>
|
|
41
|
-
{title ? title : "Dashboard"}
|
|
42
|
-
</EText>
|
|
43
|
-
</View>
|
|
44
|
-
</TouchableOpacity>
|
|
45
|
-
);
|
|
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-semibold `,
|
|
36
|
+
{
|
|
37
|
+
color: Colors["text-primary"],
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
>
|
|
41
|
+
{title ? title : "Dashboard"}
|
|
42
|
+
</EText>
|
|
43
|
+
</View>
|
|
44
|
+
</TouchableOpacity>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
import { View, Animated, Dimensions, TouchableOpacity } from "react-native";
|
|
2
|
-
import React, { useEffect, useRef } from "react";
|
|
3
|
-
import tw from "../lib/tailwind";
|
|
4
|
-
import { useNavigation } from "@react-navigation/native";
|
|
5
|
-
import EText from "./EText";
|
|
6
|
-
import Constants from "expo-constants";
|
|
7
|
-
import { EIconArrowLeft, EIconMenu } from "fln-espranza";
|
|
8
|
-
|
|
9
|
-
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
10
|
-
const HEADER_HEIGHT = 90;
|
|
11
|
-
|
|
12
|
-
interface PageHeaderProps {
|
|
13
|
-
title: string;
|
|
14
|
-
subtitle?: string;
|
|
15
|
-
curved?: boolean;
|
|
16
|
-
children?: JSX.Element;
|
|
17
|
-
iconEnd?: JSX.Element;
|
|
18
|
-
border?: boolean;
|
|
19
|
-
menuButton?: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default function PageHeader({
|
|
23
|
-
title,
|
|
24
|
-
subtitle,
|
|
25
|
-
curved,
|
|
26
|
-
children,
|
|
27
|
-
iconEnd,
|
|
28
|
-
border,
|
|
29
|
-
menuButton,
|
|
30
|
-
}: PageHeaderProps) {
|
|
31
|
-
const navigation = useNavigation();
|
|
32
|
-
|
|
33
|
-
const translateX = useRef(new Animated.Value(60)).current;
|
|
34
|
-
const opacity = useRef(new Animated.Value(0)).current;
|
|
35
|
-
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
Animated.spring(translateX, {
|
|
38
|
-
toValue: 0,
|
|
39
|
-
stiffness: 40,
|
|
40
|
-
damping: 10,
|
|
41
|
-
useNativeDriver: true,
|
|
42
|
-
}).start();
|
|
43
|
-
Animated.spring(opacity, {
|
|
44
|
-
toValue: 1,
|
|
45
|
-
delay: 250,
|
|
46
|
-
useNativeDriver: true,
|
|
47
|
-
}).start();
|
|
48
|
-
});
|
|
49
|
-
return (
|
|
50
|
-
<View style={[tw`${"border-none border-slate-300 bg-white shadow-lg py-3"} `, {}]}>
|
|
51
|
-
<View style={tw`overflow-hidden`}>
|
|
52
|
-
<View
|
|
53
|
-
style={[
|
|
54
|
-
tw`flex-row items-center px-3`,
|
|
55
|
-
{
|
|
56
|
-
paddingTop: Constants.statusBarHeight + 8,
|
|
57
|
-
},
|
|
58
|
-
]}
|
|
59
|
-
>
|
|
60
|
-
{/* LEFT ICON */}
|
|
61
|
-
<View
|
|
62
|
-
style={[tw`` ]}
|
|
63
|
-
>
|
|
64
|
-
{menuButton ?
|
|
65
|
-
<TouchableOpacity activeOpacity={0.6}
|
|
66
|
-
onPress={() => navigation?.openDrawer()}>
|
|
67
|
-
<EIconMenu
|
|
68
|
-
size={24}
|
|
69
|
-
style={tw`text-slate-800`}
|
|
70
|
-
/>
|
|
71
|
-
</TouchableOpacity>
|
|
72
|
-
|
|
73
|
-
:
|
|
74
|
-
<TouchableOpacity activeOpacity={0.6}
|
|
75
|
-
onPress={() => navigation.goBack()}>
|
|
76
|
-
<EIconArrowLeft
|
|
77
|
-
iconColor={curved ? "white" : "tint-slate-900"}
|
|
78
|
-
size={24}
|
|
79
|
-
// onPress={() => navigation.navigate("Dashboard")}
|
|
80
|
-
style={tw`text-slate-800`}
|
|
81
|
-
/>
|
|
82
|
-
</TouchableOpacity>
|
|
83
|
-
}
|
|
84
|
-
</View>
|
|
85
|
-
{/* TITLE */}
|
|
86
|
-
<View style={tw`flex-1 items-start px-3`}>
|
|
87
|
-
<EText
|
|
88
|
-
size="lg"
|
|
89
|
-
style={tw.style("text-slate-800 font-bold")}
|
|
90
|
-
>
|
|
91
|
-
{title}
|
|
92
|
-
</EText>
|
|
93
|
-
{subtitle ? (
|
|
94
|
-
<EText
|
|
95
|
-
style={tw.style(
|
|
96
|
-
"text-slate-800 opacity-40 font-semibold mt-0.25"
|
|
97
|
-
)}
|
|
98
|
-
>
|
|
99
|
-
{subtitle}
|
|
100
|
-
</EText>
|
|
101
|
-
) : null}
|
|
102
|
-
</View>
|
|
103
|
-
|
|
104
|
-
{/* RIGHT ICON */}
|
|
105
|
-
{iconEnd ? (
|
|
106
|
-
<View style={[tw``, {}]}>
|
|
107
|
-
{iconEnd}
|
|
108
|
-
</View>
|
|
109
|
-
) : null}
|
|
110
|
-
</View>
|
|
111
|
-
{children ? <View style={tw.style("pb-6")}>{children}</View> : null}
|
|
112
|
-
</View>
|
|
113
|
-
</View>
|
|
114
|
-
);
|
|
115
|
-
}
|
|
1
|
+
import { View, Animated, Dimensions, TouchableOpacity } from "react-native";
|
|
2
|
+
import React, { useEffect, useRef } from "react";
|
|
3
|
+
import tw from "../lib/tailwind";
|
|
4
|
+
import { useNavigation } from "@react-navigation/native";
|
|
5
|
+
import EText from "./EText";
|
|
6
|
+
import Constants from "expo-constants";
|
|
7
|
+
import { EIconArrowLeft, EIconMenu } from "fln-espranza";
|
|
8
|
+
|
|
9
|
+
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
10
|
+
const HEADER_HEIGHT = 90;
|
|
11
|
+
|
|
12
|
+
interface PageHeaderProps {
|
|
13
|
+
title: string;
|
|
14
|
+
subtitle?: string;
|
|
15
|
+
curved?: boolean;
|
|
16
|
+
children?: JSX.Element;
|
|
17
|
+
iconEnd?: JSX.Element;
|
|
18
|
+
border?: boolean;
|
|
19
|
+
menuButton?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default function PageHeader({
|
|
23
|
+
title,
|
|
24
|
+
subtitle,
|
|
25
|
+
curved,
|
|
26
|
+
children,
|
|
27
|
+
iconEnd,
|
|
28
|
+
border,
|
|
29
|
+
menuButton,
|
|
30
|
+
}: PageHeaderProps) {
|
|
31
|
+
const navigation = useNavigation();
|
|
32
|
+
|
|
33
|
+
const translateX = useRef(new Animated.Value(60)).current;
|
|
34
|
+
const opacity = useRef(new Animated.Value(0)).current;
|
|
35
|
+
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
Animated.spring(translateX, {
|
|
38
|
+
toValue: 0,
|
|
39
|
+
stiffness: 40,
|
|
40
|
+
damping: 10,
|
|
41
|
+
useNativeDriver: true,
|
|
42
|
+
}).start();
|
|
43
|
+
Animated.spring(opacity, {
|
|
44
|
+
toValue: 1,
|
|
45
|
+
delay: 250,
|
|
46
|
+
useNativeDriver: true,
|
|
47
|
+
}).start();
|
|
48
|
+
});
|
|
49
|
+
return (
|
|
50
|
+
<View style={[tw`${"border-none border-slate-300 bg-white shadow-lg py-3"} `, {}]}>
|
|
51
|
+
<View style={tw`overflow-hidden`}>
|
|
52
|
+
<View
|
|
53
|
+
style={[
|
|
54
|
+
tw`flex-row items-center px-3`,
|
|
55
|
+
{
|
|
56
|
+
paddingTop: Constants.statusBarHeight + 8,
|
|
57
|
+
},
|
|
58
|
+
]}
|
|
59
|
+
>
|
|
60
|
+
{/* LEFT ICON */}
|
|
61
|
+
<View
|
|
62
|
+
style={[tw`` ]}
|
|
63
|
+
>
|
|
64
|
+
{menuButton ?
|
|
65
|
+
<TouchableOpacity activeOpacity={0.6}
|
|
66
|
+
onPress={() => navigation?.openDrawer()}>
|
|
67
|
+
<EIconMenu
|
|
68
|
+
size={24}
|
|
69
|
+
style={tw`text-slate-800`}
|
|
70
|
+
/>
|
|
71
|
+
</TouchableOpacity>
|
|
72
|
+
|
|
73
|
+
:
|
|
74
|
+
<TouchableOpacity activeOpacity={0.6}
|
|
75
|
+
onPress={() => navigation.goBack()}>
|
|
76
|
+
<EIconArrowLeft
|
|
77
|
+
iconColor={curved ? "white" : "tint-slate-900"}
|
|
78
|
+
size={24}
|
|
79
|
+
// onPress={() => navigation.navigate("Dashboard")}
|
|
80
|
+
style={tw`text-slate-800`}
|
|
81
|
+
/>
|
|
82
|
+
</TouchableOpacity>
|
|
83
|
+
}
|
|
84
|
+
</View>
|
|
85
|
+
{/* TITLE */}
|
|
86
|
+
<View style={tw`flex-1 items-start px-3`}>
|
|
87
|
+
<EText
|
|
88
|
+
size="lg"
|
|
89
|
+
style={tw.style("text-slate-800 font-bold")}
|
|
90
|
+
>
|
|
91
|
+
{title}
|
|
92
|
+
</EText>
|
|
93
|
+
{subtitle ? (
|
|
94
|
+
<EText
|
|
95
|
+
style={tw.style(
|
|
96
|
+
"text-slate-800 opacity-40 font-semibold mt-0.25"
|
|
97
|
+
)}
|
|
98
|
+
>
|
|
99
|
+
{subtitle}
|
|
100
|
+
</EText>
|
|
101
|
+
) : null}
|
|
102
|
+
</View>
|
|
103
|
+
|
|
104
|
+
{/* RIGHT ICON */}
|
|
105
|
+
{iconEnd ? (
|
|
106
|
+
<View style={[tw``, {}]}>
|
|
107
|
+
{iconEnd}
|
|
108
|
+
</View>
|
|
109
|
+
) : null}
|
|
110
|
+
</View>
|
|
111
|
+
{children ? <View style={tw.style("pb-6")}>{children}</View> : null}
|
|
112
|
+
</View>
|
|
113
|
+
</View>
|
|
114
|
+
);
|
|
115
|
+
}
|