fln-espranza 0.0.19 → 0.0.21

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.
@@ -9,6 +9,7 @@ interface IProps {
9
9
  subtitle?: string;
10
10
  noBorder?: boolean;
11
11
  firstLetter?: string;
12
+ itemsEnd?: JSX.Element;
12
13
  }
13
14
 
14
15
  export default function EListPerson({
@@ -16,24 +17,31 @@ export default function EListPerson({
16
17
  subtitle,
17
18
  noBorder,
18
19
  firstLetter,
20
+ itemsEnd,
19
21
  }: IProps) {
20
22
  return (
21
23
  <View style={[tw`flex-row items-center justify-between`]}>
22
24
  <Avatar size="sm" source={""} nameFirstLetter={name.split(" ")[0].charAt(0)} />
23
25
  <View
24
- style={tw` ml-3 py-3 flex-1 ${
26
+ style={tw` ml-3 py-3 flex-1 flex-row items-center justify-between ${
25
27
  noBorder ? "" : "border-b border-slate-200"
26
28
  }`}
27
29
  >
30
+ <View>
28
31
  <EText style={tw`font-bold text-slate-800 mb-0.5 capitalize`} numberOfLines={1}>
29
32
  {name}
30
33
  </EText>
31
34
 
32
- {subtitle ? (
35
+ {subtitle
36
+ ?
37
+ (
33
38
  <EText size="sm" style={tw`text-slate-500`}>
34
39
  {subtitle}
35
40
  </EText>
36
- ) : null}
41
+ )
42
+ : <></>}
43
+ </View>
44
+ {itemsEnd}
37
45
  </View>
38
46
  </View>
39
47
  );
@@ -1,34 +1,85 @@
1
- import React, { useState } from 'react';
2
- import { TouchableOpacity, View, TouchableOpacityProps } from 'react-native';
3
- import tw from '../../../lib/tailwind';
4
- import EText from './EText';
1
+ import React, { useState } from "react";
2
+ import {
3
+ TouchableOpacity,
4
+ View,
5
+ TouchableOpacityProps,
6
+ Dimensions,
7
+ Image,
8
+ } from "react-native";
9
+ import tw from "../../../lib/tailwind";
10
+ import EText from "./EText";
5
11
  import { Colors } from "../utils/Color";
6
12
 
13
+ const ImageWidth = Dimensions.get("window").width / 2 - 18;
14
+ const ContentWidth = Dimensions.get("window").width - 32;
15
+ const ImageHeight = 120;
16
+ const MediaContainerStyle = "rounded-md overflow-hidden";
7
17
 
8
18
  interface RadioButtonProps extends TouchableOpacityProps {
9
- text?: string;
10
- isActive: boolean;
11
- onPress?: () => void;
19
+ text?: string;
20
+ isActive: boolean;
21
+ imageSource?: string;
22
+ onPress?: () => void;
12
23
  }
13
- const EOption = ({ isActive, text, onPress, ...props }: RadioButtonProps) => {
14
-
15
- return (
16
- <TouchableOpacity
17
- style={[tw`flex flex-row justify-start items-center mt-2 px-4 py-3 border rounded-lg`, {
18
- borderColor: isActive ? Colors['secondary-base'] : Colors.border,
19
- backgroundColor: isActive ? Colors['secondary-light'] : Colors.white
20
- }]
21
- }
22
- onPress={() => {
23
- onPress && onPress();
24
+ const EOption = ({
25
+ isActive,
26
+ text,
27
+ imageSource,
28
+ onPress,
29
+ ...props
30
+ }: RadioButtonProps) => {
31
+ return (
32
+ <TouchableOpacity
33
+ style={[
34
+ tw`flex flex-row justify-start items-center mt-1 px-4 py-3 border rounded-lg ${
35
+ imageSource ? "flex-col p-0 items-start" : ""
36
+ }`,
37
+ {
38
+ borderColor: isActive ? Colors["secondary-base"] : Colors.border,
39
+ backgroundColor: isActive ? Colors["secondary-light"] : Colors.white,
40
+ width: imageSource ? ImageWidth : ContentWidth,
41
+ },
42
+ ]}
43
+ onPress={() => {
44
+ onPress && onPress();
45
+ }}
46
+ activeOpacity={0.7}
47
+ {...props}
48
+ >
49
+ {imageSource !== "" && (
50
+ <View
51
+ style={[
52
+ tw`${MediaContainerStyle}`,
53
+ {
54
+ height: ImageHeight,
55
+ width: ImageWidth - 2,
56
+ backgroundColor: Colors["secondary-base"],
57
+ },
58
+ ]}
59
+ >
60
+ <Image
61
+ style={[
62
+ tw`h-full w-full`,
63
+ {
64
+ opacity: isActive ? 0.5 : 1,
65
+ },
66
+ ]}
67
+ source={{
68
+ uri: imageSource ,
24
69
  }}
25
- {...props}
70
+ />
71
+ </View>
72
+ )}
73
+ {text ? (
74
+ <EText
75
+ size={"base"}
76
+ style={tw`font-normal ${imageSource ? "py-2 px-4" : ""}`}
26
77
  >
27
- <EText size={"base"} style={tw`font-normal`}>
28
- {text}
29
- </EText>
30
- </TouchableOpacity>
31
- );
78
+ {text}
79
+ </EText>
80
+ ) : null}
81
+ </TouchableOpacity>
82
+ );
32
83
  };
33
84
 
34
85
  export default EOption;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fln-espranza",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "All components used inside FLN Project of Espranza Innovations",
5
5
  "main": "index.ts",
6
6
  "scripts": {