fln-espranza 0.0.21 → 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/assets/images/bg-profile.jpg +0 -0
- package/assets/images/empty.png +0 -0
- package/components/EEmptyPlaceholder.tsx +1 -1
- package/components/EInfoBox.tsx +2 -2
- package/components/PageHeader.tsx +2 -1
- package/components/ProfileHeader.tsx +85 -0
- package/components/ProfileScreenLayout.tsx +110 -0
- package/package.json +1 -1
|
Binary file
|
package/assets/images/empty.png
CHANGED
|
Binary file
|
|
@@ -13,7 +13,7 @@ export default function EEmptyPlaceholder( { text }: IProps) {
|
|
|
13
13
|
return (
|
|
14
14
|
<View style={tw`flex justify-center items-center`}>
|
|
15
15
|
<ImageBackground source={require("../assets/images/empty.png")} style={{width: 200, height: 200}} />
|
|
16
|
-
<EText
|
|
16
|
+
<EText style={tw`text-center text-gray-800 mt-5`}>
|
|
17
17
|
{text}
|
|
18
18
|
</EText>
|
|
19
19
|
</View>
|
package/components/EInfoBox.tsx
CHANGED
|
@@ -22,7 +22,7 @@ export default function InfoBox({
|
|
|
22
22
|
childTextColor,
|
|
23
23
|
}: InfoBoxProps) {
|
|
24
24
|
return (
|
|
25
|
-
<View style={[tw.style("rounded-lg"), style]}>
|
|
25
|
+
<View style={[tw.style("rounded-lg bg-orange-500/10 p-3"), style]}>
|
|
26
26
|
<View style={tw`flex-row`}>
|
|
27
27
|
<View style={tw`w-5 h-5 mr-1`}>{icon}</View>
|
|
28
28
|
<View style={tw`flex-1`}>
|
|
@@ -31,7 +31,7 @@ export default function InfoBox({
|
|
|
31
31
|
{title}
|
|
32
32
|
</EText>
|
|
33
33
|
) : null}
|
|
34
|
-
<EText size="xs" style={[tw`
|
|
34
|
+
<EText size="xs" style={[tw`opacity-60`, {color: childTextColor}]}>
|
|
35
35
|
{children}
|
|
36
36
|
</EText>
|
|
37
37
|
</View>
|
|
@@ -4,7 +4,8 @@ import tw from "../lib/tailwind";
|
|
|
4
4
|
import { useNavigation } from "@react-navigation/native";
|
|
5
5
|
import EText from "./EText";
|
|
6
6
|
import Constants from "expo-constants";
|
|
7
|
-
import
|
|
7
|
+
import EIconArrowLeft from "./icons/EIconArrowLeft";
|
|
8
|
+
import EIconMenu from "./icons/EIconMenu";
|
|
8
9
|
|
|
9
10
|
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
10
11
|
const HEADER_HEIGHT = 90;
|
|
@@ -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
|
+
}
|