fln-espranza 0.0.14 → 0.0.16
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/components/Drawer.tsx +47 -35
- package/components/EDateAndTimeCard.tsx +11 -11
- package/components/EProfile.tsx +40 -20
- package/components/ETimeLineCard.tsx +10 -10
- package/components/MenuItems.tsx +1 -1
- package/components/PageHeader.tsx +29 -43
- package/components/SecondaryBaseLayout.tsx +13 -31
- package/package.json +1 -1
package/components/Drawer.tsx
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ScrollView, View, TouchableOpacity } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import {
|
|
4
|
+
HomeIcon,
|
|
5
|
+
CalendarIcon,
|
|
6
|
+
TemplateIcon,
|
|
7
|
+
ViewBoardsIcon,
|
|
8
|
+
} from "react-native-heroicons/solid";
|
|
9
|
+
import { StyleSheet } from "react-native";
|
|
5
10
|
import tw from "../lib/tailwind";
|
|
6
11
|
import EText from "./EText";
|
|
7
12
|
import Spacer from "./Spacer";
|
|
@@ -11,14 +16,14 @@ import MenuItems from "./MenuItems";
|
|
|
11
16
|
import EIconLogout from "./icons/EIconLogout";
|
|
12
17
|
|
|
13
18
|
type menuItems = {
|
|
14
|
-
title: string
|
|
15
|
-
icon: any
|
|
16
|
-
screen: string
|
|
17
|
-
}
|
|
19
|
+
title: string;
|
|
20
|
+
icon: any;
|
|
21
|
+
screen: string;
|
|
22
|
+
};
|
|
18
23
|
|
|
19
24
|
interface IProps {
|
|
20
|
-
name: string
|
|
21
|
-
profile: string
|
|
25
|
+
name: string;
|
|
26
|
+
profile: string;
|
|
22
27
|
menuItems: menuItems[];
|
|
23
28
|
navigation: any;
|
|
24
29
|
logout?: () => void;
|
|
@@ -30,9 +35,10 @@ const Drawer = ({ name, profile, menuItems, navigation, logout }: IProps) => {
|
|
|
30
35
|
scrollEnabled={true}
|
|
31
36
|
showsVerticalScrollIndicator={false}
|
|
32
37
|
style={{
|
|
33
|
-
position:
|
|
34
|
-
backgroundColor:
|
|
35
|
-
}}
|
|
38
|
+
position: "relative",
|
|
39
|
+
backgroundColor: "#ffffff",
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
36
42
|
<View style={tw`mx-4 pt-4`}>
|
|
37
43
|
<Spacer height={30} />
|
|
38
44
|
|
|
@@ -44,10 +50,18 @@ const Drawer = ({ name, profile, menuItems, navigation, logout }: IProps) => {
|
|
|
44
50
|
nameFirstLetter={name?.split("")[0]}
|
|
45
51
|
/>
|
|
46
52
|
<View style={tw`ml-3`}>
|
|
47
|
-
<EText size={"xl"} style={tw`font-bold -mt-1`}>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
<EText size={"xl"} style={tw`font-bold -mt-1`}>
|
|
54
|
+
{name}
|
|
55
|
+
</EText>
|
|
56
|
+
<EText
|
|
57
|
+
size="sm"
|
|
58
|
+
style={[
|
|
59
|
+
tw`font-normal`,
|
|
60
|
+
{
|
|
61
|
+
color: Colors["text-body"],
|
|
62
|
+
},
|
|
63
|
+
]}
|
|
64
|
+
>
|
|
51
65
|
{profile}
|
|
52
66
|
</EText>
|
|
53
67
|
</View>
|
|
@@ -55,32 +69,30 @@ const Drawer = ({ name, profile, menuItems, navigation, logout }: IProps) => {
|
|
|
55
69
|
</View>
|
|
56
70
|
|
|
57
71
|
<Spacer height={30} />
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
})
|
|
69
|
-
}
|
|
72
|
+
{menuItems.map((item, index) => {
|
|
73
|
+
return (
|
|
74
|
+
<MenuItems
|
|
75
|
+
key={index}
|
|
76
|
+
title={item.title}
|
|
77
|
+
icon={item.icon}
|
|
78
|
+
onPress={() => navigation.navigate(item.screen)}
|
|
79
|
+
/>
|
|
80
|
+
);
|
|
81
|
+
})}
|
|
70
82
|
|
|
71
83
|
<MenuItems
|
|
72
84
|
title={"Logout"}
|
|
73
|
-
icon={
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
85
|
+
icon={
|
|
86
|
+
<EIconLogout
|
|
87
|
+
size={24}
|
|
88
|
+
style={tw`text-[${Colors["primary-base"]}]`}
|
|
89
|
+
/>
|
|
90
|
+
}
|
|
91
|
+
onPress={() => logout && logout()}
|
|
78
92
|
/>
|
|
79
|
-
|
|
80
|
-
|
|
81
93
|
</View>
|
|
82
94
|
</ScrollView>
|
|
83
95
|
);
|
|
84
96
|
};
|
|
85
97
|
|
|
86
|
-
export default Drawer;
|
|
98
|
+
export default Drawer;
|
|
@@ -5,15 +5,15 @@ import { Colors } from "../utils/Color";
|
|
|
5
5
|
import EText from "./EText";
|
|
6
6
|
import EIconClock from "./icons/EIconClock";
|
|
7
7
|
|
|
8
|
-
interface IProps{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
interface IProps {
|
|
9
|
+
date: string;
|
|
10
|
+
month: string;
|
|
11
|
+
day: string;
|
|
12
|
+
time?: string;
|
|
13
13
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export default function EDateAndTimeCard(
|
|
16
|
+
export default function EDateAndTimeCard({ date, month, day, time }: IProps) {
|
|
17
17
|
return (
|
|
18
18
|
<View
|
|
19
19
|
style={[tw`flex-row pb-4 border-b`, { borderBottomColor: Colors.border }]}
|
|
@@ -31,20 +31,20 @@ export default function EDateAndTimeCard( {date, month, day, time}: IProps) {
|
|
|
31
31
|
{month}
|
|
32
32
|
</EText>
|
|
33
33
|
</View>
|
|
34
|
-
<View style={tw`ml-3`}>
|
|
34
|
+
<View style={tw`ml-3 justify-center`}>
|
|
35
35
|
<EText size="base" style={tw`font-bold text-black opacity-80 -mb-1`}>
|
|
36
36
|
{day}
|
|
37
37
|
</EText>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<EIconClock size={16} style={tw`text-slate-500`}/>
|
|
38
|
+
{
|
|
39
|
+
time ?<View style={tw`flex-row justify-center items-center mt-2`}>
|
|
40
|
+
<EIconClock size={16} style={tw`text-slate-500`} />
|
|
41
41
|
<EText
|
|
42
42
|
size="sm"
|
|
43
43
|
style={tw`ml-1 text-slate-500`}
|
|
44
44
|
>
|
|
45
45
|
{time}
|
|
46
46
|
</EText>
|
|
47
|
-
</View>
|
|
47
|
+
</View> : null}
|
|
48
48
|
</View>
|
|
49
49
|
</View>
|
|
50
50
|
);
|
package/components/EProfile.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { View } from
|
|
3
|
-
import tw from
|
|
4
|
-
import { Colors } from
|
|
5
|
-
import Avatar from
|
|
6
|
-
import EText from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
import tw from "../lib/tailwind";
|
|
4
|
+
import { Colors } from "../utils/Color";
|
|
5
|
+
import Avatar from "./Avatar";
|
|
6
|
+
import EText from "./EText";
|
|
7
7
|
|
|
8
8
|
interface IProps {
|
|
9
9
|
name: string;
|
|
@@ -12,12 +12,25 @@ interface IProps {
|
|
|
12
12
|
children?: JSX.Element;
|
|
13
13
|
titleSize: string;
|
|
14
14
|
subTitleSize: string;
|
|
15
|
-
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
export default function EProfile({
|
|
17
|
+
export default function EProfile({
|
|
18
|
+
name,
|
|
19
|
+
subjectName,
|
|
20
|
+
border,
|
|
21
|
+
children,
|
|
22
|
+
titleSize,
|
|
23
|
+
subTitleSize,
|
|
24
|
+
}: IProps) {
|
|
19
25
|
return (
|
|
20
|
-
<View
|
|
26
|
+
<View
|
|
27
|
+
style={[
|
|
28
|
+
tw`flex-row items-center justify-between py-3 ${
|
|
29
|
+
border ? "border-b" : ""
|
|
30
|
+
}`,
|
|
31
|
+
{ borderBottomColor: Colors.border },
|
|
32
|
+
]}
|
|
33
|
+
>
|
|
21
34
|
<View style={tw`flex-row items-center`}>
|
|
22
35
|
<Avatar
|
|
23
36
|
size="sm"
|
|
@@ -25,18 +38,25 @@ export default function EProfile({ name, subjectName, border, children, titleSiz
|
|
|
25
38
|
nameFirstLetter={name.split(" ")[0].charAt(0)}
|
|
26
39
|
/>
|
|
27
40
|
<View style={tw`ml-3`}>
|
|
28
|
-
<EText
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
41
|
+
<EText
|
|
42
|
+
style={[
|
|
43
|
+
tw`font-bold text-slate-800 mb-0.5 capitalize ${titleSize}`,
|
|
44
|
+
{ color: Colors["text-primary"] },
|
|
45
|
+
]}
|
|
46
|
+
>
|
|
47
|
+
{name}
|
|
48
|
+
</EText>
|
|
49
|
+
{subjectName ? (
|
|
50
|
+
<EText
|
|
51
|
+
size="sm"
|
|
52
|
+
style={[tw` ${subTitleSize}`, { color: Colors["text-body"] }]}
|
|
53
|
+
>
|
|
54
|
+
{subjectName}
|
|
55
|
+
</EText>
|
|
56
|
+
) : null}
|
|
32
57
|
</View>
|
|
33
58
|
</View>
|
|
34
|
-
{
|
|
35
|
-
children ? <>
|
|
36
|
-
{children}
|
|
37
|
-
</> : null
|
|
38
|
-
}
|
|
39
|
-
|
|
59
|
+
{children ? <>{children}</> : null}
|
|
40
60
|
</View>
|
|
41
|
-
)
|
|
61
|
+
);
|
|
42
62
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EIconAdd } from 'fln-espranza';
|
|
1
2
|
import React from 'react'
|
|
2
3
|
import { Dimensions, TouchableOpacity, View } from 'react-native'
|
|
3
4
|
import { ChevronRightIcon } from 'react-native-heroicons/solid';
|
|
@@ -12,11 +13,11 @@ interface IProps {
|
|
|
12
13
|
title: string;
|
|
13
14
|
description: string;
|
|
14
15
|
completed: boolean;
|
|
15
|
-
|
|
16
|
+
anotherButton?: boolean;
|
|
16
17
|
onPress?: () => void;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
export default function ETimeLineCard({ title, description, completed,
|
|
20
|
+
export default function ETimeLineCard({ title, description, completed, anotherButton, onPress }: IProps) {
|
|
20
21
|
return (
|
|
21
22
|
<TouchableOpacity
|
|
22
23
|
onPress={() => onPress && onPress()}
|
|
@@ -48,19 +49,18 @@ export default function ETimeLineCard({ title, description, completed, skipButto
|
|
|
48
49
|
completed={completed}
|
|
49
50
|
text={completed ? "Complete" : "Pending"}
|
|
50
51
|
color={completed ? Colors['primary-base'] : Colors.warning}
|
|
51
|
-
textColor={completed ? "text-white" : ""}
|
|
52
|
-
size="xs"
|
|
53
|
-
padding='py-1 px-3'
|
|
54
|
-
fontWeight='font-bold'
|
|
55
52
|
/>
|
|
56
53
|
|
|
57
54
|
{
|
|
58
|
-
|
|
59
|
-
<TouchableOpacity>
|
|
55
|
+
anotherButton ? (
|
|
56
|
+
<TouchableOpacity style={tw`flex-row`}>
|
|
60
57
|
<EText size="sm" style={[tw`ml-2 font-semibold`, {color: Colors['primary-base']}]}>
|
|
61
|
-
|
|
58
|
+
Another Assessment
|
|
62
59
|
</EText>
|
|
63
|
-
|
|
60
|
+
<EIconAdd size={20} style={[tw`ml-2`, {color: Colors['primary-base']}]}/>
|
|
61
|
+
</TouchableOpacity>
|
|
62
|
+
|
|
63
|
+
) : <></>
|
|
64
64
|
}
|
|
65
65
|
</View>
|
|
66
66
|
</TouchableOpacity>
|
package/components/MenuItems.tsx
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { View, Animated, Dimensions,
|
|
1
|
+
import { View, Animated, Dimensions, TouchableOpacity } from "react-native";
|
|
2
2
|
import React, { useEffect, useRef } from "react";
|
|
3
3
|
import tw from "../lib/tailwind";
|
|
4
4
|
import { useNavigation } from "@react-navigation/native";
|
|
5
|
-
import EButtonIcon from "./EButtonIcon";
|
|
6
5
|
import EText from "./EText";
|
|
7
6
|
import Constants from "expo-constants";
|
|
8
|
-
import {
|
|
7
|
+
import { EIconArrowLeft, EIconMenu } from "fln-espranza";
|
|
9
8
|
|
|
10
9
|
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
11
10
|
const HEADER_HEIGHT = 90;
|
|
@@ -48,82 +47,69 @@ export default function PageHeader({
|
|
|
48
47
|
}).start();
|
|
49
48
|
});
|
|
50
49
|
return (
|
|
51
|
-
<View style={[tw`${
|
|
50
|
+
<View style={[tw`${"border-none border-slate-300 bg-white shadow-lg py-3"} `, {}]}>
|
|
52
51
|
<View style={tw`overflow-hidden`}>
|
|
53
|
-
<
|
|
52
|
+
<View
|
|
54
53
|
style={[
|
|
55
|
-
tw`flex-row
|
|
54
|
+
tw`flex-row items-center px-3`,
|
|
56
55
|
{
|
|
57
56
|
paddingTop: Constants.statusBarHeight + 8,
|
|
58
|
-
transform: [{ translateX }],
|
|
59
|
-
opacity,
|
|
60
57
|
},
|
|
61
58
|
]}
|
|
62
59
|
>
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
{/* LEFT ICON */}
|
|
61
|
+
<View
|
|
62
|
+
style={[tw`` ]}
|
|
65
63
|
>
|
|
66
64
|
{menuButton ?
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
<TouchableOpacity activeOpacity={0.6}
|
|
66
|
+
onPress={() => navigation?.openDrawer()}>
|
|
67
|
+
<EIconMenu
|
|
69
68
|
size={24}
|
|
70
|
-
|
|
71
|
-
style={tw`text-slate-900 mt-2`}
|
|
69
|
+
style={tw`text-slate-800`}
|
|
72
70
|
/>
|
|
71
|
+
</TouchableOpacity>
|
|
72
|
+
|
|
73
73
|
:
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
<TouchableOpacity activeOpacity={0.6}
|
|
75
|
+
onPress={() => navigation.goBack()}>
|
|
76
|
+
<EIconArrowLeft
|
|
76
77
|
iconColor={curved ? "white" : "tint-slate-900"}
|
|
77
78
|
size={24}
|
|
78
79
|
// onPress={() => navigation.navigate("Dashboard")}
|
|
79
|
-
|
|
80
|
+
style={tw`text-slate-800`}
|
|
80
81
|
/>
|
|
82
|
+
</TouchableOpacity>
|
|
81
83
|
}
|
|
82
|
-
</
|
|
83
|
-
|
|
84
|
+
</View>
|
|
85
|
+
{/* TITLE */}
|
|
86
|
+
<View style={tw`flex-1 items-start px-3`}>
|
|
84
87
|
<EText
|
|
85
|
-
size="
|
|
86
|
-
style={tw.style("text-
|
|
88
|
+
size="lg"
|
|
89
|
+
style={tw.style("text-slate-800 font-bold")}
|
|
87
90
|
>
|
|
88
91
|
{title}
|
|
89
92
|
</EText>
|
|
90
93
|
{subtitle ? (
|
|
91
94
|
<EText
|
|
92
95
|
style={tw.style(
|
|
93
|
-
"text-slate-800 opacity-40 font-semibold mt-0.25"
|
|
94
|
-
curved && "text-white "
|
|
96
|
+
"text-slate-800 opacity-40 font-semibold mt-0.25"
|
|
95
97
|
)}
|
|
96
98
|
>
|
|
97
99
|
{subtitle}
|
|
98
100
|
</EText>
|
|
99
101
|
) : null}
|
|
100
102
|
</View>
|
|
101
|
-
|
|
103
|
+
|
|
104
|
+
{/* RIGHT ICON */}
|
|
102
105
|
{iconEnd ? (
|
|
103
|
-
<View style={[tw
|
|
106
|
+
<View style={[tw``, {}]}>
|
|
104
107
|
{iconEnd}
|
|
105
108
|
</View>
|
|
106
109
|
) : null}
|
|
107
|
-
</
|
|
110
|
+
</View>
|
|
108
111
|
{children ? <View style={tw.style("pb-6")}>{children}</View> : null}
|
|
109
112
|
</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
113
|
</View>
|
|
128
114
|
);
|
|
129
115
|
}
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
ImageBackground,
|
|
4
|
-
Dimensions,
|
|
5
|
-
Animated,
|
|
6
|
-
ScrollView,
|
|
7
|
-
Platform,
|
|
8
|
-
} from "react-native";
|
|
9
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
1
|
+
import { View, Dimensions, ScrollView, Platform } from "react-native";
|
|
2
|
+
import React from "react";
|
|
10
3
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
11
4
|
import tw from "../lib/tailwind";
|
|
12
|
-
import EText from "./EText";
|
|
13
5
|
import { StatusBar } from "expo-status-bar";
|
|
14
|
-
import {
|
|
15
|
-
Container,
|
|
16
|
-
EButton,
|
|
17
|
-
EButtonIcon,
|
|
18
|
-
PageHeader,
|
|
19
|
-
PageHeaderSecondary,
|
|
20
|
-
} from ".";
|
|
6
|
+
import { PageHeader } from ".";
|
|
21
7
|
import Constants from "expo-constants";
|
|
22
8
|
import { useNavigation } from "@react-navigation/native";
|
|
23
9
|
|
|
@@ -61,7 +47,7 @@ export default function SecondaryBaseLayout({
|
|
|
61
47
|
tw`flex-1 bg-white`,
|
|
62
48
|
{
|
|
63
49
|
paddingBottom: Platform.OS === "ios" ? insets.bottom : 0,
|
|
64
|
-
paddingTop: Platform.OS === "ios" ?
|
|
50
|
+
paddingTop: Platform.OS === "ios" ? 44 : 24,
|
|
65
51
|
},
|
|
66
52
|
]}
|
|
67
53
|
>
|
|
@@ -70,22 +56,11 @@ export default function SecondaryBaseLayout({
|
|
|
70
56
|
{/* HEADER */}
|
|
71
57
|
<View
|
|
72
58
|
style={[
|
|
73
|
-
tw`absolute top-0 right-0 left-0 pt-
|
|
59
|
+
tw`absolute top-0 right-0 left-0 pt-0 z-10 w-full bg-white ${
|
|
74
60
|
title ? "mb-1" : "pb-0"
|
|
75
61
|
}`,
|
|
76
62
|
]}
|
|
77
63
|
>
|
|
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
64
|
<PageHeader
|
|
90
65
|
border={border}
|
|
91
66
|
title={title}
|
|
@@ -111,7 +86,14 @@ export default function SecondaryBaseLayout({
|
|
|
111
86
|
{children}
|
|
112
87
|
</ScrollView>
|
|
113
88
|
{bottomButton ? (
|
|
114
|
-
<View
|
|
89
|
+
<View
|
|
90
|
+
style={[
|
|
91
|
+
tw` px-4 `,
|
|
92
|
+
{ paddingBottom: Platform.OS === "android" ? 8 : 0 },
|
|
93
|
+
]}
|
|
94
|
+
>
|
|
95
|
+
{bottomButton}
|
|
96
|
+
</View>
|
|
115
97
|
) : (
|
|
116
98
|
<></>
|
|
117
99
|
)}
|