Browse Source

days display as jauges

master
DemiSel 2 years ago
parent
commit
61b9951a80

+ 12
- 0
components/add_depense.js View File

27
 
27
 
28
 
28
 
29
 const add_depenses_styles = StyleSheet.create({
29
 const add_depenses_styles = StyleSheet.create({
30
+    
30
     overlay: {
31
     overlay: {
31
         height: "100%",
32
         height: "100%",
32
         width: "100%",
33
         width: "100%",
33
         position: 'absolute',
34
         position: 'absolute',
35
+        // display:"flex",
36
+        // justifyContent: "center",
37
+        // elevation:10,
34
     },
38
     },
35
     
39
     
36
     button_add: {
40
     button_add: {
37
         borderWidth: 1,
41
         borderWidth: 1,
42
+        borderRadius: 25,
38
         padding: 10,
43
         padding: 10,
39
         backgroundColor: "#FFFFFF",
44
         backgroundColor: "#FFFFFF",
40
         elevation:5,
45
         elevation:5,
46
+        width: "100%",
47
+        height: "100%",
48
+        justifyContent: 'center',
49
+        alignItems: 'center',
50
+        
41
     },
51
     },
42
     button_add_parent: {
52
     button_add_parent: {
43
         position: 'absolute',
53
         position: 'absolute',
44
         bottom: 10,
54
         bottom: 10,
45
         right: 10,
55
         right: 10,
56
+        width:50,
57
+        height:50,
46
     }
58
     }
47
 });
59
 });

+ 5
- 1
components/depense_edit/depense_form.js View File

143
         display: 'flex',
143
         display: 'flex',
144
         flexDirection: 'column',
144
         flexDirection: 'column',
145
         justifyContent: "space-between",
145
         justifyContent: "space-between",
146
-        borderWidth: 1,
146
+        // borderWidth: 5,
147
+        // borderRadius: 5,
147
     },
148
     },
148
     form_entry :{
149
     form_entry :{
149
         display: 'flex',
150
         display: 'flex',
152
     input :{
153
     input :{
153
         width: "50%",
154
         width: "50%",
154
         borderWidth: 1,
155
         borderWidth: 1,
156
+        // borderRadius: 5,
157
+
155
         textAlign: 'center',
158
         textAlign: 'center',
156
     },
159
     },
157
     button_add: {
160
     button_add: {
158
         borderWidth: 1,
161
         borderWidth: 1,
162
+        // borderRadius: 5,
159
         padding: 10,
163
         padding: 10,
160
         margin: 1,
164
         margin: 1,
161
     },
165
     },

+ 4
- 2
components/depenses_list.js View File

141
 
141
 
142
 
142
 
143
     return(
143
     return(
144
-    <SafeAreaView >
144
+    <View>
145
+    <SafeAreaView>
145
             {content}
146
             {content}
146
-    </SafeAreaView >
147
+    </SafeAreaView>
148
+    </View>
147
     )
149
     )
148
 }
150
 }
149
 
151
 

+ 18
- 4
components/list/day_list.js View File

2
 import { StyleSheet, Text, View, TextInput, Alert, Pressable } from 'react-native';
2
 import { StyleSheet, Text, View, TextInput, Alert, Pressable } from 'react-native';
3
 import DepenseListEntry from '../depense_list_entry';
3
 import DepenseListEntry from '../depense_list_entry';
4
 import { strLPad } from '../../utils/util';
4
 import { strLPad } from '../../utils/util';
5
+import { LinearGradient } from 'expo-linear-gradient';
5
 
6
 
6
 export default function DayList(props)
7
 export default function DayList(props)
7
 {
8
 {
22
         )
23
         )
23
         total += depense.value;
24
         total += depense.value;
24
     });
25
     });
25
-    
26
+    let scale = Math.min(1, total/props.dailyObjective)
27
+
26
 
28
 
27
     let result = props.dailyObjective - total 
29
     let result = props.dailyObjective - total 
28
     let text_color = "#000000";
30
     let text_color = "#000000";
36
 
38
 
37
     return (
39
     return (
38
         <View style={[day_list_styles.day_list_container, {backgroundColor: bg_color}, isCurrentday ? day_list_styles.current_day_container : null]}>
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
             <Pressable 
47
             <Pressable 
40
                 style={day_list_styles.day_list_entry}
48
                 style={day_list_styles.day_list_entry}
41
                 onPress={() => {onToggleDepenses(!showDepenses)}}>
49
                 onPress={() => {onToggleDepenses(!showDepenses)}}>
52
 const day_list_styles = StyleSheet.create({
60
 const day_list_styles = StyleSheet.create({
53
     day_list_container: {
61
     day_list_container: {
54
         // borderWidth: 1,
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
     current_day_container: {
69
     current_day_container: {
76
     day_list_day: {
85
     day_list_day: {
77
         fontWeight: '900',
86
         fontWeight: '900',
78
         margin: 4,
87
         margin: 4,
88
+    },
89
+    background: {
90
+        position: 'absolute',
91
+        width: '100%',
92
+        height: "100%",
79
     }
93
     }
80
 });
94
 });

Loading…
Cancel
Save