fln-espranza 0.0.41 → 0.0.42
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/icon-placeholder-schedule.png +0 -0
- package/components/Avatar.tsx +43 -43
- package/components/BaseLayout.tsx +174 -174
- package/components/Drawer.tsx +125 -125
- package/components/EBadge.tsx +24 -24
- package/components/EButton.tsx +70 -70
- package/components/EButtonIcon.tsx +3 -3
- 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 +54 -54
- package/components/ELabel.tsx +15 -15
- package/components/EListPerson.tsx +52 -52
- package/components/EListSchool.tsx +35 -35
- package/components/ENotFoundPlaceholder.tsx +43 -0
- package/components/EOption.tsx +98 -98
- 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/EProfileScreenLayout.tsx +111 -111
- 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/EStat.tsx +24 -24
- package/components/EText.tsx +41 -41
- package/components/ETextArea.tsx +53 -53
- package/components/ETimeInput.tsx +54 -54
- package/components/ETimeLineCard.tsx +66 -66
- package/components/ListFormView.tsx +36 -36
- package/components/Loader.tsx +31 -31
- package/components/MenuItems.tsx +46 -46
- package/components/PageHeader.tsx +123 -123
- package/components/ProfileHeader.tsx +85 -85
- package/components/SecondaryBaseLayout.tsx +106 -106
- 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/EIconDocumentCheck.jsx +14 -14
- package/components/icons/EIconEdit.jsx +19 -19
- package/components/icons/EIconFemale.jsx +20 -20
- package/components/icons/EIconFile.jsx +21 -21
- package/components/icons/EIconInfo.jsx +20 -20
- package/components/icons/EIconLogout.jsx +19 -19
- package/components/icons/EIconMale.jsx +21 -21
- 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 +67 -67
- package/index.ts +184 -180
- package/package.json +26 -26
- package/utils/Color.ts +14 -14
package/.expo/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
> Why do I have a folder named ".expo" in my project?
|
|
2
|
-
|
|
3
|
-
The ".expo" folder is created when an Expo project is started using "expo start" command.
|
|
4
|
-
|
|
5
|
-
> What do the files contain?
|
|
6
|
-
|
|
7
|
-
- "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
|
|
8
|
-
- "packager-info.json": contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator.
|
|
9
|
-
- "settings.json": contains the server configuration that is used to serve the application manifest.
|
|
10
|
-
|
|
11
|
-
> Should I commit the ".expo" folder?
|
|
12
|
-
|
|
13
|
-
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
|
|
14
|
-
|
|
15
|
-
Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
|
|
1
|
+
> Why do I have a folder named ".expo" in my project?
|
|
2
|
+
|
|
3
|
+
The ".expo" folder is created when an Expo project is started using "expo start" command.
|
|
4
|
+
|
|
5
|
+
> What do the files contain?
|
|
6
|
+
|
|
7
|
+
- "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
|
|
8
|
+
- "packager-info.json": contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator.
|
|
9
|
+
- "settings.json": contains the server configuration that is used to serve the application manifest.
|
|
10
|
+
|
|
11
|
+
> Should I commit the ".expo" folder?
|
|
12
|
+
|
|
13
|
+
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
|
|
14
|
+
|
|
15
|
+
Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
|
package/.expo/settings.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
"hostType": "lan",
|
|
3
|
-
"lanType": "ip",
|
|
4
|
-
"dev": true,
|
|
5
|
-
"minify": false,
|
|
6
|
-
"urlRandomness": null,
|
|
7
|
-
"https": false
|
|
8
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"hostType": "lan",
|
|
3
|
+
"lanType": "ip",
|
|
4
|
+
"dev": true,
|
|
5
|
+
"minify": false,
|
|
6
|
+
"urlRandomness": null,
|
|
7
|
+
"https": false
|
|
8
|
+
}
|
|
Binary file
|
package/components/Avatar.tsx
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { View, Image, ImageProps } from "react-native";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import tw from "../lib/tailwind";
|
|
4
|
-
import EText from "./EText";
|
|
5
|
-
|
|
6
|
-
interface AvatarProps {
|
|
7
|
-
size?: "xxs" | "xs" | "sm" | "lg" | "5xl";
|
|
8
|
-
source: string;
|
|
9
|
-
nameFirstLetter?: string;
|
|
10
|
-
textColor?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default function Avatar({ size, source, nameFirstLetter, textColor }: AvatarProps) {
|
|
14
|
-
let colors = [
|
|
15
|
-
"#00BE9B",
|
|
16
|
-
"#0993BF",
|
|
17
|
-
"#64748B",
|
|
18
|
-
"#3F3D84",
|
|
19
|
-
"#0993BF",
|
|
20
|
-
"#525252",
|
|
21
|
-
"#EA580C",
|
|
22
|
-
"#2D3A5D",
|
|
23
|
-
]
|
|
24
|
-
|
|
25
|
-
// let color = colors[Math.floor(Math.random() * colors.length)]
|
|
26
|
-
const [color, setColor] = React.useState(colors[Math.floor(Math.random() * colors.length)]);
|
|
27
|
-
return (
|
|
28
|
-
<View
|
|
29
|
-
style={tw.style(
|
|
30
|
-
"flex items-center justify-center w-16 h-16 rounded-full overflow-hidden",
|
|
31
|
-
size === "lg" && "w-16 h-16",
|
|
32
|
-
size === "sm" && "w-12 h-12",
|
|
33
|
-
size === "xs" && "w-10 h-10",
|
|
34
|
-
size === "xxs" && "w-7 h-7",
|
|
35
|
-
size === "5xl" && "w-20 h-20",
|
|
36
|
-
`bg-[${color}]`
|
|
37
|
-
)}
|
|
38
|
-
>
|
|
39
|
-
{source ? <Image style={tw`w-full h-full `} source={source} /> :
|
|
40
|
-
<EText style={tw`text-xl font-bold text-white uppercase`}>{nameFirstLetter}</EText>}
|
|
41
|
-
</View>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
1
|
+
import { View, Image, ImageProps } from "react-native";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import tw from "../lib/tailwind";
|
|
4
|
+
import EText from "./EText";
|
|
5
|
+
|
|
6
|
+
interface AvatarProps {
|
|
7
|
+
size?: "xxs" | "xs" | "sm" | "lg" | "5xl";
|
|
8
|
+
source: string;
|
|
9
|
+
nameFirstLetter?: string;
|
|
10
|
+
textColor?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function Avatar({ size, source, nameFirstLetter, textColor }: AvatarProps) {
|
|
14
|
+
let colors = [
|
|
15
|
+
"#00BE9B",
|
|
16
|
+
"#0993BF",
|
|
17
|
+
"#64748B",
|
|
18
|
+
"#3F3D84",
|
|
19
|
+
"#0993BF",
|
|
20
|
+
"#525252",
|
|
21
|
+
"#EA580C",
|
|
22
|
+
"#2D3A5D",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
// let color = colors[Math.floor(Math.random() * colors.length)]
|
|
26
|
+
const [color, setColor] = React.useState(colors[Math.floor(Math.random() * colors.length)]);
|
|
27
|
+
return (
|
|
28
|
+
<View
|
|
29
|
+
style={tw.style(
|
|
30
|
+
"flex items-center justify-center w-16 h-16 rounded-full overflow-hidden",
|
|
31
|
+
size === "lg" && "w-16 h-16",
|
|
32
|
+
size === "sm" && "w-12 h-12",
|
|
33
|
+
size === "xs" && "w-10 h-10",
|
|
34
|
+
size === "xxs" && "w-7 h-7",
|
|
35
|
+
size === "5xl" && "w-20 h-20",
|
|
36
|
+
`bg-[${color}]`
|
|
37
|
+
)}
|
|
38
|
+
>
|
|
39
|
+
{source ? <Image style={tw`w-full h-full `} source={source} /> :
|
|
40
|
+
<EText style={tw`text-xl font-bold text-white uppercase`}>{nameFirstLetter}</EText>}
|
|
41
|
+
</View>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
import { View, ImageBackground, Dimensions, Animated } from "react-native";
|
|
2
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
3
|
-
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
4
|
-
import tw from "../lib/tailwind";
|
|
5
|
-
import EText from "./EText";
|
|
6
|
-
import { StatusBar } from "expo-status-bar";
|
|
7
|
-
import { Container, EButton, EButtonIcon, PageHeader } from ".";
|
|
8
|
-
import Constants from "expo-constants";
|
|
9
|
-
import { useNavigation } from "@react-navigation/native";
|
|
10
|
-
|
|
11
|
-
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
12
|
-
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
|
13
|
-
const HEADER_HEIGHT = Constants.statusBarHeight + 60;
|
|
14
|
-
const SCROLL_PADDING_BOTTOM = 100;
|
|
15
|
-
|
|
16
|
-
interface BaseLayoutProps {
|
|
17
|
-
title: string;
|
|
18
|
-
subtitle?: string;
|
|
19
|
-
curved?: boolean;
|
|
20
|
-
headerContent?: JSX.Element;
|
|
21
|
-
children?: JSX.Element;
|
|
22
|
-
iconEnd?: JSX.Element;
|
|
23
|
-
noScroll?: boolean;
|
|
24
|
-
bottomButton?: JSX.Element;
|
|
25
|
-
border?: boolean;
|
|
26
|
-
menuButton?: boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export default function BaseLayout({
|
|
30
|
-
title,
|
|
31
|
-
subtitle,
|
|
32
|
-
curved,
|
|
33
|
-
headerContent,
|
|
34
|
-
children,
|
|
35
|
-
noScroll,
|
|
36
|
-
iconEnd,
|
|
37
|
-
bottomButton,
|
|
38
|
-
border,
|
|
39
|
-
menuButton,
|
|
40
|
-
}: BaseLayoutProps) {
|
|
41
|
-
const insets = useSafeAreaInsets();
|
|
42
|
-
const [headerScrolled, setHeaderScrolled] = useState(false);
|
|
43
|
-
const scrollY = useRef(new Animated.Value(0)).current;
|
|
44
|
-
const opacity = useRef(new Animated.Value(0)).current;
|
|
45
|
-
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
Animated.spring(scrollY, {
|
|
48
|
-
toValue: headerScrolled ? 0 : -40,
|
|
49
|
-
speed: 2,
|
|
50
|
-
delay: 1,
|
|
51
|
-
bounciness: 1,
|
|
52
|
-
useNativeDriver: true,
|
|
53
|
-
}).start();
|
|
54
|
-
|
|
55
|
-
Animated.spring(opacity, {
|
|
56
|
-
toValue: headerScrolled ? 0.975 : 0,
|
|
57
|
-
speed: 2,
|
|
58
|
-
delay: 1,
|
|
59
|
-
bounciness: 1,
|
|
60
|
-
useNativeDriver: true,
|
|
61
|
-
}).start();
|
|
62
|
-
}, [headerScrolled]);
|
|
63
|
-
|
|
64
|
-
const navigation = useNavigation();
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<View
|
|
68
|
-
style={[
|
|
69
|
-
tw`flex-1 bg-white`,
|
|
70
|
-
{
|
|
71
|
-
paddingBottom: noScroll ? 0 : insets.bottom,
|
|
72
|
-
},
|
|
73
|
-
]}
|
|
74
|
-
>
|
|
75
|
-
<StatusBar
|
|
76
|
-
style={headerScrolled ? "light" : curved ? "light" : "dark"}
|
|
77
|
-
animated
|
|
78
|
-
/>
|
|
79
|
-
{/* COLLAPSED HEADER */}
|
|
80
|
-
<Animated.View
|
|
81
|
-
style={[
|
|
82
|
-
tw`absolute top-0 left-0 right-0 bg-white z-10 shadow-2xl`,
|
|
83
|
-
{
|
|
84
|
-
transform: [{ translateY: scrollY }],
|
|
85
|
-
opacity,
|
|
86
|
-
},
|
|
87
|
-
]}
|
|
88
|
-
>
|
|
89
|
-
<ImageBackground
|
|
90
|
-
style={[tw`flex-1`, {}]}
|
|
91
|
-
source={require("../assets/images/bg-header.jpg")}
|
|
92
|
-
>
|
|
93
|
-
<View
|
|
94
|
-
style={[
|
|
95
|
-
tw`flex-1 pl-3 pb-3 flex-row items-center`,
|
|
96
|
-
{ paddingTop: Constants.statusBarHeight + 4 },
|
|
97
|
-
]}
|
|
98
|
-
>
|
|
99
|
-
<EButtonIcon
|
|
100
|
-
iconColor={"white"}
|
|
101
|
-
size={20}
|
|
102
|
-
onPress={() => navigation.goBack()}
|
|
103
|
-
/>
|
|
104
|
-
<View style={tw`ml-2`}>
|
|
105
|
-
<EText size="base" style={tw`font-semibold text-white mb-0.5`}>
|
|
106
|
-
{title}
|
|
107
|
-
</EText>
|
|
108
|
-
{subtitle ? (
|
|
109
|
-
<EText
|
|
110
|
-
size="xs"
|
|
111
|
-
style={tw`font-semibold text-white opacity-40`}
|
|
112
|
-
>
|
|
113
|
-
{subtitle}
|
|
114
|
-
</EText>
|
|
115
|
-
) : null}
|
|
116
|
-
</View>
|
|
117
|
-
</View>
|
|
118
|
-
</ImageBackground>
|
|
119
|
-
</Animated.View>
|
|
120
|
-
|
|
121
|
-
{noScroll ? (
|
|
122
|
-
<View style={tw`flex-1`}>
|
|
123
|
-
<PageHeader
|
|
124
|
-
title={title}
|
|
125
|
-
subtitle={subtitle}
|
|
126
|
-
curved={curved}
|
|
127
|
-
iconEnd={iconEnd}
|
|
128
|
-
>
|
|
129
|
-
{headerContent}
|
|
130
|
-
</PageHeader>
|
|
131
|
-
{children}
|
|
132
|
-
</View>
|
|
133
|
-
) : (
|
|
134
|
-
<Animated.ScrollView
|
|
135
|
-
onScroll={(event) => {
|
|
136
|
-
const scrolling = event.nativeEvent.contentOffset.y;
|
|
137
|
-
scrolling > 60 ? setHeaderScrolled(true) : setHeaderScrolled(false);
|
|
138
|
-
}}
|
|
139
|
-
style={[
|
|
140
|
-
tw`flex-1`,
|
|
141
|
-
{ minHeight: SCREEN_HEIGHT, paddingBottom: SCROLL_PADDING_BOTTOM },
|
|
142
|
-
]}
|
|
143
|
-
scrollEventThrottle={16}
|
|
144
|
-
showsVerticalScrollIndicator={false}
|
|
145
|
-
decelerationRate={"fast"}
|
|
146
|
-
// fadingEdgeLength={1s00}
|
|
147
|
-
// alwaysBounceVertical={false}
|
|
148
|
-
contentContainerStyle={{
|
|
149
|
-
paddingBottom: SCROLL_PADDING_BOTTOM,
|
|
150
|
-
}}
|
|
151
|
-
>
|
|
152
|
-
<PageHeader
|
|
153
|
-
menuButton={menuButton}
|
|
154
|
-
title={title}
|
|
155
|
-
subtitle={subtitle}
|
|
156
|
-
curved={curved}
|
|
157
|
-
iconEnd={iconEnd}
|
|
158
|
-
border={border}
|
|
159
|
-
>
|
|
160
|
-
{headerContent}
|
|
161
|
-
</PageHeader>
|
|
162
|
-
{children}
|
|
163
|
-
</Animated.ScrollView>
|
|
164
|
-
)}
|
|
165
|
-
{bottomButton ? (
|
|
166
|
-
<Container style={tw`flex-1 justify-end mb-4 `}>
|
|
167
|
-
{bottomButton}
|
|
168
|
-
</Container>
|
|
169
|
-
) : (
|
|
170
|
-
<></>
|
|
171
|
-
)}
|
|
172
|
-
</View>
|
|
173
|
-
);
|
|
174
|
-
}
|
|
1
|
+
import { View, ImageBackground, Dimensions, Animated } from "react-native";
|
|
2
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
4
|
+
import tw from "../lib/tailwind";
|
|
5
|
+
import EText from "./EText";
|
|
6
|
+
import { StatusBar } from "expo-status-bar";
|
|
7
|
+
import { Container, EButton, EButtonIcon, PageHeader } from ".";
|
|
8
|
+
import Constants from "expo-constants";
|
|
9
|
+
import { useNavigation } from "@react-navigation/native";
|
|
10
|
+
|
|
11
|
+
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
12
|
+
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
|
13
|
+
const HEADER_HEIGHT = Constants.statusBarHeight + 60;
|
|
14
|
+
const SCROLL_PADDING_BOTTOM = 100;
|
|
15
|
+
|
|
16
|
+
interface BaseLayoutProps {
|
|
17
|
+
title: string;
|
|
18
|
+
subtitle?: string;
|
|
19
|
+
curved?: boolean;
|
|
20
|
+
headerContent?: JSX.Element;
|
|
21
|
+
children?: JSX.Element;
|
|
22
|
+
iconEnd?: JSX.Element;
|
|
23
|
+
noScroll?: boolean;
|
|
24
|
+
bottomButton?: JSX.Element;
|
|
25
|
+
border?: boolean;
|
|
26
|
+
menuButton?: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default function BaseLayout({
|
|
30
|
+
title,
|
|
31
|
+
subtitle,
|
|
32
|
+
curved,
|
|
33
|
+
headerContent,
|
|
34
|
+
children,
|
|
35
|
+
noScroll,
|
|
36
|
+
iconEnd,
|
|
37
|
+
bottomButton,
|
|
38
|
+
border,
|
|
39
|
+
menuButton,
|
|
40
|
+
}: BaseLayoutProps) {
|
|
41
|
+
const insets = useSafeAreaInsets();
|
|
42
|
+
const [headerScrolled, setHeaderScrolled] = useState(false);
|
|
43
|
+
const scrollY = useRef(new Animated.Value(0)).current;
|
|
44
|
+
const opacity = useRef(new Animated.Value(0)).current;
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
Animated.spring(scrollY, {
|
|
48
|
+
toValue: headerScrolled ? 0 : -40,
|
|
49
|
+
speed: 2,
|
|
50
|
+
delay: 1,
|
|
51
|
+
bounciness: 1,
|
|
52
|
+
useNativeDriver: true,
|
|
53
|
+
}).start();
|
|
54
|
+
|
|
55
|
+
Animated.spring(opacity, {
|
|
56
|
+
toValue: headerScrolled ? 0.975 : 0,
|
|
57
|
+
speed: 2,
|
|
58
|
+
delay: 1,
|
|
59
|
+
bounciness: 1,
|
|
60
|
+
useNativeDriver: true,
|
|
61
|
+
}).start();
|
|
62
|
+
}, [headerScrolled]);
|
|
63
|
+
|
|
64
|
+
const navigation = useNavigation();
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<View
|
|
68
|
+
style={[
|
|
69
|
+
tw`flex-1 bg-white`,
|
|
70
|
+
{
|
|
71
|
+
paddingBottom: noScroll ? 0 : insets.bottom,
|
|
72
|
+
},
|
|
73
|
+
]}
|
|
74
|
+
>
|
|
75
|
+
<StatusBar
|
|
76
|
+
style={headerScrolled ? "light" : curved ? "light" : "dark"}
|
|
77
|
+
animated
|
|
78
|
+
/>
|
|
79
|
+
{/* COLLAPSED HEADER */}
|
|
80
|
+
<Animated.View
|
|
81
|
+
style={[
|
|
82
|
+
tw`absolute top-0 left-0 right-0 bg-white z-10 shadow-2xl`,
|
|
83
|
+
{
|
|
84
|
+
transform: [{ translateY: scrollY }],
|
|
85
|
+
opacity,
|
|
86
|
+
},
|
|
87
|
+
]}
|
|
88
|
+
>
|
|
89
|
+
<ImageBackground
|
|
90
|
+
style={[tw`flex-1`, {}]}
|
|
91
|
+
source={require("../assets/images/bg-header.jpg")}
|
|
92
|
+
>
|
|
93
|
+
<View
|
|
94
|
+
style={[
|
|
95
|
+
tw`flex-1 pl-3 pb-3 flex-row items-center`,
|
|
96
|
+
{ paddingTop: Constants.statusBarHeight + 4 },
|
|
97
|
+
]}
|
|
98
|
+
>
|
|
99
|
+
<EButtonIcon
|
|
100
|
+
iconColor={"white"}
|
|
101
|
+
size={20}
|
|
102
|
+
onPress={() => navigation.goBack()}
|
|
103
|
+
/>
|
|
104
|
+
<View style={tw`ml-2`}>
|
|
105
|
+
<EText size="base" style={tw`font-semibold text-white mb-0.5`}>
|
|
106
|
+
{title}
|
|
107
|
+
</EText>
|
|
108
|
+
{subtitle ? (
|
|
109
|
+
<EText
|
|
110
|
+
size="xs"
|
|
111
|
+
style={tw`font-semibold text-white opacity-40`}
|
|
112
|
+
>
|
|
113
|
+
{subtitle}
|
|
114
|
+
</EText>
|
|
115
|
+
) : null}
|
|
116
|
+
</View>
|
|
117
|
+
</View>
|
|
118
|
+
</ImageBackground>
|
|
119
|
+
</Animated.View>
|
|
120
|
+
|
|
121
|
+
{noScroll ? (
|
|
122
|
+
<View style={tw`flex-1`}>
|
|
123
|
+
<PageHeader
|
|
124
|
+
title={title}
|
|
125
|
+
subtitle={subtitle}
|
|
126
|
+
curved={curved}
|
|
127
|
+
iconEnd={iconEnd}
|
|
128
|
+
>
|
|
129
|
+
{headerContent}
|
|
130
|
+
</PageHeader>
|
|
131
|
+
{children}
|
|
132
|
+
</View>
|
|
133
|
+
) : (
|
|
134
|
+
<Animated.ScrollView
|
|
135
|
+
onScroll={(event) => {
|
|
136
|
+
const scrolling = event.nativeEvent.contentOffset.y;
|
|
137
|
+
scrolling > 60 ? setHeaderScrolled(true) : setHeaderScrolled(false);
|
|
138
|
+
}}
|
|
139
|
+
style={[
|
|
140
|
+
tw`flex-1`,
|
|
141
|
+
{ minHeight: SCREEN_HEIGHT, paddingBottom: SCROLL_PADDING_BOTTOM },
|
|
142
|
+
]}
|
|
143
|
+
scrollEventThrottle={16}
|
|
144
|
+
showsVerticalScrollIndicator={false}
|
|
145
|
+
decelerationRate={"fast"}
|
|
146
|
+
// fadingEdgeLength={1s00}
|
|
147
|
+
// alwaysBounceVertical={false}
|
|
148
|
+
contentContainerStyle={{
|
|
149
|
+
paddingBottom: SCROLL_PADDING_BOTTOM,
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
<PageHeader
|
|
153
|
+
menuButton={menuButton}
|
|
154
|
+
title={title}
|
|
155
|
+
subtitle={subtitle}
|
|
156
|
+
curved={curved}
|
|
157
|
+
iconEnd={iconEnd}
|
|
158
|
+
border={border}
|
|
159
|
+
>
|
|
160
|
+
{headerContent}
|
|
161
|
+
</PageHeader>
|
|
162
|
+
{children}
|
|
163
|
+
</Animated.ScrollView>
|
|
164
|
+
)}
|
|
165
|
+
{bottomButton ? (
|
|
166
|
+
<Container style={tw`flex-1 justify-end mb-4 `}>
|
|
167
|
+
{bottomButton}
|
|
168
|
+
</Container>
|
|
169
|
+
) : (
|
|
170
|
+
<></>
|
|
171
|
+
)}
|
|
172
|
+
</View>
|
|
173
|
+
);
|
|
174
|
+
}
|