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 /components/DrawerContent.js | |
| parent | 67b6f338cfe4da739d39dc6764d11efa00105d81 (diff) | |
| download | remarques-1cb36cd073252f4a185cd9775382da4c6861a8cb.tar.gz remarques-1cb36cd073252f4a185cd9775382da4c6861a8cb.tar.zst remarques-1cb36cd073252f4a185cd9775382da4c6861a8cb.zip | |
Working app
Diffstat (limited to 'components/DrawerContent.js')
| -rw-r--r-- | components/DrawerContent.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/components/DrawerContent.js b/components/DrawerContent.js new file mode 100644 index 0000000..41b67cb --- /dev/null +++ b/components/DrawerContent.js @@ -0,0 +1,43 @@ +import * as React from "react" +import { Image, Alert, StyleSheet } from 'react-native' +import { DrawerContentScrollView, DrawerItem } from '@react-navigation/drawer'; + +import icon from "../assets/pencil-circle.png" +import iIcon from "../assets/i.png" +import cIcon from "../assets/text-plus-icon.png" +import plusIcon from "../assets/plus.png" +import newIcon from "../assets/new-icon.png" + +export default function DrawerContent(props) { + window.navigation = props.navigation + return ( + <DrawerContentScrollView {...props}> + <Image source={icon} style={styles.topImg} /> + <DrawerItem + label="Notes list" + icon={() => <Image source={newIcon} style={styles.icon} />} + onPress={() => props.navigation.navigate("notesList")} + /> + <DrawerItem + label="Add note" + icon={() => <Image source={plusIcon} style={styles.icon} />} + onPress={() => props.navigation.navigate("addNote")} + /> + <DrawerItem + label="Add category" + icon={() => <Image source={cIcon} style={styles.icon} />} + onPress={() => props.navigation.navigate("addCategory")} + /> + <DrawerItem + label="Info" + icon={() => <Image source={iIcon} style={styles.icon} />} + onPress={() => Alert.alert("Alert", "Alerting from best note app, version 2.0")} + /> + </DrawerContentScrollView> + ); +} + +const styles = StyleSheet.create({ + topImg: { width: 100, height: 100, margin: 30, alignSelf: "center" }, + icon: { width: 30, height: 30 }, +}) |
