fln-espranza 0.0.22 → 0.0.23
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/assets/images/bg-profile.jpg +0 -0
- 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 +48 -48
- package/components/EListSchool.tsx +35 -35
- package/components/EOption.tsx +85 -85
- 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 +116 -115
- package/components/ProfileHeader.tsx +85 -0
- package/components/ProfileScreenLayout.tsx +110 -0
- 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,115 +1,116 @@
|
|
|
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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
{
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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 from "./icons/EIconArrowLeft";
|
|
8
|
+
import EIconMenu from "./icons/EIconMenu";
|
|
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`${"border-none border-slate-300 bg-white shadow-lg py-3"} `, {}]}>
|
|
52
|
+
<View style={tw`overflow-hidden`}>
|
|
53
|
+
<View
|
|
54
|
+
style={[
|
|
55
|
+
tw`flex-row items-center px-3`,
|
|
56
|
+
{
|
|
57
|
+
paddingTop: Constants.statusBarHeight + 8,
|
|
58
|
+
},
|
|
59
|
+
]}
|
|
60
|
+
>
|
|
61
|
+
{/* LEFT ICON */}
|
|
62
|
+
<View
|
|
63
|
+
style={[tw`` ]}
|
|
64
|
+
>
|
|
65
|
+
{menuButton ?
|
|
66
|
+
<TouchableOpacity activeOpacity={0.6}
|
|
67
|
+
onPress={() => navigation?.openDrawer()}>
|
|
68
|
+
<EIconMenu
|
|
69
|
+
size={24}
|
|
70
|
+
style={tw`text-slate-800`}
|
|
71
|
+
/>
|
|
72
|
+
</TouchableOpacity>
|
|
73
|
+
|
|
74
|
+
:
|
|
75
|
+
<TouchableOpacity activeOpacity={0.6}
|
|
76
|
+
onPress={() => navigation.goBack()}>
|
|
77
|
+
<EIconArrowLeft
|
|
78
|
+
iconColor={curved ? "white" : "tint-slate-900"}
|
|
79
|
+
size={24}
|
|
80
|
+
// onPress={() => navigation.navigate("Dashboard")}
|
|
81
|
+
style={tw`text-slate-800`}
|
|
82
|
+
/>
|
|
83
|
+
</TouchableOpacity>
|
|
84
|
+
}
|
|
85
|
+
</View>
|
|
86
|
+
{/* TITLE */}
|
|
87
|
+
<View style={tw`flex-1 items-start px-3`}>
|
|
88
|
+
<EText
|
|
89
|
+
size="lg"
|
|
90
|
+
style={tw.style("text-slate-800 font-bold")}
|
|
91
|
+
>
|
|
92
|
+
{title}
|
|
93
|
+
</EText>
|
|
94
|
+
{subtitle ? (
|
|
95
|
+
<EText
|
|
96
|
+
style={tw.style(
|
|
97
|
+
"text-slate-800 opacity-40 font-semibold mt-0.25"
|
|
98
|
+
)}
|
|
99
|
+
>
|
|
100
|
+
{subtitle}
|
|
101
|
+
</EText>
|
|
102
|
+
) : null}
|
|
103
|
+
</View>
|
|
104
|
+
|
|
105
|
+
{/* RIGHT ICON */}
|
|
106
|
+
{iconEnd ? (
|
|
107
|
+
<View style={[tw``, {}]}>
|
|
108
|
+
{iconEnd}
|
|
109
|
+
</View>
|
|
110
|
+
) : null}
|
|
111
|
+
</View>
|
|
112
|
+
{children ? <View style={tw.style("pb-6")}>{children}</View> : null}
|
|
113
|
+
</View>
|
|
114
|
+
</View>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { useNavigation } from "@react-navigation/native";
|
|
2
|
+
import React, { useRef } from "react";
|
|
3
|
+
import { Animated, ImageBackground, View } from "react-native";
|
|
4
|
+
import EButtonIcon from "./EButtonIcon";
|
|
5
|
+
import Avatar from "./Avatar";
|
|
6
|
+
import EText from "./EText";
|
|
7
|
+
import tw from "../../../lib/tailwind";
|
|
8
|
+
import Constants from "expo-constants";
|
|
9
|
+
|
|
10
|
+
interface IProps {
|
|
11
|
+
name: string;
|
|
12
|
+
titleText?: string;
|
|
13
|
+
title: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default function ProfileHeader({ name, title, titleText }: IProps) {
|
|
17
|
+
const translateX = useRef(new Animated.Value(60)).current;
|
|
18
|
+
const opacity = useRef(new Animated.Value(0)).current;
|
|
19
|
+
const navigation = useNavigation();
|
|
20
|
+
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
Animated.spring(translateX, {
|
|
23
|
+
toValue: 0,
|
|
24
|
+
stiffness: 40,
|
|
25
|
+
damping: 10,
|
|
26
|
+
useNativeDriver: true,
|
|
27
|
+
}).start();
|
|
28
|
+
Animated.spring(opacity, {
|
|
29
|
+
toValue: 1,
|
|
30
|
+
delay: 250,
|
|
31
|
+
useNativeDriver: true,
|
|
32
|
+
}).start();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<View style={tw`flex-1 overflow-hidden h-full`}>
|
|
37
|
+
<ImageBackground
|
|
38
|
+
style={[tw`h-full w-full`, {}]}
|
|
39
|
+
source={require("../assets/images/bg-profile.jpg")}
|
|
40
|
+
>
|
|
41
|
+
<Animated.View
|
|
42
|
+
style={[
|
|
43
|
+
tw`flex-row pr-4 pl-3 pb-3`,
|
|
44
|
+
{
|
|
45
|
+
paddingTop: Constants.statusBarHeight + 8,
|
|
46
|
+
transform: [{ translateX }],
|
|
47
|
+
opacity,
|
|
48
|
+
},
|
|
49
|
+
]}
|
|
50
|
+
>
|
|
51
|
+
<Animated.View
|
|
52
|
+
style={[
|
|
53
|
+
tw`-mt-2 left-3 absolute `,
|
|
54
|
+
{
|
|
55
|
+
transform: [{ translateX }],
|
|
56
|
+
opacity,
|
|
57
|
+
paddingTop: Constants.statusBarHeight + 8,
|
|
58
|
+
},
|
|
59
|
+
]}
|
|
60
|
+
>
|
|
61
|
+
<EButtonIcon
|
|
62
|
+
iconColor={"tint-white"}
|
|
63
|
+
size={20}
|
|
64
|
+
onPress={() => navigation.goBack()}
|
|
65
|
+
/>
|
|
66
|
+
</Animated.View>
|
|
67
|
+
</Animated.View>
|
|
68
|
+
<View style={[tw`flex items-center mt-5 rounded-4xl `, {}]}>
|
|
69
|
+
<Avatar size="5xl" source={""} nameFirstLetter={name?.split("")[0]} />
|
|
70
|
+
<View style={tw`mt-6 mb-8 items-center`}>
|
|
71
|
+
<EText size="2xl" style={tw`font-bold text-white capitalize`}>
|
|
72
|
+
{name.toLocaleLowerCase().trim()}
|
|
73
|
+
</EText>
|
|
74
|
+
<EText
|
|
75
|
+
size="sm"
|
|
76
|
+
style={tw`mt-0.5 font-normal opacity-50 text-white`}
|
|
77
|
+
>
|
|
78
|
+
{titleText ? titleText : "Unique Code"} : {title}
|
|
79
|
+
</EText>
|
|
80
|
+
</View>
|
|
81
|
+
</View>
|
|
82
|
+
</ImageBackground>
|
|
83
|
+
</View>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Animated, ImageBackground, View } from "react-native";
|
|
2
|
+
import tw from "../../lib/tailwind";
|
|
3
|
+
import EButtonIcon from "./EButtonIcon";
|
|
4
|
+
import EText from "./EText";
|
|
5
|
+
import React, { useCallback, useRef } from "react";
|
|
6
|
+
import Constants from "expo-constants";
|
|
7
|
+
import { SCREEN_HEIGHT } from "@gorhom/bottom-sheet";
|
|
8
|
+
import { useFocusEffect, useNavigation } from "@react-navigation/native";
|
|
9
|
+
import { StatusBar } from "expo-status-bar";
|
|
10
|
+
import ProfileHeader from "./ProfileHeader";
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
interface IProps {
|
|
14
|
+
profileName: string;
|
|
15
|
+
titleText?: string;
|
|
16
|
+
uniqueCode: string;
|
|
17
|
+
body: JSX.Element;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default function ProfileScreenLayout( { profileName, uniqueCode, body, titleText } : IProps) {
|
|
21
|
+
const opacity = useRef(new Animated.Value(0)).current;
|
|
22
|
+
const [headerScrolled, setHeaderScrolled] = React.useState(false);
|
|
23
|
+
const scrollY = useRef(new Animated.Value(0)).current;
|
|
24
|
+
const navigation = useNavigation();
|
|
25
|
+
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
Animated.spring(scrollY, {
|
|
28
|
+
toValue: headerScrolled ? 0 : -100,
|
|
29
|
+
speed: 2,
|
|
30
|
+
delay: 1,
|
|
31
|
+
bounciness: 1,
|
|
32
|
+
useNativeDriver: true,
|
|
33
|
+
}).start();
|
|
34
|
+
|
|
35
|
+
Animated.spring(opacity, {
|
|
36
|
+
toValue: headerScrolled ? 0.975 : 0,
|
|
37
|
+
speed: 2,
|
|
38
|
+
delay: 1,
|
|
39
|
+
bounciness: 1,
|
|
40
|
+
useNativeDriver: true,
|
|
41
|
+
}).start();
|
|
42
|
+
}, [headerScrolled]);
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<View style={tw``}>
|
|
48
|
+
<StatusBar
|
|
49
|
+
style={"light"}
|
|
50
|
+
animated
|
|
51
|
+
/>
|
|
52
|
+
<Animated.View
|
|
53
|
+
style={[
|
|
54
|
+
tw`absolute top-0 left-0 right-0 z-10`,
|
|
55
|
+
{
|
|
56
|
+
transform: [{ translateY: scrollY }],
|
|
57
|
+
opacity,
|
|
58
|
+
},
|
|
59
|
+
]}
|
|
60
|
+
>
|
|
61
|
+
<ImageBackground
|
|
62
|
+
style={[tw`flex-1`, {}]}
|
|
63
|
+
source={require("../assets/images/bg-profile.jpg")}
|
|
64
|
+
>
|
|
65
|
+
<View
|
|
66
|
+
style={[
|
|
67
|
+
tw`flex-1 pl-3 pb-3 flex-row items-center `,
|
|
68
|
+
{ paddingTop: Constants.statusBarHeight + 4 },
|
|
69
|
+
]}
|
|
70
|
+
>
|
|
71
|
+
<EButtonIcon
|
|
72
|
+
iconColor={"white"}
|
|
73
|
+
size={20}
|
|
74
|
+
onPress={() => navigation.goBack()}
|
|
75
|
+
/>
|
|
76
|
+
<EText size="lg" style={tw`text-white font-bold ml-2`}>
|
|
77
|
+
Profile
|
|
78
|
+
</EText>
|
|
79
|
+
</View>
|
|
80
|
+
</ImageBackground>
|
|
81
|
+
</Animated.View>
|
|
82
|
+
|
|
83
|
+
<Animated.ScrollView
|
|
84
|
+
onScroll={(event) => {
|
|
85
|
+
const scrolling = event.nativeEvent.contentOffset.y;
|
|
86
|
+
scrolling > 40 ? setHeaderScrolled(true) : setHeaderScrolled(false);
|
|
87
|
+
}}
|
|
88
|
+
style={[tw`flex-1 bg-white`, { minHeight: SCREEN_HEIGHT, paddingBottom: 100 }]}
|
|
89
|
+
scrollEventThrottle={16}
|
|
90
|
+
showsVerticalScrollIndicator={false}
|
|
91
|
+
decelerationRate={"fast"}
|
|
92
|
+
contentContainerStyle={{
|
|
93
|
+
paddingBottom: 100
|
|
94
|
+
}}
|
|
95
|
+
>
|
|
96
|
+
|
|
97
|
+
<ProfileHeader
|
|
98
|
+
name={profileName?.trim() || ""}
|
|
99
|
+
title={uniqueCode || ""}
|
|
100
|
+
titleText={titleText ? titleText : "Unique Code"}
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
<View style={tw`px-4 mt-8 flex-1`}>
|
|
104
|
+
{body}
|
|
105
|
+
</View>
|
|
106
|
+
|
|
107
|
+
</Animated.ScrollView>
|
|
108
|
+
</View>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
import { View, Dimensions, ScrollView, Platform } from "react-native";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
4
|
-
import tw from "../lib/tailwind";
|
|
5
|
-
import { StatusBar } from "expo-status-bar";
|
|
6
|
-
import { PageHeader } from ".";
|
|
7
|
-
import Constants from "expo-constants";
|
|
8
|
-
import { useNavigation } from "@react-navigation/native";
|
|
9
|
-
|
|
10
|
-
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
11
|
-
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
|
12
|
-
const HEADER_HEIGHT = Constants.statusBarHeight + 60;
|
|
13
|
-
const SCROLL_PADDING_BOTTOM = 100;
|
|
14
|
-
|
|
15
|
-
interface BaseLayoutProps {
|
|
16
|
-
title: string;
|
|
17
|
-
subtitle?: string;
|
|
18
|
-
curved?: boolean;
|
|
19
|
-
headerContent?: JSX.Element;
|
|
20
|
-
children?: JSX.Element | JSX.Element[];
|
|
21
|
-
iconEnd?: JSX.Element;
|
|
22
|
-
noScroll?: boolean;
|
|
23
|
-
bottomButton?: JSX.Element;
|
|
24
|
-
border?: boolean;
|
|
25
|
-
menuButton?: boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default function SecondaryBaseLayout({
|
|
29
|
-
title,
|
|
30
|
-
subtitle,
|
|
31
|
-
curved,
|
|
32
|
-
headerContent,
|
|
33
|
-
children,
|
|
34
|
-
noScroll,
|
|
35
|
-
iconEnd,
|
|
36
|
-
bottomButton,
|
|
37
|
-
border,
|
|
38
|
-
menuButton,
|
|
39
|
-
}: BaseLayoutProps) {
|
|
40
|
-
const insets = useSafeAreaInsets();
|
|
41
|
-
|
|
42
|
-
const navigation = useNavigation();
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<View
|
|
46
|
-
style={[
|
|
47
|
-
tw`flex-1 bg-white`,
|
|
48
|
-
{
|
|
49
|
-
paddingBottom: Platform.OS === "ios" ? insets.bottom : 0,
|
|
50
|
-
paddingTop: Platform.OS === "ios" ? 44 : 24,
|
|
51
|
-
},
|
|
52
|
-
]}
|
|
53
|
-
>
|
|
54
|
-
<StatusBar style="dark" animated />
|
|
55
|
-
|
|
56
|
-
{/* HEADER */}
|
|
57
|
-
<View
|
|
58
|
-
style={[
|
|
59
|
-
tw`absolute top-0 right-0 left-0 pt-0 z-10 w-full bg-white ${
|
|
60
|
-
title ? "mb-1" : "pb-0"
|
|
61
|
-
}`,
|
|
62
|
-
]}
|
|
63
|
-
>
|
|
64
|
-
<PageHeader
|
|
65
|
-
border={border}
|
|
66
|
-
title={title}
|
|
67
|
-
subtitle={subtitle}
|
|
68
|
-
curved={curved}
|
|
69
|
-
iconEnd={iconEnd}
|
|
70
|
-
menuButton={menuButton}
|
|
71
|
-
>
|
|
72
|
-
{headerContent}
|
|
73
|
-
</PageHeader>
|
|
74
|
-
</View>
|
|
75
|
-
<ScrollView
|
|
76
|
-
style={[
|
|
77
|
-
tw`flex-1`,
|
|
78
|
-
{ paddingBottom: insets.bottom, paddingTop: !title ? 80 : 80 },
|
|
79
|
-
]}
|
|
80
|
-
showsVerticalScrollIndicator={false}
|
|
81
|
-
decelerationRate={"fast"}
|
|
82
|
-
contentContainerStyle={{
|
|
83
|
-
paddingBottom: SCROLL_PADDING_BOTTOM,
|
|
84
|
-
}}
|
|
85
|
-
>
|
|
86
|
-
{children}
|
|
87
|
-
</ScrollView>
|
|
88
|
-
{bottomButton ? (
|
|
89
|
-
<View
|
|
90
|
-
style={[
|
|
91
|
-
tw` px-4 `,
|
|
92
|
-
{ paddingBottom: Platform.OS === "android" ? 8 : 0 },
|
|
93
|
-
]}
|
|
94
|
-
>
|
|
95
|
-
{bottomButton}
|
|
96
|
-
</View>
|
|
97
|
-
) : (
|
|
98
|
-
<></>
|
|
99
|
-
)}
|
|
100
|
-
</View>
|
|
101
|
-
);
|
|
102
|
-
}
|
|
1
|
+
import { View, Dimensions, ScrollView, Platform } from "react-native";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
4
|
+
import tw from "../lib/tailwind";
|
|
5
|
+
import { StatusBar } from "expo-status-bar";
|
|
6
|
+
import { PageHeader } from ".";
|
|
7
|
+
import Constants from "expo-constants";
|
|
8
|
+
import { useNavigation } from "@react-navigation/native";
|
|
9
|
+
|
|
10
|
+
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
11
|
+
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
|
12
|
+
const HEADER_HEIGHT = Constants.statusBarHeight + 60;
|
|
13
|
+
const SCROLL_PADDING_BOTTOM = 100;
|
|
14
|
+
|
|
15
|
+
interface BaseLayoutProps {
|
|
16
|
+
title: string;
|
|
17
|
+
subtitle?: string;
|
|
18
|
+
curved?: boolean;
|
|
19
|
+
headerContent?: JSX.Element;
|
|
20
|
+
children?: JSX.Element | JSX.Element[];
|
|
21
|
+
iconEnd?: JSX.Element;
|
|
22
|
+
noScroll?: boolean;
|
|
23
|
+
bottomButton?: JSX.Element;
|
|
24
|
+
border?: boolean;
|
|
25
|
+
menuButton?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default function SecondaryBaseLayout({
|
|
29
|
+
title,
|
|
30
|
+
subtitle,
|
|
31
|
+
curved,
|
|
32
|
+
headerContent,
|
|
33
|
+
children,
|
|
34
|
+
noScroll,
|
|
35
|
+
iconEnd,
|
|
36
|
+
bottomButton,
|
|
37
|
+
border,
|
|
38
|
+
menuButton,
|
|
39
|
+
}: BaseLayoutProps) {
|
|
40
|
+
const insets = useSafeAreaInsets();
|
|
41
|
+
|
|
42
|
+
const navigation = useNavigation();
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<View
|
|
46
|
+
style={[
|
|
47
|
+
tw`flex-1 bg-white`,
|
|
48
|
+
{
|
|
49
|
+
paddingBottom: Platform.OS === "ios" ? insets.bottom : 0,
|
|
50
|
+
paddingTop: Platform.OS === "ios" ? 44 : 24,
|
|
51
|
+
},
|
|
52
|
+
]}
|
|
53
|
+
>
|
|
54
|
+
<StatusBar style="dark" animated />
|
|
55
|
+
|
|
56
|
+
{/* HEADER */}
|
|
57
|
+
<View
|
|
58
|
+
style={[
|
|
59
|
+
tw`absolute top-0 right-0 left-0 pt-0 z-10 w-full bg-white ${
|
|
60
|
+
title ? "mb-1" : "pb-0"
|
|
61
|
+
}`,
|
|
62
|
+
]}
|
|
63
|
+
>
|
|
64
|
+
<PageHeader
|
|
65
|
+
border={border}
|
|
66
|
+
title={title}
|
|
67
|
+
subtitle={subtitle}
|
|
68
|
+
curved={curved}
|
|
69
|
+
iconEnd={iconEnd}
|
|
70
|
+
menuButton={menuButton}
|
|
71
|
+
>
|
|
72
|
+
{headerContent}
|
|
73
|
+
</PageHeader>
|
|
74
|
+
</View>
|
|
75
|
+
<ScrollView
|
|
76
|
+
style={[
|
|
77
|
+
tw`flex-1`,
|
|
78
|
+
{ paddingBottom: insets.bottom, paddingTop: !title ? 80 : 80 },
|
|
79
|
+
]}
|
|
80
|
+
showsVerticalScrollIndicator={false}
|
|
81
|
+
decelerationRate={"fast"}
|
|
82
|
+
contentContainerStyle={{
|
|
83
|
+
paddingBottom: SCROLL_PADDING_BOTTOM,
|
|
84
|
+
}}
|
|
85
|
+
>
|
|
86
|
+
{children}
|
|
87
|
+
</ScrollView>
|
|
88
|
+
{bottomButton ? (
|
|
89
|
+
<View
|
|
90
|
+
style={[
|
|
91
|
+
tw` px-4 `,
|
|
92
|
+
{ paddingBottom: Platform.OS === "android" ? 8 : 0 },
|
|
93
|
+
]}
|
|
94
|
+
>
|
|
95
|
+
{bottomButton}
|
|
96
|
+
</View>
|
|
97
|
+
) : (
|
|
98
|
+
<></>
|
|
99
|
+
)}
|
|
100
|
+
</View>
|
|
101
|
+
);
|
|
102
|
+
}
|