Browse Source

using safe area view seems safer on ios

master
Elias Sebbar 2 years ago
parent
commit
882ae41276
3 changed files with 9898 additions and 17 deletions
  1. 3
    2
      App.js
  2. 3
    2
      components/add_depense.js
  3. 9892
    13
      package-lock.json

+ 3
- 2
App.js View File

1
 import { StatusBar } from 'expo-status-bar';
1
 import { StatusBar } from 'expo-status-bar';
2
 import React, { useEffect } from 'react';
2
 import React, { useEffect } from 'react';
3
 import { StyleSheet, Text, View, TextInput } from 'react-native';
3
 import { StyleSheet, Text, View, TextInput } from 'react-native';
4
+import { SafeAreaView } from 'react-native-safe-area-context';
4
 import AddDepense from './components/add_depense';
5
 import AddDepense from './components/add_depense';
5
 import DepensesList from './components/depenses_list';
6
 import DepensesList from './components/depenses_list';
6
 import TitleBar from './components/title_bar';
7
 import TitleBar from './components/title_bar';
31
   });
32
   });
32
 
33
 
33
   return (
34
   return (
34
-    <View style={styles.home}>
35
+    <SafeAreaView style={styles.home}>
35
       <View style={styles.container, {
36
       <View style={styles.container, {
36
         flexDirection: "column"
37
         flexDirection: "column"
37
       }}>
38
       }}>
49
       </View>
50
       </View>
50
         {/* Overlay for expenses */}
51
         {/* Overlay for expenses */}
51
       <AddDepense fetchDepenses={() => onFetchDepenses(true)}/>
52
       <AddDepense fetchDepenses={() => onFetchDepenses(true)}/>
52
-    </View>
53
+    </SafeAreaView>
53
   );
54
   );
54
 }
55
 }
55
 
56
 

+ 3
- 2
components/add_depense.js View File

1
 import React from 'react';
1
 import React from 'react';
2
 import { StyleSheet, Text, View, TextInput, Button, Pressable } from 'react-native';
2
 import { StyleSheet, Text, View, TextInput, Button, Pressable } from 'react-native';
3
+import { SafeAreaView } from 'react-native-safe-area-context';
3
 import DepenseForm from './depense_edit/depense_form';
4
 import DepenseForm from './depense_edit/depense_form';
4
 
5
 
5
 
6
 
6
 export default function AddDepense(props){
7
 export default function AddDepense(props){
7
     const [addingDepense, onAddDepense] = React.useState(false);
8
     const [addingDepense, onAddDepense] = React.useState(false);
8
 
9
 
9
-    return (<View style={ add_depenses_styles.overlay }>
10
+    return (<SafeAreaView style={ add_depenses_styles.overlay }>
10
     <View >
11
     <View >
11
         {addingDepense ? 
12
         {addingDepense ? 
12
             <DepenseForm fetchDepenses={props.fetchDepenses} onAddDepense={onAddDepense}/>
13
             <DepenseForm fetchDepenses={props.fetchDepenses} onAddDepense={onAddDepense}/>
21
         
22
         
22
         </Pressable>
23
         </Pressable>
23
     </View>
24
     </View>
24
-    </View>
25
+    </SafeAreaView>
25
     );
26
     );
26
 }
27
 }
27
 
28
 

+ 9892
- 13
package-lock.json
File diff suppressed because it is too large
View File


Loading…
Cancel
Save