fln-espranza 0.0.7 → 0.0.9
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 +42 -42
- package/components/BaseLayout.tsx +174 -174
- package/components/Drawer.tsx +110 -110
- 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/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 +34 -0
- package/components/EOtpInputBox.tsx +49 -49
- package/components/EPageDescription.tsx +19 -19
- package/components/EPillButton.tsx +33 -33
- package/components/EProfile.tsx +42 -42
- package/components/EProgressBar.tsx +33 -33
- package/components/EQuestionSerialNumberLabel.tsx +17 -0
- package/components/EQuestionText.tsx +14 -0
- package/components/ESegment.tsx +36 -36
- package/components/EText.tsx +41 -41
- 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/SecondaryBaseLayout.tsx +120 -120
- 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 +171 -165
- package/package.json +26 -26
- package/utils/Color.ts +14 -14
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-medium `,
|
|
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-medium `,
|
|
36
|
+
{
|
|
37
|
+
color: Colors["text-primary"],
|
|
38
|
+
},
|
|
39
|
+
]}
|
|
40
|
+
>
|
|
41
|
+
{title ? title : "Dashboard"}
|
|
42
|
+
</EText>
|
|
43
|
+
</View>
|
|
44
|
+
</TouchableOpacity>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
import { View, Animated, Dimensions, Image } 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 EButtonIcon from "./EButtonIcon";
|
|
6
|
-
import EText from "./EText";
|
|
7
|
-
import Constants from "expo-constants";
|
|
8
|
-
import { MenuIcon } from "react-native-heroicons/outline";
|
|
9
|
-
|
|
10
|
-
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
11
|
-
const HEADER_HEIGHT = 90;
|
|
12
|
-
|
|
13
|
-
interface PageHeaderProps {
|
|
14
|
-
title: string;
|
|
15
|
-
subtitle?: string;
|
|
16
|
-
curved?: boolean;
|
|
17
|
-
children?: JSX.Element;
|
|
18
|
-
iconEnd?: JSX.Element;
|
|
19
|
-
border?: boolean;
|
|
20
|
-
menuButton?: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default function PageHeader({
|
|
24
|
-
title,
|
|
25
|
-
subtitle,
|
|
26
|
-
curved,
|
|
27
|
-
children,
|
|
28
|
-
iconEnd,
|
|
29
|
-
border,
|
|
30
|
-
menuButton,
|
|
31
|
-
}: PageHeaderProps) {
|
|
32
|
-
const navigation = useNavigation();
|
|
33
|
-
|
|
34
|
-
const translateX = useRef(new Animated.Value(60)).current;
|
|
35
|
-
const opacity = useRef(new Animated.Value(0)).current;
|
|
36
|
-
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
Animated.spring(translateX, {
|
|
39
|
-
toValue: 0,
|
|
40
|
-
stiffness: 40,
|
|
41
|
-
damping: 10,
|
|
42
|
-
useNativeDriver: true,
|
|
43
|
-
}).start();
|
|
44
|
-
Animated.spring(opacity, {
|
|
45
|
-
toValue: 1,
|
|
46
|
-
delay: 250,
|
|
47
|
-
useNativeDriver: true,
|
|
48
|
-
}).start();
|
|
49
|
-
});
|
|
50
|
-
return (
|
|
51
|
-
<View style={[tw`${curved ? "-mb-2" : ""} ${border ? "border-b border-slate-300" : ""} `, {}]}>
|
|
52
|
-
<View style={tw`overflow-hidden`}>
|
|
53
|
-
<Animated.View
|
|
54
|
-
style={[
|
|
55
|
-
tw`flex-row pr-4 pl-3 pb-3`,
|
|
56
|
-
{
|
|
57
|
-
paddingTop: Constants.statusBarHeight + 8,
|
|
58
|
-
transform: [{ translateX }],
|
|
59
|
-
opacity,
|
|
60
|
-
},
|
|
61
|
-
]}
|
|
62
|
-
>
|
|
63
|
-
<Animated.View
|
|
64
|
-
style={[tw`-mt-2 left-3 absolute `, { transform: [{ translateX }], opacity, paddingTop: Constants.statusBarHeight + 8 }]}
|
|
65
|
-
>
|
|
66
|
-
{menuButton ?
|
|
67
|
-
<MenuIcon
|
|
68
|
-
onPress={() => navigation?.openDrawer()}
|
|
69
|
-
size={24}
|
|
70
|
-
// onPress={() => navigation.navigate("Dashboard")}
|
|
71
|
-
style={tw`text-slate-900 mt-2`}
|
|
72
|
-
/>
|
|
73
|
-
:
|
|
74
|
-
|
|
75
|
-
<EButtonIcon
|
|
76
|
-
iconColor={curved ? "white" : "tint-slate-900"}
|
|
77
|
-
size={24}
|
|
78
|
-
// onPress={() => navigation.navigate("Dashboard")}
|
|
79
|
-
onPress={() => navigation.goBack()}
|
|
80
|
-
/>
|
|
81
|
-
}
|
|
82
|
-
</Animated.View>
|
|
83
|
-
<View style={tw`flex-1 items-center`}>
|
|
84
|
-
<EText
|
|
85
|
-
size="base"
|
|
86
|
-
style={tw.style("text-black font-semibold ", curved && "text-white ")}
|
|
87
|
-
>
|
|
88
|
-
{title}
|
|
89
|
-
</EText>
|
|
90
|
-
{subtitle ? (
|
|
91
|
-
<EText
|
|
92
|
-
style={tw.style(
|
|
93
|
-
"text-slate-800 opacity-40 font-semibold mt-0.25",
|
|
94
|
-
curved && "text-white "
|
|
95
|
-
)}
|
|
96
|
-
>
|
|
97
|
-
{subtitle}
|
|
98
|
-
</EText>
|
|
99
|
-
) : null}
|
|
100
|
-
</View>
|
|
101
|
-
|
|
102
|
-
{iconEnd ? (
|
|
103
|
-
<View style={[tw`mt-0.5 items-center justify-center`, {}]}>
|
|
104
|
-
{iconEnd}
|
|
105
|
-
</View>
|
|
106
|
-
) : null}
|
|
107
|
-
</Animated.View>
|
|
108
|
-
{children ? <View style={tw.style("pb-6")}>{children}</View> : null}
|
|
109
|
-
</View>
|
|
110
|
-
|
|
111
|
-
{/* MASK */}
|
|
112
|
-
{curved ? (
|
|
113
|
-
<View
|
|
114
|
-
style={[
|
|
115
|
-
tw``,
|
|
116
|
-
{ height: 32, width: SCREEN_WIDTH, backgroundColor: "#0547FA" },
|
|
117
|
-
]}
|
|
118
|
-
>
|
|
119
|
-
<View
|
|
120
|
-
style={[
|
|
121
|
-
tw`bg-white -z-0`,
|
|
122
|
-
{ height: 64, width: SCREEN_WIDTH, borderTopLeftRadius: 32 },
|
|
123
|
-
]}
|
|
124
|
-
/>
|
|
125
|
-
</View>
|
|
126
|
-
) : null}
|
|
127
|
-
</View>
|
|
128
|
-
);
|
|
129
|
-
}
|
|
1
|
+
import { View, Animated, Dimensions, Image } 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 EButtonIcon from "./EButtonIcon";
|
|
6
|
+
import EText from "./EText";
|
|
7
|
+
import Constants from "expo-constants";
|
|
8
|
+
import { MenuIcon } from "react-native-heroicons/outline";
|
|
9
|
+
|
|
10
|
+
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
11
|
+
const HEADER_HEIGHT = 90;
|
|
12
|
+
|
|
13
|
+
interface PageHeaderProps {
|
|
14
|
+
title: string;
|
|
15
|
+
subtitle?: string;
|
|
16
|
+
curved?: boolean;
|
|
17
|
+
children?: JSX.Element;
|
|
18
|
+
iconEnd?: JSX.Element;
|
|
19
|
+
border?: boolean;
|
|
20
|
+
menuButton?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default function PageHeader({
|
|
24
|
+
title,
|
|
25
|
+
subtitle,
|
|
26
|
+
curved,
|
|
27
|
+
children,
|
|
28
|
+
iconEnd,
|
|
29
|
+
border,
|
|
30
|
+
menuButton,
|
|
31
|
+
}: PageHeaderProps) {
|
|
32
|
+
const navigation = useNavigation();
|
|
33
|
+
|
|
34
|
+
const translateX = useRef(new Animated.Value(60)).current;
|
|
35
|
+
const opacity = useRef(new Animated.Value(0)).current;
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
Animated.spring(translateX, {
|
|
39
|
+
toValue: 0,
|
|
40
|
+
stiffness: 40,
|
|
41
|
+
damping: 10,
|
|
42
|
+
useNativeDriver: true,
|
|
43
|
+
}).start();
|
|
44
|
+
Animated.spring(opacity, {
|
|
45
|
+
toValue: 1,
|
|
46
|
+
delay: 250,
|
|
47
|
+
useNativeDriver: true,
|
|
48
|
+
}).start();
|
|
49
|
+
});
|
|
50
|
+
return (
|
|
51
|
+
<View style={[tw`${curved ? "-mb-2" : ""} ${border ? "border-b border-slate-300" : ""} `, {}]}>
|
|
52
|
+
<View style={tw`overflow-hidden`}>
|
|
53
|
+
<Animated.View
|
|
54
|
+
style={[
|
|
55
|
+
tw`flex-row pr-4 pl-3 pb-3`,
|
|
56
|
+
{
|
|
57
|
+
paddingTop: Constants.statusBarHeight + 8,
|
|
58
|
+
transform: [{ translateX }],
|
|
59
|
+
opacity,
|
|
60
|
+
},
|
|
61
|
+
]}
|
|
62
|
+
>
|
|
63
|
+
<Animated.View
|
|
64
|
+
style={[tw`-mt-2 left-3 absolute `, { transform: [{ translateX }], opacity, paddingTop: Constants.statusBarHeight + 8 }]}
|
|
65
|
+
>
|
|
66
|
+
{menuButton ?
|
|
67
|
+
<MenuIcon
|
|
68
|
+
onPress={() => navigation?.openDrawer()}
|
|
69
|
+
size={24}
|
|
70
|
+
// onPress={() => navigation.navigate("Dashboard")}
|
|
71
|
+
style={tw`text-slate-900 mt-2`}
|
|
72
|
+
/>
|
|
73
|
+
:
|
|
74
|
+
|
|
75
|
+
<EButtonIcon
|
|
76
|
+
iconColor={curved ? "white" : "tint-slate-900"}
|
|
77
|
+
size={24}
|
|
78
|
+
// onPress={() => navigation.navigate("Dashboard")}
|
|
79
|
+
onPress={() => navigation.goBack()}
|
|
80
|
+
/>
|
|
81
|
+
}
|
|
82
|
+
</Animated.View>
|
|
83
|
+
<View style={tw`flex-1 items-center`}>
|
|
84
|
+
<EText
|
|
85
|
+
size="base"
|
|
86
|
+
style={tw.style("text-black font-semibold ", curved && "text-white ")}
|
|
87
|
+
>
|
|
88
|
+
{title}
|
|
89
|
+
</EText>
|
|
90
|
+
{subtitle ? (
|
|
91
|
+
<EText
|
|
92
|
+
style={tw.style(
|
|
93
|
+
"text-slate-800 opacity-40 font-semibold mt-0.25",
|
|
94
|
+
curved && "text-white "
|
|
95
|
+
)}
|
|
96
|
+
>
|
|
97
|
+
{subtitle}
|
|
98
|
+
</EText>
|
|
99
|
+
) : null}
|
|
100
|
+
</View>
|
|
101
|
+
|
|
102
|
+
{iconEnd ? (
|
|
103
|
+
<View style={[tw`mt-0.5 items-center justify-center`, {}]}>
|
|
104
|
+
{iconEnd}
|
|
105
|
+
</View>
|
|
106
|
+
) : null}
|
|
107
|
+
</Animated.View>
|
|
108
|
+
{children ? <View style={tw.style("pb-6")}>{children}</View> : null}
|
|
109
|
+
</View>
|
|
110
|
+
|
|
111
|
+
{/* MASK */}
|
|
112
|
+
{curved ? (
|
|
113
|
+
<View
|
|
114
|
+
style={[
|
|
115
|
+
tw``,
|
|
116
|
+
{ height: 32, width: SCREEN_WIDTH, backgroundColor: "#0547FA" },
|
|
117
|
+
]}
|
|
118
|
+
>
|
|
119
|
+
<View
|
|
120
|
+
style={[
|
|
121
|
+
tw`bg-white -z-0`,
|
|
122
|
+
{ height: 64, width: SCREEN_WIDTH, borderTopLeftRadius: 32 },
|
|
123
|
+
]}
|
|
124
|
+
/>
|
|
125
|
+
</View>
|
|
126
|
+
) : null}
|
|
127
|
+
</View>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
import {
|
|
2
|
-
View,
|
|
3
|
-
ImageBackground,
|
|
4
|
-
Dimensions,
|
|
5
|
-
Animated,
|
|
6
|
-
ScrollView,
|
|
7
|
-
Platform,
|
|
8
|
-
} from "react-native";
|
|
9
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
10
|
-
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
11
|
-
import tw from "../lib/tailwind";
|
|
12
|
-
import EText from "./EText";
|
|
13
|
-
import { StatusBar } from "expo-status-bar";
|
|
14
|
-
import {
|
|
15
|
-
Container,
|
|
16
|
-
EButton,
|
|
17
|
-
EButtonIcon,
|
|
18
|
-
PageHeader,
|
|
19
|
-
PageHeaderSecondary,
|
|
20
|
-
} from ".";
|
|
21
|
-
import Constants from "expo-constants";
|
|
22
|
-
import { useNavigation } from "@react-navigation/native";
|
|
23
|
-
|
|
24
|
-
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
25
|
-
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
|
26
|
-
const HEADER_HEIGHT = Constants.statusBarHeight + 60;
|
|
27
|
-
const SCROLL_PADDING_BOTTOM = 100;
|
|
28
|
-
|
|
29
|
-
interface BaseLayoutProps {
|
|
30
|
-
title: string;
|
|
31
|
-
subtitle?: string;
|
|
32
|
-
curved?: boolean;
|
|
33
|
-
headerContent?: JSX.Element;
|
|
34
|
-
children?: JSX.Element | JSX.Element[];
|
|
35
|
-
iconEnd?: JSX.Element;
|
|
36
|
-
noScroll?: boolean;
|
|
37
|
-
bottomButton?: JSX.Element;
|
|
38
|
-
border?: boolean;
|
|
39
|
-
menuButton?: boolean;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export default function SecondaryBaseLayout({
|
|
43
|
-
title,
|
|
44
|
-
subtitle,
|
|
45
|
-
curved,
|
|
46
|
-
headerContent,
|
|
47
|
-
children,
|
|
48
|
-
noScroll,
|
|
49
|
-
iconEnd,
|
|
50
|
-
bottomButton,
|
|
51
|
-
border,
|
|
52
|
-
menuButton,
|
|
53
|
-
}: BaseLayoutProps) {
|
|
54
|
-
const insets = useSafeAreaInsets();
|
|
55
|
-
|
|
56
|
-
const navigation = useNavigation();
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<View
|
|
60
|
-
style={[
|
|
61
|
-
tw`flex-1 bg-white`,
|
|
62
|
-
{
|
|
63
|
-
paddingBottom: Platform.OS === "ios" ? insets.bottom : 0,
|
|
64
|
-
paddingTop: Platform.OS === "ios" ? 12 : 24,
|
|
65
|
-
},
|
|
66
|
-
]}
|
|
67
|
-
>
|
|
68
|
-
<StatusBar style="dark" animated />
|
|
69
|
-
|
|
70
|
-
{/* HEADER */}
|
|
71
|
-
<View
|
|
72
|
-
style={[
|
|
73
|
-
tw`absolute top-0 right-0 left-0 pt-2 z-10 w-full bg-white ${
|
|
74
|
-
title ? "mb-1" : "pb-0"
|
|
75
|
-
}`,
|
|
76
|
-
]}
|
|
77
|
-
>
|
|
78
|
-
{/* <PageHeaderSecondary
|
|
79
|
-
title={title}
|
|
80
|
-
subtitle={subtitle}
|
|
81
|
-
button={
|
|
82
|
-
<EButtonIcon
|
|
83
|
-
type="close"
|
|
84
|
-
iconColor="slate-800"
|
|
85
|
-
onPress={() => navigation.goBack()}
|
|
86
|
-
/>
|
|
87
|
-
}
|
|
88
|
-
/> */}
|
|
89
|
-
<PageHeader
|
|
90
|
-
border={border}
|
|
91
|
-
title={title}
|
|
92
|
-
subtitle={subtitle}
|
|
93
|
-
curved={curved}
|
|
94
|
-
iconEnd={iconEnd}
|
|
95
|
-
menuButton={menuButton}
|
|
96
|
-
>
|
|
97
|
-
{headerContent}
|
|
98
|
-
</PageHeader>
|
|
99
|
-
</View>
|
|
100
|
-
<ScrollView
|
|
101
|
-
style={[
|
|
102
|
-
tw`flex-1`,
|
|
103
|
-
{ paddingBottom: insets.bottom, paddingTop: !title ? 80 : 80 },
|
|
104
|
-
]}
|
|
105
|
-
showsVerticalScrollIndicator={false}
|
|
106
|
-
decelerationRate={"fast"}
|
|
107
|
-
contentContainerStyle={{
|
|
108
|
-
paddingBottom: SCROLL_PADDING_BOTTOM,
|
|
109
|
-
}}
|
|
110
|
-
>
|
|
111
|
-
{children}
|
|
112
|
-
</ScrollView>
|
|
113
|
-
{bottomButton ? (
|
|
114
|
-
<View style={[tw` px-4 `, {paddingBottom: Platform.OS ==='android' ? 8 : 0}]}>{bottomButton}</View>
|
|
115
|
-
) : (
|
|
116
|
-
<></>
|
|
117
|
-
)}
|
|
118
|
-
</View>
|
|
119
|
-
);
|
|
120
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
View,
|
|
3
|
+
ImageBackground,
|
|
4
|
+
Dimensions,
|
|
5
|
+
Animated,
|
|
6
|
+
ScrollView,
|
|
7
|
+
Platform,
|
|
8
|
+
} from "react-native";
|
|
9
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
10
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
11
|
+
import tw from "../lib/tailwind";
|
|
12
|
+
import EText from "./EText";
|
|
13
|
+
import { StatusBar } from "expo-status-bar";
|
|
14
|
+
import {
|
|
15
|
+
Container,
|
|
16
|
+
EButton,
|
|
17
|
+
EButtonIcon,
|
|
18
|
+
PageHeader,
|
|
19
|
+
PageHeaderSecondary,
|
|
20
|
+
} from ".";
|
|
21
|
+
import Constants from "expo-constants";
|
|
22
|
+
import { useNavigation } from "@react-navigation/native";
|
|
23
|
+
|
|
24
|
+
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
25
|
+
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
|
26
|
+
const HEADER_HEIGHT = Constants.statusBarHeight + 60;
|
|
27
|
+
const SCROLL_PADDING_BOTTOM = 100;
|
|
28
|
+
|
|
29
|
+
interface BaseLayoutProps {
|
|
30
|
+
title: string;
|
|
31
|
+
subtitle?: string;
|
|
32
|
+
curved?: boolean;
|
|
33
|
+
headerContent?: JSX.Element;
|
|
34
|
+
children?: JSX.Element | JSX.Element[];
|
|
35
|
+
iconEnd?: JSX.Element;
|
|
36
|
+
noScroll?: boolean;
|
|
37
|
+
bottomButton?: JSX.Element;
|
|
38
|
+
border?: boolean;
|
|
39
|
+
menuButton?: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default function SecondaryBaseLayout({
|
|
43
|
+
title,
|
|
44
|
+
subtitle,
|
|
45
|
+
curved,
|
|
46
|
+
headerContent,
|
|
47
|
+
children,
|
|
48
|
+
noScroll,
|
|
49
|
+
iconEnd,
|
|
50
|
+
bottomButton,
|
|
51
|
+
border,
|
|
52
|
+
menuButton,
|
|
53
|
+
}: BaseLayoutProps) {
|
|
54
|
+
const insets = useSafeAreaInsets();
|
|
55
|
+
|
|
56
|
+
const navigation = useNavigation();
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<View
|
|
60
|
+
style={[
|
|
61
|
+
tw`flex-1 bg-white`,
|
|
62
|
+
{
|
|
63
|
+
paddingBottom: Platform.OS === "ios" ? insets.bottom : 0,
|
|
64
|
+
paddingTop: Platform.OS === "ios" ? 12 : 24,
|
|
65
|
+
},
|
|
66
|
+
]}
|
|
67
|
+
>
|
|
68
|
+
<StatusBar style="dark" animated />
|
|
69
|
+
|
|
70
|
+
{/* HEADER */}
|
|
71
|
+
<View
|
|
72
|
+
style={[
|
|
73
|
+
tw`absolute top-0 right-0 left-0 pt-2 z-10 w-full bg-white ${
|
|
74
|
+
title ? "mb-1" : "pb-0"
|
|
75
|
+
}`,
|
|
76
|
+
]}
|
|
77
|
+
>
|
|
78
|
+
{/* <PageHeaderSecondary
|
|
79
|
+
title={title}
|
|
80
|
+
subtitle={subtitle}
|
|
81
|
+
button={
|
|
82
|
+
<EButtonIcon
|
|
83
|
+
type="close"
|
|
84
|
+
iconColor="slate-800"
|
|
85
|
+
onPress={() => navigation.goBack()}
|
|
86
|
+
/>
|
|
87
|
+
}
|
|
88
|
+
/> */}
|
|
89
|
+
<PageHeader
|
|
90
|
+
border={border}
|
|
91
|
+
title={title}
|
|
92
|
+
subtitle={subtitle}
|
|
93
|
+
curved={curved}
|
|
94
|
+
iconEnd={iconEnd}
|
|
95
|
+
menuButton={menuButton}
|
|
96
|
+
>
|
|
97
|
+
{headerContent}
|
|
98
|
+
</PageHeader>
|
|
99
|
+
</View>
|
|
100
|
+
<ScrollView
|
|
101
|
+
style={[
|
|
102
|
+
tw`flex-1`,
|
|
103
|
+
{ paddingBottom: insets.bottom, paddingTop: !title ? 80 : 80 },
|
|
104
|
+
]}
|
|
105
|
+
showsVerticalScrollIndicator={false}
|
|
106
|
+
decelerationRate={"fast"}
|
|
107
|
+
contentContainerStyle={{
|
|
108
|
+
paddingBottom: SCROLL_PADDING_BOTTOM,
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
{children}
|
|
112
|
+
</ScrollView>
|
|
113
|
+
{bottomButton ? (
|
|
114
|
+
<View style={[tw` px-4 `, {paddingBottom: Platform.OS ==='android' ? 8 : 0}]}>{bottomButton}</View>
|
|
115
|
+
) : (
|
|
116
|
+
<></>
|
|
117
|
+
)}
|
|
118
|
+
</View>
|
|
119
|
+
);
|
|
120
|
+
}
|