fln-espranza 0.0.52 → 0.0.53

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.
@@ -10,6 +10,7 @@ interface IProps {
10
10
  subjectName?: string;
11
11
  border?: boolean;
12
12
  children?: JSX.Element;
13
+ showAvatar?: boolean;
13
14
  }
14
15
 
15
16
  export default function EProfile({
@@ -17,27 +18,27 @@ export default function EProfile({
17
18
  subjectName,
18
19
  border,
19
20
  children,
21
+ showAvatar = true
20
22
  }: IProps) {
21
23
  return (
22
24
  <View
23
25
  style={[
24
- tw`flex-row items-center justify-between py-3 ${
25
- border ? "border-b" : ""
26
- }`,
26
+ tw`flex-row items-center justify-between py-3 ${border ? "border-b" : ""
27
+ }`,
27
28
  { borderBottomColor: Colors.border },
28
29
  ]}
29
30
  >
30
31
  <View style={tw`flex-row items-center`}>
31
- <Avatar
32
+ {showAvatar ? <Avatar
32
33
  size="sm"
33
34
  source={""}
34
35
  nameFirstLetter={name.split(" ")[0].charAt(0)}
35
- />
36
+ /> : <></>}
36
37
  <View style={tw`ml-3`}>
37
38
  <EText
38
39
  size={"lg"}
39
40
  style={[
40
- tw`font-bold text-slate-800 mb-0.5 capitalize`,
41
+ tw`font-bold text-slate-800 mb-0 capitalize`,
41
42
  { color: Colors["text-primary"] },
42
43
  ]}
43
44
  >
@@ -0,0 +1,49 @@
1
+ import React from "react";
2
+ import { ImageBackground, TouchableOpacity, View } from "react-native";
3
+ import tw from "../../../lib/tailwind";
4
+ import EText from "./EText";
5
+ import { Colors } from "fln-espranza/utils/Color";
6
+
7
+ interface IProps {
8
+ stat: string;
9
+ target: string;
10
+ label: string;
11
+ statColor?: string;
12
+ iconR?: JSX.Element;
13
+ }
14
+
15
+ export default function EStatReport({
16
+ stat,
17
+ target,
18
+ label,
19
+ iconR,
20
+ statColor
21
+ }: IProps) {
22
+
23
+ const percentage = Math.round((parseFloat(stat) / parseFloat(target)) * 100);
24
+ const pending = Number(stat) <= Number(target) ? parseFloat(target) - parseFloat(stat) : 0;
25
+
26
+ return (
27
+ <TouchableOpacity
28
+ style={[tw`bg-slate-00 flex-1 overflow-hidden items-center py-3`, {
29
+ // shadowColor: '#155e75',
30
+ // shadowOffset: { width: 0, height: 8 },
31
+ // shadowOpacity: .1,
32
+ // shadowRadius: 16,
33
+ }]}
34
+ activeOpacity={0.8}
35
+ >
36
+ <View style={tw` mb-2 flex-row flex-1 justify-center`}>
37
+ <EText style={tw`text-3xl font-bold ${statColor} -tracking-0.25 `}>
38
+ {stat}
39
+ </EText>
40
+ <EText style={tw`ml-0.5 pt-1 text-slate-800 opacity-50 font-semibold -tracking-0.25`}>
41
+ / {target}
42
+ </EText>
43
+ {iconR}
44
+ </View>
45
+ <EText size="lg" style={tw`font-bold text-slate-700 mb-0.5`}>{label}</EText>
46
+ <EText size="sm" style={tw` text-slate-800 opacity-60`}>{pending} remaining</EText>
47
+ </TouchableOpacity>
48
+ );
49
+ }
package/index.ts CHANGED
@@ -88,6 +88,9 @@ import EProfileScreenLayout from "./components/EProfileScreenLayout";
88
88
  import { EIconMale } from "./components/icons/EIconMale";
89
89
  import { EIconFemale } from "./components/icons/EIconFemale";
90
90
  import EIconDocumentCheck from "./components/icons/EIconDocumentCheck";
91
+ import EStatReport from "./components/icons/EIconDocumentCheck";
92
+
93
+
91
94
 
92
95
  export {
93
96
  Avatar,
@@ -133,6 +136,7 @@ export {
133
136
  EProfileScreenLayout,
134
137
  ETextArea,
135
138
  ENotFoundPlaceholder,
139
+ EStatReport
136
140
 
137
141
  // ICONS
138
142
  EIconAdd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fln-espranza",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "All components used inside FLN Project of Espranza Innovations",
5
5
  "main": "index.ts",
6
6
  "scripts": {