fln-espranza 0.0.45 → 0.0.46

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.
Binary file
@@ -1,13 +1,14 @@
1
1
  import React from "react";
2
- import { TouchableOpacity, View } from "react-native";
2
+ import { ImageBackground, TouchableOpacity, View } from "react-native";
3
3
  import tw from "../../../lib/tailwind";
4
4
  import EText from "./EText";
5
+ import { Colors } from "fln-espranza/utils/Color";
5
6
 
6
7
  interface IProps {
7
8
  stat: string;
8
9
  target: string;
9
10
  label: string;
10
- percentage: string;
11
+ bgColor?: string;
11
12
  iconR?: JSX.Element;
12
13
  }
13
14
 
@@ -15,27 +16,49 @@ export default function EStat({
15
16
  stat,
16
17
  target,
17
18
  label,
18
- percentage,
19
19
  iconR,
20
+ bgColor
20
21
  }: IProps) {
22
+
23
+ const percentage = Math.round((parseFloat(stat) / parseFloat(target)) * 100);
24
+ // const textColor = 'text-slate-800';
25
+ const textColor = 'text-white';
26
+
21
27
  return (
22
28
  <TouchableOpacity
23
- style={tw`p-4 bg-white rounded-lg shadow-lg`}
29
+ style={[tw`p-4 bg-white rounded-2xl flex-1 `, {
30
+ shadowColor: '#155e75',
31
+ shadowOffset: { width: 0, height: 6 },
32
+ shadowOpacity: 0.25,
33
+ shadowRadius: 8,
34
+ }]}
24
35
  activeOpacity={0.8}
25
36
  >
26
- <View style={tw`flex-row`}>
27
- <EText style={tw`text-4xl font-extrabold -tracking-0.25`}>
28
- {stat}
29
- </EText>
30
- <EText size="sm" style={tw`ml-1 opacity-50 flex-1`}>
31
- / {target}
32
- </EText>
33
- {iconR}
34
- </View>
35
- <EText size="sm" style={tw`text-teal-600 font-semibold`}>
36
- {percentage} Complete
37
- </EText>
38
- <EText style={tw`font-semibold mt-3 text-slate-800`}>{label}</EText>
37
+ <ImageBackground
38
+ source={require('../assets/images/bg-stat.png')}
39
+ resizeMode="cover"
40
+ >
41
+ <View style={tw`flex-row mb-1`}>
42
+ <EText style={tw`text-3xl font-extrabold ${textColor} -tracking-0.25 -mt-1`}>
43
+ {stat}
44
+ </EText>
45
+ <EText size="sm" style={tw`ml-1 pt-1 ${textColor} opacity-50 flex-1 font-medium`}>
46
+ / {target}
47
+ </EText>
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>
39
62
  </TouchableOpacity>
40
63
  );
41
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fln-espranza",
3
- "version": "0.0.45",
3
+ "version": "0.0.46",
4
4
  "description": "All components used inside FLN Project of Espranza Innovations",
5
5
  "main": "index.ts",
6
6
  "scripts": {