fln-espranza 1.0.0
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/Readme.md +1 -0
- package/components/Avatar.tsx +31 -0
- package/components/BaseLayout.tsx +174 -0
- package/components/Container.tsx +12 -0
- package/components/Drawer.tsx +93 -0
- package/components/EBadge.tsx +27 -0
- package/components/EButton.tsx +81 -0
- package/components/EButtonIcon.tsx +37 -0
- package/components/EDateAndTimeCard.tsx +43 -0
- package/components/EIcon.tsx +28 -0
- package/components/EInfoBox.tsx +41 -0
- package/components/EInput.tsx +55 -0
- package/components/ELabel.tsx +15 -0
- package/components/EOtpInputBox.tsx +49 -0
- package/components/EPageDescription.tsx +19 -0
- package/components/EPillButton.tsx +25 -0
- package/components/EProfile.tsx +43 -0
- package/components/ESegment.tsx +35 -0
- package/components/EText.tsx +41 -0
- package/components/ETimeLineCard.tsx +68 -0
- package/components/ListFormView.tsx +37 -0
- package/components/MenuItems.tsx +42 -0
- package/components/ModalLayout.tsx +81 -0
- package/components/PageHeader.tsx +139 -0
- package/components/PageHeaderSecondary.tsx +44 -0
- package/components/SecondaryBaseLayout.tsx +101 -0
- package/components/Spacer.tsx +13 -0
- package/components/Timer.tsx +57 -0
- package/components/index.tsx +61 -0
- package/lib/tailwind.js +8 -0
- package/package.json +23 -0
- package/utils/Color.ts +15 -0
|
@@ -0,0 +1,101 @@
|
|
|
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 {
|
|
11
|
+
useSafeAreaInsets,
|
|
12
|
+
} from "react-native-safe-area-context";
|
|
13
|
+
import tw from "../lib/tailwind";
|
|
14
|
+
import EText from "./EText";
|
|
15
|
+
import { StatusBar } from "expo-status-bar";
|
|
16
|
+
import { Container, EButton, EButtonIcon, PageHeader, PageHeaderSecondary } from ".";
|
|
17
|
+
import Constants from "expo-constants";
|
|
18
|
+
import { useNavigation } from "@react-navigation/native";
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
const SCREEN_WIDTH = Dimensions.get("window").width;
|
|
22
|
+
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
|
23
|
+
const HEADER_HEIGHT = Constants.statusBarHeight + 60;
|
|
24
|
+
const SCROLL_PADDING_BOTTOM = 100;
|
|
25
|
+
|
|
26
|
+
interface BaseLayoutProps {
|
|
27
|
+
title: string;
|
|
28
|
+
subtitle?: string;
|
|
29
|
+
curved?: boolean;
|
|
30
|
+
headerContent?: JSX.Element;
|
|
31
|
+
children?: JSX.Element;
|
|
32
|
+
iconEnd?: JSX.Element;
|
|
33
|
+
noScroll?: boolean;
|
|
34
|
+
bottomButton?: JSX.Element;
|
|
35
|
+
border?: boolean;
|
|
36
|
+
menuButton?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default function SecondaryBaseLayout({
|
|
40
|
+
title,
|
|
41
|
+
subtitle,
|
|
42
|
+
curved,
|
|
43
|
+
headerContent,
|
|
44
|
+
children,
|
|
45
|
+
noScroll, iconEnd,
|
|
46
|
+
bottomButton,
|
|
47
|
+
border,
|
|
48
|
+
menuButton
|
|
49
|
+
}: BaseLayoutProps) {
|
|
50
|
+
const insets = useSafeAreaInsets();
|
|
51
|
+
|
|
52
|
+
const navigation = useNavigation();
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<View style={[tw`flex-1 bg-white`, {}]}>
|
|
56
|
+
<StatusBar
|
|
57
|
+
style={Platform.OS === "android" ? "dark" : "light"}
|
|
58
|
+
animated
|
|
59
|
+
/>
|
|
60
|
+
|
|
61
|
+
{/* HEADER */}
|
|
62
|
+
<View
|
|
63
|
+
style={[
|
|
64
|
+
tw`absolute top-0 right-0 left-0 pr-3 pt-2 z-10 w-full bg-white ${title ? 'mb-1' : 'pb-0'}`,
|
|
65
|
+
// {height: 64},
|
|
66
|
+
]}
|
|
67
|
+
>
|
|
68
|
+
{/* <PageHeaderSecondary
|
|
69
|
+
title={title}
|
|
70
|
+
subtitle={subtitle}
|
|
71
|
+
button={
|
|
72
|
+
<EButtonIcon
|
|
73
|
+
type="close"
|
|
74
|
+
iconColor="slate-800"
|
|
75
|
+
onPress={() => navigation.goBack()}
|
|
76
|
+
/>
|
|
77
|
+
}
|
|
78
|
+
/> */}
|
|
79
|
+
<PageHeader border={border} title={title} subtitle={subtitle} curved={curved} iconEnd={iconEnd} menuButton={menuButton}>
|
|
80
|
+
{headerContent}
|
|
81
|
+
</PageHeader>
|
|
82
|
+
</View>
|
|
83
|
+
<ScrollView
|
|
84
|
+
style={[
|
|
85
|
+
tw`flex-1`,
|
|
86
|
+
{ paddingBottom: insets.bottom, paddingTop: !title ? 80 : 80 },
|
|
87
|
+
]}
|
|
88
|
+
showsVerticalScrollIndicator={false}
|
|
89
|
+
decelerationRate={"fast"}
|
|
90
|
+
contentContainerStyle={{
|
|
91
|
+
paddingBottom: SCROLL_PADDING_BOTTOM,
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
{children}
|
|
95
|
+
</ScrollView>
|
|
96
|
+
{bottomButton ? <View style={tw` px-4 mb-4 `}>
|
|
97
|
+
{bottomButton}
|
|
98
|
+
</View> : <></>}
|
|
99
|
+
</View>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { View, Text } from "react-native";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import tw from '../lib/tailwind'
|
|
4
|
+
|
|
5
|
+
export default function Spacer(props: any) {
|
|
6
|
+
const { sm, lg, xs } = props;
|
|
7
|
+
return <View style={tw.style(
|
|
8
|
+
"my-4",
|
|
9
|
+
xs && "my-1",
|
|
10
|
+
sm && "my-2",
|
|
11
|
+
lg && "my-6"
|
|
12
|
+
)} />;
|
|
13
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { TouchableOpacity } from "react-native";
|
|
4
|
+
import tw from "../lib/tailwind";
|
|
5
|
+
import { Colors } from "../utils/Color";
|
|
6
|
+
import EText from "./EText";
|
|
7
|
+
|
|
8
|
+
interface IProps {
|
|
9
|
+
time: number;
|
|
10
|
+
text: string;
|
|
11
|
+
subtext: string;
|
|
12
|
+
handleGetOTP: () => void;
|
|
13
|
+
sendOtp: boolean;
|
|
14
|
+
email: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default function Timer({ time, text, subtext, sendOtp, handleGetOTP,email }: IProps) {
|
|
18
|
+
|
|
19
|
+
const [timer, setTimer] = useState(time);
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
setTimer(30);
|
|
22
|
+
return () => {
|
|
23
|
+
setTimer(0);
|
|
24
|
+
}
|
|
25
|
+
}, [sendOtp]);
|
|
26
|
+
|
|
27
|
+
React.useEffect(() => {
|
|
28
|
+
timer > 0 &&
|
|
29
|
+
setTimeout(() => {
|
|
30
|
+
setTimer(timer - 1);
|
|
31
|
+
}, 1000);
|
|
32
|
+
|
|
33
|
+
return () => {
|
|
34
|
+
clearTimeout();
|
|
35
|
+
}
|
|
36
|
+
}, [timer]);
|
|
37
|
+
|
|
38
|
+
return(
|
|
39
|
+
|
|
40
|
+
<>
|
|
41
|
+
{timer > 0 ? <TouchableOpacity style={[tw`mt-2`, {}]}>
|
|
42
|
+
<EText size="sm" style={[tw`font-bold text-[${Colors["text-primary"]}]`, {}]}>
|
|
43
|
+
{timer > 0 && `${text}${timer >= 10 ? timer : "0" + timer}`}
|
|
44
|
+
</EText>
|
|
45
|
+
</TouchableOpacity> :
|
|
46
|
+
<TouchableOpacity style={[tw`mt-2`, {}]}
|
|
47
|
+
onPress={() => handleGetOTP()}
|
|
48
|
+
>
|
|
49
|
+
<EText size="sm" style={[tw`font-bold text-[${Colors["text-primary"]}]`, {}]}>
|
|
50
|
+
{subtext}
|
|
51
|
+
</EText>
|
|
52
|
+
</TouchableOpacity>
|
|
53
|
+
}
|
|
54
|
+
</>
|
|
55
|
+
|
|
56
|
+
)
|
|
57
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import Avatar from "./Avatar";
|
|
2
|
+
import BaseLayout from "./BaseLayout";
|
|
3
|
+
import Container from "./Container";
|
|
4
|
+
import Drawer from "./Drawer";
|
|
5
|
+
import EBadge from "./EBadge";
|
|
6
|
+
import EButton from "./EButton";
|
|
7
|
+
import EButtonIcon from "./EButtonIcon";
|
|
8
|
+
import EDateAndTimeCard from "./EDateAndTimeCard";
|
|
9
|
+
import EIcon from "./EIcon";
|
|
10
|
+
import EInfoBox from "./EInfoBox";
|
|
11
|
+
import EInput from "./EInput";
|
|
12
|
+
import ELabel from "./ELabel";
|
|
13
|
+
import EOtpInput from "./EOtpInputBox";
|
|
14
|
+
import EPageDescription from "./EPageDescription";
|
|
15
|
+
import EPillButton from "./EPillButton";
|
|
16
|
+
import EProfile from "./EProfile";
|
|
17
|
+
import ESegment from "./ESegment";
|
|
18
|
+
import { ESegmentItem } from "./ESegment";
|
|
19
|
+
import ETimeLineCard from "./ETimeLineCard";
|
|
20
|
+
import ListFormView from "./ListFormView";
|
|
21
|
+
import MenuItems from "./MenuItems";
|
|
22
|
+
import SecondaryBaseLayout from "./SecondaryBaseLayout";
|
|
23
|
+
import Timer from "./Timer";
|
|
24
|
+
import EText from "./EText";
|
|
25
|
+
import ModalLayout from "./ModalLayout";
|
|
26
|
+
import PageHeader from "./PageHeader";
|
|
27
|
+
import PageHeaderSecondary from "./PageHeaderSecondary";
|
|
28
|
+
import Spacer from "./Spacer";
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
Avatar,
|
|
32
|
+
BaseLayout,
|
|
33
|
+
Container,
|
|
34
|
+
Drawer,
|
|
35
|
+
EButton,
|
|
36
|
+
EButtonIcon,
|
|
37
|
+
EIcon,
|
|
38
|
+
EInput,
|
|
39
|
+
EText,
|
|
40
|
+
ModalLayout,
|
|
41
|
+
PageHeader,
|
|
42
|
+
PageHeaderSecondary,
|
|
43
|
+
ESegment,
|
|
44
|
+
ESegmentItem,
|
|
45
|
+
Spacer,
|
|
46
|
+
EInfoBox,
|
|
47
|
+
EBadge,
|
|
48
|
+
EDateAndTimeCard,
|
|
49
|
+
ELabel,
|
|
50
|
+
EOtpInput,
|
|
51
|
+
EPageDescription,
|
|
52
|
+
ETimeLineCard,
|
|
53
|
+
ListFormView,
|
|
54
|
+
MenuItems,
|
|
55
|
+
EPillButton,
|
|
56
|
+
EProfile,
|
|
57
|
+
SecondaryBaseLayout,
|
|
58
|
+
Timer
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
};
|
package/lib/tailwind.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fln-espranza",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "All components used inside FLN Project of Espranza Innovations",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"author": "",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"peerDependencies": {
|
|
12
|
+
"expo": "~45.0.0",
|
|
13
|
+
"expo-status-bar": "~1.3.0",
|
|
14
|
+
"react": "17.0.2",
|
|
15
|
+
"react-native": "0.68.2",
|
|
16
|
+
"react-native-safe-area-context": "4.2.4",
|
|
17
|
+
"twrnc": "^3.3.2",
|
|
18
|
+
"@react-navigation/drawer": "^6.5.0",
|
|
19
|
+
"@react-navigation/native": "^6.0.10",
|
|
20
|
+
"@react-navigation/native-stack": "^6.6.2",
|
|
21
|
+
"react-native-heroicons": "^2.2.0"
|
|
22
|
+
}
|
|
23
|
+
}
|
package/utils/Color.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const Colors = {
|
|
2
|
+
"primary-base": '#218C74',
|
|
3
|
+
"primary-light": '#F4F9F8',
|
|
4
|
+
"secondary-base": '#3F3D84',
|
|
5
|
+
"secondary-light": '#F5F5F9',
|
|
6
|
+
"blue": '#0993BF',
|
|
7
|
+
"border": '#E0E6EC',
|
|
8
|
+
"warning": '#FFCB66',
|
|
9
|
+
"success": '#00BE9B',
|
|
10
|
+
"text-primary": '#2D3A5D',
|
|
11
|
+
"text-body": '#64748B',
|
|
12
|
+
"text-placeholder": '#CBD5E1',
|
|
13
|
+
"text-secondary": "#585F68",
|
|
14
|
+
"white": '#FFFFFF',
|
|
15
|
+
};
|