fln-espranza 0.0.46 → 0.0.47
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/EStat.tsx +19 -34
- package/package.json +1 -1
package/components/EStat.tsx
CHANGED
|
@@ -8,7 +8,7 @@ interface IProps {
|
|
|
8
8
|
stat: string;
|
|
9
9
|
target: string;
|
|
10
10
|
label: string;
|
|
11
|
-
|
|
11
|
+
statColor?: string;
|
|
12
12
|
iconR?: JSX.Element;
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -17,48 +17,33 @@ export default function EStat({
|
|
|
17
17
|
target,
|
|
18
18
|
label,
|
|
19
19
|
iconR,
|
|
20
|
-
|
|
20
|
+
statColor
|
|
21
21
|
}: IProps) {
|
|
22
22
|
|
|
23
23
|
const percentage = Math.round((parseFloat(stat) / parseFloat(target)) * 100);
|
|
24
|
-
|
|
25
|
-
const textColor = 'text-white';
|
|
24
|
+
const pending = parseFloat(target) - parseFloat(stat);
|
|
26
25
|
|
|
27
26
|
return (
|
|
28
27
|
<TouchableOpacity
|
|
29
|
-
style={[tw`
|
|
30
|
-
shadowColor: '#155e75',
|
|
31
|
-
shadowOffset: { width: 0, height:
|
|
32
|
-
shadowOpacity:
|
|
33
|
-
shadowRadius:
|
|
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,
|
|
34
33
|
}]}
|
|
35
34
|
activeOpacity={0.8}
|
|
36
35
|
>
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{iconR}
|
|
49
|
-
</View>
|
|
50
|
-
{/* PROGRESSBAR */}
|
|
51
|
-
<View style={tw`flex-row`}>
|
|
52
|
-
<View style={tw`bg-slate-200 h-1 rounded-full mb-1 mt-2 overflow-hidden flex-1 mr-3`}>
|
|
53
|
-
<View style={[tw`h-1 w-32 bg-teal-400`, { width: percentage }]}></View>
|
|
54
|
-
</View>
|
|
55
|
-
<EText size="xs" style={tw`text-teal-400 font-bold`}>
|
|
56
|
-
{percentage}%
|
|
57
|
-
</EText>
|
|
58
|
-
</View>
|
|
59
|
-
<EText style={tw`font-bold mt-2 ${textColor}`}>{label}</EText>
|
|
60
|
-
<EText size="xs" style={tw` ${textColor} opacity-60 font-medium`}>This month</EText>
|
|
61
|
-
</ImageBackground>
|
|
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>
|
|
62
47
|
</TouchableOpacity>
|
|
63
48
|
);
|
|
64
49
|
}
|