fln-espranza 0.0.26 → 0.0.28
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/EOption.tsx +25 -12
- package/components/ETimeLineCard.tsx +29 -22
- package/package.json +1 -1
package/components/EOption.tsx
CHANGED
|
@@ -12,32 +12,34 @@ import { Colors } from "../utils/Color";
|
|
|
12
12
|
|
|
13
13
|
const ImageWidth = Dimensions.get("window").width / 2 - 18;
|
|
14
14
|
const ContentWidth = Dimensions.get("window").width - 32;
|
|
15
|
-
const ImageHeight =
|
|
15
|
+
const ImageHeight = 140;
|
|
16
16
|
const MediaContainerStyle = "rounded-md overflow-hidden";
|
|
17
17
|
|
|
18
18
|
interface RadioButtonProps extends TouchableOpacityProps {
|
|
19
19
|
text?: string;
|
|
20
20
|
isActive: boolean;
|
|
21
21
|
imageSource?: string;
|
|
22
|
+
optionLabel: string;
|
|
22
23
|
onPress?: () => void;
|
|
23
24
|
}
|
|
24
25
|
const EOption = ({
|
|
25
26
|
isActive,
|
|
26
27
|
text,
|
|
27
28
|
imageSource,
|
|
29
|
+
optionLabel,
|
|
28
30
|
onPress,
|
|
29
31
|
...props
|
|
30
32
|
}: RadioButtonProps) => {
|
|
31
33
|
return (
|
|
32
34
|
<TouchableOpacity
|
|
33
35
|
style={[
|
|
34
|
-
tw`flex flex-row justify-start items-center mt-
|
|
36
|
+
tw`flex flex-row justify-start items-center mt-2 px-4 py-3 border rounded-lg ${
|
|
35
37
|
imageSource ? "flex-col p-0 items-start" : ""
|
|
36
38
|
}`,
|
|
37
39
|
{
|
|
38
40
|
borderColor: isActive ? Colors["secondary-base"] : Colors.border,
|
|
39
41
|
backgroundColor: isActive ? Colors["secondary-light"] : Colors.white,
|
|
40
|
-
width: imageSource ? ImageWidth : ContentWidth,
|
|
42
|
+
width: imageSource ? ImageWidth - 10 : ContentWidth,
|
|
41
43
|
},
|
|
42
44
|
]}
|
|
43
45
|
onPress={() => {
|
|
@@ -46,30 +48,41 @@ const EOption = ({
|
|
|
46
48
|
activeOpacity={0.7}
|
|
47
49
|
{...props}
|
|
48
50
|
>
|
|
49
|
-
{imageSource
|
|
51
|
+
{imageSource ? (
|
|
50
52
|
<View
|
|
51
53
|
style={[
|
|
52
54
|
tw`${MediaContainerStyle}`,
|
|
53
55
|
{
|
|
54
|
-
height: ImageHeight,
|
|
55
|
-
width: ImageWidth -
|
|
56
|
-
backgroundColor: Colors
|
|
56
|
+
height: ImageHeight - 20,
|
|
57
|
+
width: ImageWidth - 12,
|
|
58
|
+
backgroundColor: Colors.white
|
|
57
59
|
},
|
|
58
60
|
]}
|
|
59
61
|
>
|
|
62
|
+
<View
|
|
63
|
+
style={[
|
|
64
|
+
tw`h-8 w-8 bg-slate-300 rounded-full justify-center items-center m-2 absolute z-10`,
|
|
65
|
+
]}
|
|
66
|
+
>
|
|
67
|
+
<EText size={"base"} style={tw`font-normal`}>
|
|
68
|
+
{optionLabel}
|
|
69
|
+
</EText>
|
|
70
|
+
</View>
|
|
60
71
|
<Image
|
|
61
72
|
style={[
|
|
62
|
-
tw`
|
|
73
|
+
tw`w-full mt-4`,
|
|
63
74
|
{
|
|
64
75
|
opacity: isActive ? 0.5 : 1,
|
|
65
76
|
},
|
|
77
|
+
{height: ImageHeight - 40}
|
|
66
78
|
]}
|
|
67
|
-
source={{
|
|
68
|
-
|
|
69
|
-
}}
|
|
79
|
+
source={{uri: imageSource}}
|
|
80
|
+
resizeMode="contain"
|
|
70
81
|
/>
|
|
71
82
|
</View>
|
|
72
|
-
)
|
|
83
|
+
)
|
|
84
|
+
: <></>
|
|
85
|
+
}
|
|
73
86
|
{text ? (
|
|
74
87
|
<EText
|
|
75
88
|
size={"base"}
|
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
import { EIconAdd } from 'fln-espranza';
|
|
2
1
|
import React from 'react'
|
|
3
2
|
import { Dimensions, TouchableOpacity, View } from 'react-native'
|
|
4
|
-
import { ChevronRightIcon } from 'react-native-heroicons/solid';
|
|
5
3
|
import tw from '../lib/tailwind'
|
|
6
4
|
import { Colors } from '../utils/Color';
|
|
7
5
|
import EBadge from './EBadge'
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import EText from './EText'
|
|
6
|
+
import EText from './EText';
|
|
7
|
+
import EIconChevronRight from './icons/EIconChevronRight';
|
|
11
8
|
|
|
12
9
|
interface IProps {
|
|
13
10
|
title: string;
|
|
14
11
|
description: string;
|
|
15
12
|
completed: boolean;
|
|
16
|
-
anotherButton?: boolean;
|
|
17
13
|
onPress?: () => void;
|
|
18
|
-
|
|
14
|
+
buttonText?: string;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
badgeText?: string;
|
|
19
17
|
}
|
|
20
18
|
|
|
21
|
-
export default function ETimeLineCard({ title, description, completed,
|
|
19
|
+
export default function ETimeLineCard({ title, description, completed, disabled, onPress, buttonText, badgeText }: IProps) {
|
|
22
20
|
return (
|
|
23
21
|
<TouchableOpacity
|
|
24
|
-
onPress={() =>
|
|
22
|
+
onPress={() => onPress && onPress()}
|
|
25
23
|
style={[
|
|
26
24
|
tw` rounded-lg p-4 mb-3 w-full border border}`,
|
|
27
25
|
{
|
|
28
|
-
backgroundColor: completed ? Colors['primary-light']
|
|
26
|
+
backgroundColor: completed ? Colors['primary-light'] : Colors['white'],
|
|
29
27
|
borderColor: completed ? Colors['primary-base'] : Colors['border'],
|
|
30
28
|
}
|
|
31
29
|
]}
|
|
30
|
+
disabled={disabled}
|
|
32
31
|
>
|
|
33
32
|
|
|
34
33
|
<View style={tw`flex-row justify-between `}>
|
|
@@ -36,32 +35,40 @@ export default function ETimeLineCard({ title, description, completed, anotherBu
|
|
|
36
35
|
<EText size="lg" style={[tw`font-bold`, { color: Colors['text-primary'] }]}>
|
|
37
36
|
{title}
|
|
38
37
|
</EText>
|
|
39
|
-
<EText size='sm' style={[tw`font-normal mt-1`, {color: Colors['text-body']}]}>
|
|
38
|
+
<EText size='sm' style={[tw`font-normal mt-1`, { color: Colors['text-body'] }]}>
|
|
40
39
|
{description}
|
|
41
40
|
</EText>
|
|
42
41
|
</View>
|
|
43
|
-
<View style={tw`ml-4`}>
|
|
44
|
-
<ChevronRightIcon style={[tw``,{ color: Colors['text-body']}]} size={16} />
|
|
42
|
+
{/* <View style={tw`ml-4`}>
|
|
43
|
+
<ChevronRightIcon style={[tw``, { color: Colors['text-body'] }]} size={16} />
|
|
44
|
+
</View> */}
|
|
45
|
+
<View style={tw`ml-4`}>
|
|
46
|
+
<EBadge
|
|
47
|
+
completed={completed}
|
|
48
|
+
text={
|
|
49
|
+
badgeText ? badgeText : completed ? "Complete" : "Pending"}
|
|
50
|
+
color={completed ? Colors['primary-base'] : Colors.warning}
|
|
51
|
+
/>
|
|
45
52
|
</View>
|
|
46
53
|
</View>
|
|
47
54
|
|
|
48
55
|
<View style={tw`mt-6 flex-row items-center justify-between`}>
|
|
49
|
-
<EBadge
|
|
56
|
+
{/* <EBadge
|
|
50
57
|
completed={completed}
|
|
51
58
|
text={completed ? "Complete" : "Pending"}
|
|
52
59
|
color={completed ? Colors['primary-base'] : Colors.warning}
|
|
53
|
-
/>
|
|
60
|
+
/> */}
|
|
54
61
|
|
|
55
62
|
{
|
|
56
|
-
|
|
57
|
-
<TouchableOpacity style={tw`flex-row`} onPress={
|
|
58
|
-
<EText size="sm" style={[tw`ml-2 font-semibold`, {color: Colors['primary-base']}]}>
|
|
59
|
-
|
|
63
|
+
!disabled ? (
|
|
64
|
+
<TouchableOpacity style={tw`flex-row`} onPress={onPress}>
|
|
65
|
+
<EText size="sm" style={[tw`ml-2 font-semibold`, { color: Colors['primary-base'] }]}>
|
|
66
|
+
{buttonText}
|
|
60
67
|
</EText>
|
|
61
|
-
<
|
|
68
|
+
<EIconChevronRight size={20} style={[tw`ml-2`, { color: Colors['primary-base'] }]} />
|
|
62
69
|
</TouchableOpacity>
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
|
|
71
|
+
) : <></>
|
|
65
72
|
}
|
|
66
73
|
</View>
|
|
67
74
|
</TouchableOpacity>
|