fln-espranza 0.0.18 → 0.0.20

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.
@@ -22,7 +22,8 @@ export default function Avatar({ size, source, nameFirstLetter, textColor }: Ava
22
22
  "#2D3A5D",
23
23
  ]
24
24
 
25
- let color = colors[Math.floor(Math.random() * colors.length)]
25
+ // let color = colors[Math.floor(Math.random() * colors.length)]
26
+ const [color, setColor] = React.useState(colors[Math.floor(Math.random() * colors.length)]);
26
27
  return (
27
28
  <View
28
29
  style={tw.style(
@@ -1,34 +1,86 @@
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: "https://th-thumbnailer.cdn-si-edu.com/CbddkFFO3OB80rRz83Iiuf-Z0FY=/1000x750/filters:no_upscale():focal(1471x1061:1472x1062)/https://tf-cmsv2-smithsonianmag-media.s3.amazonaws.com/filer/b6/30/b630b48b-7344-4661-9264-186b70531bdc/istock-478831658.jpg",
24
69
  }}
25
- {...props}
70
+ // resizeMode="contain"
71
+ />
72
+ </View>
73
+ )}
74
+ {text ? (
75
+ <EText
76
+ size={"base"}
77
+ style={tw`font-normal ${imageSource ? "py-2 px-4" : ""}`}
26
78
  >
27
- <EText size={"base"} style={tw`font-normal`}>
28
- {text}
29
- </EText>
30
- </TouchableOpacity>
31
- );
79
+ {text}
80
+ </EText>
81
+ ) : null}
82
+ </TouchableOpacity>
83
+ );
32
84
  };
33
85
 
34
86
  export default EOption;
@@ -15,9 +15,10 @@ interface IProps {
15
15
  completed: boolean;
16
16
  anotherButton?: boolean;
17
17
  onPress?: () => void;
18
+ onAnotherButtonPress?: () => void;
18
19
  }
19
20
 
20
- export default function ETimeLineCard({ title, description, completed, anotherButton, onPress }: IProps) {
21
+ export default function ETimeLineCard({ title, description, completed, anotherButton, onPress, onAnotherButtonPress }: IProps) {
21
22
  return (
22
23
  <TouchableOpacity
23
24
  onPress={() => onPress && onPress()}
@@ -53,7 +54,7 @@ export default function ETimeLineCard({ title, description, completed, anotherBu
53
54
 
54
55
  {
55
56
  anotherButton ? (
56
- <TouchableOpacity style={tw`flex-row`}>
57
+ <TouchableOpacity style={tw`flex-row`} onPress={onAnotherButtonPress}>
57
58
  <EText size="sm" style={[tw`ml-2 font-semibold`, {color: Colors['primary-base']}]}>
58
59
  Another Assessment
59
60
  </EText>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fln-espranza",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "All components used inside FLN Project of Espranza Innovations",
5
5
  "main": "index.ts",
6
6
  "scripts": {