|
@@ -2,6 +2,7 @@ import React from 'react';
|
2
|
2
|
import { StyleSheet, Text, View, TextInput, Alert, Pressable } from 'react-native';
|
3
|
3
|
import DepenseListEntry from '../depense_list_entry';
|
4
|
4
|
import { strLPad } from '../../utils/util';
|
|
5
|
+import { LinearGradient } from 'expo-linear-gradient';
|
5
|
6
|
|
6
|
7
|
export default function DayList(props)
|
7
|
8
|
{
|
|
@@ -22,7 +23,8 @@ export default function DayList(props)
|
22
|
23
|
)
|
23
|
24
|
total += depense.value;
|
24
|
25
|
});
|
25
|
|
-
|
|
26
|
+ let scale = Math.min(1, total/props.dailyObjective)
|
|
27
|
+
|
26
|
28
|
|
27
|
29
|
let result = props.dailyObjective - total
|
28
|
30
|
let text_color = "#000000";
|
|
@@ -36,6 +38,12 @@ export default function DayList(props)
|
36
|
38
|
|
37
|
39
|
return (
|
38
|
40
|
<View style={[day_list_styles.day_list_container, {backgroundColor: bg_color}, isCurrentday ? day_list_styles.current_day_container : null]}>
|
|
41
|
+ <LinearGradient
|
|
42
|
+ colors={[scale > 0 ? '#FFDDDDFF' : '#FFFFFF','#FFFFFF', '#FFFFFF']}
|
|
43
|
+ locations={[scale, scale+0.05, 1]}
|
|
44
|
+ end={{x:1,y:0}}
|
|
45
|
+ style={day_list_styles.background}
|
|
46
|
+ />
|
39
|
47
|
<Pressable
|
40
|
48
|
style={day_list_styles.day_list_entry}
|
41
|
49
|
onPress={() => {onToggleDepenses(!showDepenses)}}>
|
|
@@ -52,9 +60,10 @@ export default function DayList(props)
|
52
|
60
|
const day_list_styles = StyleSheet.create({
|
53
|
61
|
day_list_container: {
|
54
|
62
|
// borderWidth: 1,
|
55
|
|
- margin: 1,
|
56
|
|
- marginTop: 15,
|
57
|
|
- elevation: 5,
|
|
63
|
+ // margin: 1,
|
|
64
|
+ // marginTop: 5,
|
|
65
|
+ // marginBottom: 15,
|
|
66
|
+ // elevation: 5,
|
58
|
67
|
|
59
|
68
|
},
|
60
|
69
|
current_day_container: {
|
|
@@ -76,5 +85,10 @@ const day_list_styles = StyleSheet.create({
|
76
|
85
|
day_list_day: {
|
77
|
86
|
fontWeight: '900',
|
78
|
87
|
margin: 4,
|
|
88
|
+ },
|
|
89
|
+ background: {
|
|
90
|
+ position: 'absolute',
|
|
91
|
+ width: '100%',
|
|
92
|
+ height: "100%",
|
79
|
93
|
}
|
80
|
94
|
});
|