fln-espranza 0.0.44 → 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,24 +1,64 @@
1
1
  import React from "react";
2
- import { 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;
9
+ target: string;
8
10
  label: string;
9
- backgroundColor: string;
10
- lightText?: boolean;
11
+ bgColor?: string;
12
+ iconR?: JSX.Element;
11
13
  }
12
14
 
13
- export default function EStat({ stat, label, backgroundColor, lightText }: IProps) {
15
+ export default function EStat({
16
+ stat,
17
+ target,
18
+ label,
19
+ iconR,
20
+ bgColor
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
+
14
27
  return (
15
- <View style={tw`mr-1 mt-1 w-[140px] h-[110px] p-3 justify-between shadow-lg shadow-slate-400 rounded-tl-lg rounded-tr-[44px] bg-[${backgroundColor}]`}>
16
- <EText style={tw`font-bold tracking-tight text-2xl ${lightText ? 'text-white' : 'text-slate-900'}`}>
17
- {stat}
18
- </EText>
19
- <EText size="xs" style={tw`mb-1 ${lightText ? 'text-white/90' : 'text-slate-900/90'}`}>
20
- {label}
21
- </EText>
22
- </View>
28
+ <TouchableOpacity
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
+ }]}
35
+ activeOpacity={0.8}
36
+ >
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>
62
+ </TouchableOpacity>
23
63
  );
24
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fln-espranza",
3
- "version": "0.0.44",
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": {