fln-espranza 1.1.14 → 1.1.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.
@@ -1,41 +1,41 @@
1
- import React from 'react'
2
- import { TouchableOpacity, View } from 'react-native'
3
- import { HomeIcon } from 'react-native-heroicons/solid'
4
- import tw from '../lib/tailwind'
5
- import { Colors } from '../utils/Color'
6
- import EText from './EText'
7
-
8
- interface IProps {
9
- title?: string
10
- icon?: JSX.Element
11
- onPress?: () => void
12
- }
13
-
14
- export default function MenuItems( { title, icon, onPress }: IProps ) {
15
- return (
16
- <TouchableOpacity style={tw`flex-row items-center` } onPress={onPress}>
17
- {/* <HomeIcon style={[tw`w-6 h-6`, { color: Colors["primary-base"] }]} /> */}
18
- {
19
- icon ?
20
- icon
21
- :
22
- <HomeIcon style={[tw`w-6 h-6`, { color: Colors["primary-base"] }]} />
23
- }
24
- <View style={[tw`py-4 ml-4 mr-8 w-[80%]`, {
25
- borderBottomWidth: 1,
26
- borderBottomColor: Colors.border,
27
- }]}>
28
- <EText size="sm" style={[tw`font-medium `, {
29
- color: Colors["text-primary"]
30
- }]}>
31
- {
32
- title ?
33
- title
34
- :
35
- "Dashboard"
36
- }
37
- </EText>
38
- </View>
39
- </TouchableOpacity>
40
- )
41
- }
1
+ import React from 'react'
2
+ import { TouchableOpacity, View } from 'react-native'
3
+ import { HomeIcon } from 'react-native-heroicons/solid'
4
+ import tw from '../lib/tailwind'
5
+ import { Colors } from '../utils/Color'
6
+ import EText from './EText'
7
+
8
+ interface IProps {
9
+ title?: string
10
+ icon?: JSX.Element
11
+ onPress?: () => void
12
+ }
13
+
14
+ export default function MenuItems( { title, icon, onPress }: IProps ) {
15
+ return (
16
+ <TouchableOpacity style={tw`flex-row items-center` } onPress={onPress}>
17
+ {/* <HomeIcon style={[tw`w-6 h-6`, { color: Colors["primary-base"] }]} /> */}
18
+ {
19
+ icon ?
20
+ icon
21
+ :
22
+ <HomeIcon style={[tw`w-6 h-6`, { color: Colors["primary-base"] }]} />
23
+ }
24
+ <View style={[tw`py-4 ml-4 mr-8 w-[80%]`, {
25
+ borderBottomWidth: 1,
26
+ borderBottomColor: Colors.border,
27
+ }]}>
28
+ <EText size="sm" style={[tw`font-medium `, {
29
+ color: Colors["text-primary"]
30
+ }]}>
31
+ {
32
+ title ?
33
+ title
34
+ :
35
+ "Dashboard"
36
+ }
37
+ </EText>
38
+ </View>
39
+ </TouchableOpacity>
40
+ )
41
+ }
@@ -1,33 +1,33 @@
1
- import React, { useEffect, useRef, useState } from 'react'
2
- import { Animated,StyleSheet, View } from 'react-native';
3
- import tw from "../lib/tailwind";
4
- import { Colors } from "../utils/Color";
5
-
6
- interface IProps{
7
- progress: number;
8
- }
9
-
10
- export default function ProgressBar( {progress}: IProps) {
11
-
12
-
13
- const barWidth = useRef(new Animated.Value(0)).current;
14
-
15
- useEffect(() => {
16
- Animated.spring(barWidth, {
17
- toValue: progress,
18
- bounciness: 0,
19
- speed: 7,
20
- useNativeDriver: false,
21
- }).start();
22
- }, [progress]);
23
- return (
24
- <View style={[tw`h-2 w-14 bg-[${Colors['primary-light']}] overflow-hidden mr-2`, {
25
- borderRadius: 40,
26
- }]}>
27
- <Animated.View
28
- style={[StyleSheet.absoluteFill, { backgroundColor: Colors['primary-base'], width: barWidth }]}
29
-
30
- />
31
- </View>
32
- )
33
- }
1
+ import React, { useEffect, useRef, useState } from 'react'
2
+ import { Animated,StyleSheet, View } from 'react-native';
3
+ import tw from "../lib/tailwind";
4
+ import { Colors } from "../utils/Color";
5
+
6
+ interface IProps{
7
+ progress: number;
8
+ }
9
+
10
+ export default function ProgressBar( {progress}: IProps) {
11
+
12
+
13
+ const barWidth = useRef(new Animated.Value(0)).current;
14
+
15
+ useEffect(() => {
16
+ Animated.spring(barWidth, {
17
+ toValue: progress,
18
+ bounciness: 0,
19
+ speed: 7,
20
+ useNativeDriver: false,
21
+ }).start();
22
+ }, [progress]);
23
+ return (
24
+ <View style={[tw`h-2 w-14 bg-[${Colors['primary-light']}] overflow-hidden mr-2`, {
25
+ borderRadius: 40,
26
+ }]}>
27
+ <Animated.View
28
+ style={[StyleSheet.absoluteFill, { backgroundColor: Colors['primary-base'], width: barWidth }]}
29
+
30
+ />
31
+ </View>
32
+ )
33
+ }
@@ -1,101 +1,120 @@
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 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-6 `}>
97
- {bottomButton}
98
- </View> : <></>}
99
- </View>
100
- );
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 { useSafeAreaInsets } from "react-native-safe-area-context";
11
+ import tw from "../lib/tailwind";
12
+ import EText from "./EText";
13
+ import { StatusBar } from "expo-status-bar";
14
+ import {
15
+ Container,
16
+ EButton,
17
+ EButtonIcon,
18
+ PageHeader,
19
+ PageHeaderSecondary,
20
+ } from ".";
21
+ import Constants from "expo-constants";
22
+ import { useNavigation } from "@react-navigation/native";
23
+
24
+ const SCREEN_WIDTH = Dimensions.get("window").width;
25
+ const SCREEN_HEIGHT = Dimensions.get("window").height;
26
+ const HEADER_HEIGHT = Constants.statusBarHeight + 60;
27
+ const SCROLL_PADDING_BOTTOM = 100;
28
+
29
+ interface BaseLayoutProps {
30
+ title: string;
31
+ subtitle?: string;
32
+ curved?: boolean;
33
+ headerContent?: JSX.Element;
34
+ children?: JSX.Element;
35
+ iconEnd?: JSX.Element;
36
+ noScroll?: boolean;
37
+ bottomButton?: JSX.Element;
38
+ border?: boolean;
39
+ menuButton?: boolean;
40
+ }
41
+
42
+ export default function SecondaryBaseLayout({
43
+ title,
44
+ subtitle,
45
+ curved,
46
+ headerContent,
47
+ children,
48
+ noScroll,
49
+ iconEnd,
50
+ bottomButton,
51
+ border,
52
+ menuButton,
53
+ }: BaseLayoutProps) {
54
+ const insets = useSafeAreaInsets();
55
+
56
+ const navigation = useNavigation();
57
+
58
+ return (
59
+ <View
60
+ style={[
61
+ tw`flex-1 bg-white`,
62
+ {
63
+ paddingBottom: Platform.OS === "ios" ? insets.bottom : 0,
64
+ paddingTop: Platform.OS === "ios" ? 20 : 0,
65
+ },
66
+ ]}
67
+ >
68
+ <StatusBar style="dark" animated />
69
+
70
+ {/* HEADER */}
71
+ <View
72
+ style={[
73
+ tw`absolute top-0 right-0 left-0 pt-2 z-10 w-full bg-slate-50 border-b border-slate-200 ${
74
+ title ? "mb-1" : "pb-0"
75
+ }`,
76
+ ]}
77
+ >
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
+ <PageHeader
90
+ border={border}
91
+ title={title}
92
+ subtitle={subtitle}
93
+ curved={curved}
94
+ iconEnd={iconEnd}
95
+ menuButton={menuButton}
96
+ >
97
+ {headerContent}
98
+ </PageHeader>
99
+ </View>
100
+ <ScrollView
101
+ style={[
102
+ tw`flex-1`,
103
+ { paddingBottom: insets.bottom, paddingTop: !title ? 80 : 80 },
104
+ ]}
105
+ showsVerticalScrollIndicator={false}
106
+ decelerationRate={"fast"}
107
+ contentContainerStyle={{
108
+ paddingBottom: SCROLL_PADDING_BOTTOM,
109
+ }}
110
+ >
111
+ {children}
112
+ </ScrollView>
113
+ {bottomButton ? (
114
+ <View style={tw` px-4 mb-6 `}>{bottomButton}</View>
115
+ ) : (
116
+ <></>
117
+ )}
118
+ </View>
119
+ );
120
+ }
@@ -1,57 +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
- )
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
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fln-espranza",
3
- "version": "1.1.14",
3
+ "version": "1.1.16",
4
4
  "description": "All components used inside FLN Project of Espranza Innovations",
5
5
  "main": "index.ts",
6
6
  "scripts": {
package/utils/Color.ts CHANGED
@@ -1,15 +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',
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
15
  };