diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/Edit.jsx | 31 | ||||
-rw-r--r-- | components/List.jsx | 13 | ||||
-rw-r--r-- | components/Menu.jsx | 16 |
3 files changed, 26 insertions, 34 deletions
diff --git a/components/Edit.jsx b/components/Edit.jsx index d2ec6b3..3ca7b32 100644 --- a/components/Edit.jsx +++ b/components/Edit.jsx @@ -71,18 +71,18 @@ const Edit = ({ edit, setEdit, session, setSession, showError }) => { setEdit={setEdit} saveNote={edit._id ? saveNote : createNote} /> - { - content === undefined || saving - ? <Text style={styles.text}>{saving ? 'Saving...' : 'Loading...'}</Text> - : ( - <View style={styles.container}> - <TextInput - placeholder="Title" - placeholderTextColor="#BBB" - style={styles.title} - value={title} - onChange={e => setTitle(e.nativeEvent.text)} - /> + <View style={styles.container}> + <TextInput + placeholder="Title" + placeholderTextColor="#BBB" + style={styles.title} + value={title} + onChange={e => setTitle(e.nativeEvent.text)} + /> + { + content === undefined || saving + ? <Text style={styles.text}>{saving ? 'Saving...' : 'Loading content...'}</Text> + : ( <TextInput placeholder="Content" placeholderTextColor="#BBB" @@ -92,9 +92,9 @@ const Edit = ({ edit, setEdit, session, setSession, showError }) => { value={content} onChange={e => setContent(e.nativeEvent.text)} /> - </View> - ) - } + ) + } + </View> </> ) } @@ -119,7 +119,6 @@ const styles = StyleSheet.create({ paddingVertical: 10, }, text: { - padding: 15, color: 'white', } }); diff --git a/components/List.jsx b/components/List.jsx index 02a93a1..b7bdc07 100644 --- a/components/List.jsx +++ b/components/List.jsx @@ -104,19 +104,6 @@ const styles = StyleSheet.create({ color: 'white', padding: 20, }, - menu: { - backgroundColor: 'lightgrey', - height: 55, - width: '100%', - flexDirection: 'row', - alignItems: 'flex-end', - justifyContent: 'space-between', - padding: 10, - }, - menuText: { - fontWeight: 'bold', - paddingHorizontal: 10, - }, button: { width: 80, alignItems: 'center', diff --git a/components/Menu.jsx b/components/Menu.jsx index f6de610..fb82f34 100644 --- a/components/Menu.jsx +++ b/components/Menu.jsx @@ -1,5 +1,6 @@ -import { StyleSheet, Text, View } from 'react-native'; +import { StyleSheet, Text, View, Alert } from 'react-native'; import AsyncStorage from '@react-native-async-storage/async-storage'; +import { confirmLogout } from '../helpers' const Menu = ({ session, setSession, setEdit, showError, saveNote }) => { const logout = async () => { @@ -38,12 +39,16 @@ const Menu = ({ session, setSession, setEdit, showError, saveNote }) => { > New Note </Text> - <Text style={styles.menuText}>{session.email}</Text> <Text style={styles.menuText} - onPress={logout} > - Logout + Sort + </Text> + <Text + style={styles.menuText} + onPress={() => confirmLogout({ logout, email: session.email })} + > + {session.email} </Text> </> ) @@ -54,7 +59,7 @@ const Menu = ({ session, setSession, setEdit, showError, saveNote }) => { const styles = StyleSheet.create({ menu: { - backgroundColor: 'lightgrey', + backgroundColor: '#333', height: 60, width: '100%', flexDirection: 'row', @@ -65,6 +70,7 @@ const styles = StyleSheet.create({ menuText: { fontWeight: 'bold', paddingHorizontal: 15, + color: 'white', }, }); |