fln-espranza 0.0.50 → 0.0.52
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/EBadge.tsx +76 -18
- package/components/EButton.tsx +10 -11
- package/components/EListSchool.tsx +1 -1
- package/components/EPageDescription.tsx +1 -2
- package/components/ETimeLineCard.tsx +7 -5
- package/components/ModalLayout.tsx +12 -11
- package/components/PageHeader.tsx +3 -1
- package/package.json +1 -1
package/components/EBadge.tsx
CHANGED
|
@@ -1,24 +1,82 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { View } from 'react-native'
|
|
1
|
+
// import React from 'react'
|
|
2
|
+
// import { View } from 'react-native'
|
|
3
|
+
// import tw from '../lib/tailwind';
|
|
4
|
+
// import EText from './EText';
|
|
5
|
+
// import { CheckCircleIcon } from 'react-native-heroicons/solid';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
// interface IProps {
|
|
9
|
+
// text: string;
|
|
10
|
+
// bgColor: string;
|
|
11
|
+
// textColor: string
|
|
12
|
+
// completed?: boolean;
|
|
13
|
+
// }
|
|
14
|
+
|
|
15
|
+
// export default function EBadge({ text, completed, bgColor, textColor }: IProps) {
|
|
16
|
+
// return (
|
|
17
|
+
// <View style={[tw`flex-row p-1 px-2 bg-[${bgColor}] rounded-full`,]}>
|
|
18
|
+
// {completed ? <CheckCircleIcon style={tw`text-white -ml-1 mr-1`} size={16} /> : null}
|
|
19
|
+
// <EText size='xs' style={tw`font-semibold text-[${textColor}]`}>
|
|
20
|
+
// {text}
|
|
21
|
+
// </EText>
|
|
22
|
+
// </View>
|
|
23
|
+
// )
|
|
24
|
+
// }
|
|
25
|
+
|
|
26
|
+
import React from 'react';
|
|
3
27
|
import tw from '../lib/tailwind';
|
|
28
|
+
import {View} from 'react-native';
|
|
4
29
|
import EText from './EText';
|
|
5
|
-
import { CheckCircleIcon } from 'react-native-heroicons/solid';
|
|
6
30
|
|
|
7
31
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
32
|
+
// Badge Sizes
|
|
33
|
+
export const BADGE_SIZES = {
|
|
34
|
+
sm: 'p-0.75 px-2',
|
|
35
|
+
md: 'p-0.75 px-3',
|
|
36
|
+
};
|
|
37
|
+
export type BadgeSize = keyof typeof BADGE_SIZES;
|
|
38
|
+
|
|
39
|
+
// Badge Text Sizes
|
|
40
|
+
export const BADGE_TEXT_SIZES = {
|
|
41
|
+
sm: 'text-sm',
|
|
42
|
+
md: 'text-base',
|
|
43
|
+
};
|
|
14
44
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</View>
|
|
23
|
-
)
|
|
45
|
+
interface EBadgeProps {
|
|
46
|
+
color?: string;
|
|
47
|
+
variant?: 'solid' | 'light';
|
|
48
|
+
size?: BadgeSize;
|
|
49
|
+
iconLeft?: JSX.Element;
|
|
50
|
+
iconRight?: JSX.Element;
|
|
51
|
+
children: string;
|
|
24
52
|
}
|
|
53
|
+
|
|
54
|
+
const EBadge: React.FC<EBadgeProps> = ({
|
|
55
|
+
color = 'blue-600',
|
|
56
|
+
variant = 'solid',
|
|
57
|
+
size = 'md',
|
|
58
|
+
iconLeft,
|
|
59
|
+
iconRight,
|
|
60
|
+
children,
|
|
61
|
+
}) => {
|
|
62
|
+
const baseStyle = tw`flex-row self-start items-center rounded-full overflow-hidden bg-${color}
|
|
63
|
+
${variant === 'light' && 'bg-opacity-10'}
|
|
64
|
+
${BADGE_SIZES[size]}`;
|
|
65
|
+
|
|
66
|
+
const textStyle = tw`font-semibold capitalize
|
|
67
|
+
${variant === 'light' ? `text-${color}` : 'text-white'}
|
|
68
|
+
${BADGE_TEXT_SIZES[size]}
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<View style={baseStyle}>
|
|
73
|
+
{iconLeft}
|
|
74
|
+
<EText style={textStyle}>{children}</EText>
|
|
75
|
+
{iconRight}
|
|
76
|
+
</View>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export default EBadge;
|
|
81
|
+
|
|
82
|
+
|
package/components/EButton.tsx
CHANGED
|
@@ -13,7 +13,7 @@ interface EButtonProps extends TouchableOpacityProps {
|
|
|
13
13
|
iconR?: JSX.Element;
|
|
14
14
|
inline?: boolean;
|
|
15
15
|
small?: boolean;
|
|
16
|
-
type?: "secondary" | "clear" | "primary";
|
|
16
|
+
type?: "secondary" | "clear" | "primary" | "white";
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
children: any;
|
|
19
19
|
}
|
|
@@ -38,13 +38,13 @@ export default function EButton({
|
|
|
38
38
|
>
|
|
39
39
|
<View
|
|
40
40
|
style={[
|
|
41
|
-
tw`flex-row justify-center items-center rounded-full border-2 border-black/5 ${small ? 'h-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
tw`flex-row justify-center items-center rounded-full border-2 border-black/5 ${small ? 'h-10 px-4' : 'h-14 px-8'} ${disabled ? "opacity-40" : ""} ${type === "clear"
|
|
42
|
+
? "bg-transparent "
|
|
43
|
+
: type === 'white' ? "bg-white"
|
|
44
44
|
: type === "secondary"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
? `bg-[${Colors["secondary-base"]}] self-start px-6 h-11`
|
|
46
|
+
: `bg-[${Colors["primary-base"]}] shadow shadow-[${Colors["primary-base"]}]`
|
|
47
|
+
}`,
|
|
48
48
|
]}
|
|
49
49
|
>
|
|
50
50
|
{/* ICON LEFT */}
|
|
@@ -52,12 +52,11 @@ export default function EButton({
|
|
|
52
52
|
{/* LABEL */}
|
|
53
53
|
<EText
|
|
54
54
|
style={[
|
|
55
|
-
tw`font-semibold ${
|
|
56
|
-
|
|
57
|
-
}`,
|
|
55
|
+
tw`font-semibold ${small ? `text-sm` : ''} ${type === "clear" || type === "white" ? `text-[${Colors["primary-base"]}]` : "text-white"
|
|
56
|
+
}`,
|
|
58
57
|
]}
|
|
59
58
|
>
|
|
60
|
-
{children
|
|
59
|
+
{children}
|
|
61
60
|
</EText>
|
|
62
61
|
|
|
63
62
|
{/* ICON RIGHT */}
|
|
@@ -18,7 +18,7 @@ export default function EListSchool({
|
|
|
18
18
|
}: IProps) {
|
|
19
19
|
return (
|
|
20
20
|
<View style={tw`border-b border-slate-200 py-3`}>
|
|
21
|
-
<EText style={tw`font-bold text-slate-800 mb-0.5
|
|
21
|
+
<EText size="base" style={tw`font-bold text-slate-800 mb-0.5 h-5`} numberOfLines={2}>
|
|
22
22
|
{name}
|
|
23
23
|
</EText>
|
|
24
24
|
<View style={tw`flex-row items-center`}>
|
|
@@ -5,6 +5,7 @@ import { Colors } from '../utils/Color';
|
|
|
5
5
|
import EBadge from './EBadge'
|
|
6
6
|
import EText from './EText';
|
|
7
7
|
import EIconChevronRight from './icons/EIconChevronRight';
|
|
8
|
+
import { CheckCircleIcon } from 'react-native-heroicons/solid';
|
|
8
9
|
|
|
9
10
|
interface IProps {
|
|
10
11
|
title: string;
|
|
@@ -40,13 +41,14 @@ export default function ETimeLineCard({ title, description, completed, disabled,
|
|
|
40
41
|
</EText>
|
|
41
42
|
</View>
|
|
42
43
|
<View style={tw`ml-4`}>
|
|
44
|
+
|
|
43
45
|
<EBadge
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
color={completed ? `[${Colors['primary-base']}]` : `[${Colors.warning}]`}
|
|
47
|
+
size='sm'
|
|
48
|
+
>
|
|
49
|
+
{
|
|
46
50
|
badgeText ? badgeText : completed ? "Complete" : "Pending"}
|
|
47
|
-
|
|
48
|
-
textColor={"#ffff"}
|
|
49
|
-
/>
|
|
51
|
+
</EBadge>
|
|
50
52
|
</View>
|
|
51
53
|
</View>
|
|
52
54
|
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
Dimensions,
|
|
4
|
-
ScrollView,
|
|
5
|
-
Platform,
|
|
6
|
-
} from "react-native";
|
|
7
|
-
import React, { } from "react";
|
|
1
|
+
import { View, Dimensions, ScrollView, Platform } from "react-native";
|
|
2
|
+
import React from "react";
|
|
8
3
|
import Constants from "expo-constants";
|
|
9
4
|
import tw from "../lib/tailwind";
|
|
10
5
|
import EButtonIcon from "./EButtonIcon";
|
|
@@ -44,7 +39,9 @@ export default function ModalLayout({
|
|
|
44
39
|
{/* HEADER */}
|
|
45
40
|
<View
|
|
46
41
|
style={[
|
|
47
|
-
tw`absolute top-0 right-0 left-0 px-6 pr-3 pt-2 z-10 w-full bg-white ${
|
|
42
|
+
tw`absolute top-0 right-0 left-0 px-6 pr-3 pt-2 z-10 w-full bg-white ${
|
|
43
|
+
title ? "pb-2 shadow-md" : "pb-0"
|
|
44
|
+
}`,
|
|
48
45
|
// {height: 64},
|
|
49
46
|
]}
|
|
50
47
|
>
|
|
@@ -73,9 +70,13 @@ export default function ModalLayout({
|
|
|
73
70
|
>
|
|
74
71
|
{children}
|
|
75
72
|
</ScrollView>
|
|
76
|
-
{bottomButton ?
|
|
77
|
-
{
|
|
78
|
-
|
|
73
|
+
{bottomButton ? (
|
|
74
|
+
<View style={tw` px-6 mb-4 pt-2 border-t border-slate-300`}>
|
|
75
|
+
{bottomButton}
|
|
76
|
+
</View>
|
|
77
|
+
) : (
|
|
78
|
+
<></>
|
|
79
|
+
)}
|
|
79
80
|
</View>
|
|
80
81
|
);
|
|
81
82
|
}
|
|
@@ -78,7 +78,9 @@ export default function PageHeader({
|
|
|
78
78
|
|
|
79
79
|
:
|
|
80
80
|
<TouchableOpacity activeOpacity={0.6}
|
|
81
|
-
onPress={() => navigation.goBack()}
|
|
81
|
+
onPress={() => navigation.goBack()}
|
|
82
|
+
style={tw`p-1`}
|
|
83
|
+
>
|
|
82
84
|
<EIconArrowLeft
|
|
83
85
|
iconColor={curved ? "white" : "tint-slate-900"}
|
|
84
86
|
size={24}
|