import { StyleSheet, Text, View } from 'react-native'; import AsyncStorage from '@react-native-async-storage/async-storage'; const Menu = ({ session, setSession, setEdit, showError, saveNote }) => { const logout = async () => { try { await AsyncStorage.clear(); setSession(null) } catch(e) { showError('Error while logging out') } } return ( { saveNote ? ( <> setEdit(null)} > Back Save ) : ( <> setEdit({})} > New Note {session.email} Logout ) } ) } const styles = StyleSheet.create({ menu: { backgroundColor: 'lightgrey', height: 60, width: '100%', flexDirection: 'row', alignItems: 'flex-end', justifyContent: 'space-between', padding: 10, }, menuText: { fontWeight: 'bold', paddingHorizontal: 15, }, }); export default Menu