Browse Source

fixes here and there

master
Elias Sebbar 2 years ago
parent
commit
b4757c9b26
3 changed files with 10 additions and 10 deletions
  1. 5
    8
      components/list/day_list.js
  2. 2
    1
      components/list/week_list.js
  3. 3
    1
      components/title_bar.js

+ 5
- 8
components/list/day_list.js View File

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

+ 2
- 1
components/list/week_list.js View File

37
         <LinearGradient
37
         <LinearGradient
38
                     // Background Linear Gradient
38
                     // Background Linear Gradient
39
                     colors={[scale > 0 ? '#FFDDDDFF' : '#FFFFFF','#FFFFFF', '#FFFFFF']}
39
                     colors={[scale > 0 ? '#FFDDDDFF' : '#FFFFFF','#FFFFFF', '#FFFFFF']}
40
-                    locations={[scale, scale+0.05, 1]}
40
+                    locations={[scale, scale + (scale < 0.95 ? 0.05 : 0), 1]}
41
+                    start={{ x: 0, y: 0.0 }}
41
                     end={{x:1,y:0}}
42
                     end={{x:1,y:0}}
42
                     style={week_list_styles.background}
43
                     style={week_list_styles.background}
43
                 />   
44
                 />   

+ 3
- 1
components/title_bar.js View File

23
             }}>
23
             }}>
24
             <Text>Objectif</Text>
24
             <Text>Objectif</Text>
25
             <TextInput
25
             <TextInput
26
-                keyboardType="numeric"
26
+                keyboardType="number-pad"
27
+                enablesReturnKeyAutomatically={true}
28
+                returnKeyType="done"
27
                 value={(displayValue).toString()}
29
                 value={(displayValue).toString()}
28
                 style={title_bar_styles.input}
30
                 style={title_bar_styles.input}
29
                 onChangeText={(value) => onDurationEdit(value)}
31
                 onChangeText={(value) => onDurationEdit(value)}

Loading…
Cancel
Save