diff options
| author | Maksymilian Jopek <maks@jopek.eu> | 2023-03-28 17:18:05 +0200 |
|---|---|---|
| committer | Maksymilian Jopek <maks@jopek.eu> | 2023-03-28 17:36:09 +0200 |
| commit | 1cb36cd073252f4a185cd9775382da4c6861a8cb (patch) | |
| tree | 30d374fc87e0409364f03faa8f7c58eb2bf7b882 /App.js | |
| parent | 67b6f338cfe4da739d39dc6764d11efa00105d81 (diff) | |
| download | remarques-1cb36cd073252f4a185cd9775382da4c6861a8cb.tar.gz remarques-1cb36cd073252f4a185cd9775382da4c6861a8cb.tar.zst remarques-1cb36cd073252f4a185cd9775382da4c6861a8cb.zip | |
Working app
Diffstat (limited to 'App.js')
| -rw-r--r-- | App.js | 91 |
1 files changed, 75 insertions, 16 deletions
@@ -1,21 +1,80 @@ -import { StatusBar } from 'expo-status-bar'; -import React from 'react'; -import { StyleSheet, Text, View } from 'react-native'; +import 'react-native-gesture-handler'; +import * as React from 'react'; +import { Image, TouchableOpacity } from 'react-native' +import { NavigationContainer, } from '@react-navigation/native'; +import { createDrawerNavigator } from '@react-navigation/drawer'; +const Drawer = createDrawerNavigator(); -export default function App() { +import NotesList from "./components/NotesList" +import NoteView from "./components/NoteView" +import CategoryView from "./components/CategoryView" +import Options from "./components/Options" +import CustomDrawerContent from "./components/DrawerContent" + +import kIcon from "./assets/kebab.png" + +function App() { return ( - <View style={styles.container}> - <Text>Open up App.js to start working on your app!</Text> - <StatusBar style="auto" /> - </View> + <NavigationContainer> + <Drawer.Navigator drawerContent={props => <CustomDrawerContent {...props} />}> + <Drawer.Screen name="notesList" component={NotesList} options={{ + title: 'Notes list', + headerRight: () => <TouchableOpacity onPress={() => window.navigation.navigate("options")}><Image source={kIcon} style={{ width: 30, height: 30, marginRight: 10 }} /></TouchableOpacity>, + headerStyle: { + backgroundColor: '#ff0000', + }, + headerTintColor: '#ffffff', + headerTitleStyle: { + fontWeight: 'bold', + }, + }} /> + <Drawer.Screen name="addNote" component={NoteView} options={{ + title: 'Add note', + headerStyle: { + backgroundColor: '#0000FF', + }, + headerTintColor: '#ffffff', + headerTitleStyle: { + fontWeight: 'bold', + }, + + }} /> + <Drawer.Screen name="editNote" component={NoteView} options={{ + title: 'Edit note', + headerStyle: { + backgroundColor: 'darkgreen', + }, + headerTintColor: '#ffffff', + headerTitleStyle: { + fontWeight: 'bold', + }, + + }} /> + <Drawer.Screen name="addCategory" component={CategoryView} options={{ + title: 'Add category', + headerStyle: { + backgroundColor: 'darkorange', + }, + headerTintColor: '#ffffff', + headerTitleStyle: { + fontWeight: 'bold', + }, + + }} /> + <Drawer.Screen name="options" component={Options} options={{ + title: 'Note list options', + headerStyle: { + backgroundColor: 'pink', + }, + headerTintColor: '#ffffff', + headerTitleStyle: { + fontWeight: 'bold', + }, + + }} /> + </Drawer.Navigator> + </NavigationContainer> ); } -const styles = StyleSheet.create({ - container: { - flex: 1, - backgroundColor: '#fff', - alignItems: 'center', - justifyContent: 'center', - }, -}); +export default App; |
