|
@@ -23,11 +23,9 @@ export default function DayList(props)
|
23
|
23
|
)
|
24
|
24
|
total += depense.value;
|
25
|
25
|
});
|
26
|
|
- console.log("####");
|
27
|
|
- console.log(props.dailyObjective);
|
|
26
|
+
|
28
|
27
|
let scale = Math.min(1, total/props.dailyObjective)
|
29
|
28
|
|
30
|
|
-
|
31
|
29
|
let result = props.dailyObjective - total
|
32
|
30
|
let text_color = "#000000";
|
33
|
31
|
let bg_color = "#FFFFFF";
|
|
@@ -37,13 +35,12 @@ export default function DayList(props)
|
37
|
35
|
bg_color = "#FF"+
|
38
|
36
|
strLPad(parseInt(255 + Math.max(-255,(result / props.dailyObjective) * 100)).toString(16), 2, '0') +
|
39
|
37
|
strLPad(parseInt(255 + Math.max(-255, (result / props.dailyObjective) * 100)).toString(16), 2, '0')
|
40
|
|
- console.log(bg_color);
|
41
|
|
- console.log(scale);
|
42
|
38
|
return (
|
43
|
39
|
<View style={[day_list_styles.day_list_container, {backgroundColor: bg_color}, isCurrentday ? day_list_styles.current_day_container : null]}>
|
44
|
40
|
<LinearGradient
|
45
|
|
- colors={[scale > 0 ? '#FFDDDDFF' : '#FFFFFF','#FFFFFF', '#FFFFFF']}
|
46
|
|
- locations={[scale, scale+0.05, 1]}
|
|
41
|
+ colors={[scale > 0 ? '#FFDDDDFF' : '#FFFFFFFF','#FFFFFFFF', '#FFFFFFFF']}
|
|
42
|
+ locations={[scale, scale + (scale < 0.95 ? 0.05 : 0), 1]}
|
|
43
|
+ start={{ x: 0, y: 0.0 }}
|
47
|
44
|
end={{x:1,y:0}}
|
48
|
45
|
style={day_list_styles.background}
|
49
|
46
|
/>
|
|
@@ -83,7 +80,7 @@ const day_list_styles = StyleSheet.create({
|
83
|
80
|
display: 'flex',
|
84
|
81
|
flexDirection: 'row',
|
85
|
82
|
justifyContent: 'space-between',
|
86
|
|
- marginBottom: 10,
|
|
83
|
+ margin: 10,
|
87
|
84
|
},
|
88
|
85
|
day_list_day: {
|
89
|
86
|
fontWeight: '900',
|