From 114ab257b268b7ec11d4f3e35378372f8abc08c2 Mon Sep 17 00:00:00 2001 From: Filip Rojek Date: Sun, 12 May 2024 19:43:29 +0200 Subject: [PATCH] Fix: changed dropdown menu to another package --- frontend/app/(app)/(tabs)/beer/add.js | 35 ++++++++++++++++----------- frontend/package-lock.json | 20 +++++++-------- frontend/package.json | 2 +- 3 files changed, 32 insertions(+), 25 deletions(-) diff --git a/frontend/app/(app)/(tabs)/beer/add.js b/frontend/app/(app)/(tabs)/beer/add.js index 2858ea2..cb38922 100644 --- a/frontend/app/(app)/(tabs)/beer/add.js +++ b/frontend/app/(app)/(tabs)/beer/add.js @@ -3,7 +3,7 @@ import { useState } from "react"; import Button from "@components/Button"; import { colors } from "@components/style"; import * as ImagePicker from "expo-image-picker"; -import { Picker } from "@react-native-picker/picker"; +import DropDownPicker from "react-native-dropdown-picker"; export default function BeerAdd() { const [b_name, setBName] = useState(""); @@ -13,6 +13,16 @@ export default function BeerAdd() { const [image, setImage] = useState(null); const [selectPackaging, setSelectedPackaging] = useState(); + const [open, setOpen] = useState(false); + const [value, setValue] = useState(null); + const [items, setItems] = useState([ + { label: "Can", value: "can" }, + { label: "Glass bottle", value: "glass" }, + { label: "Oddel barrel", value: "barrel" }, + { label: "Tank", value: "tank" }, + { label: "PET bottle", value: "PET" }, + ]); + ImagePicker.getCameraPermissionsAsync(); //check if the user has granted permission to access the camera const pickImage = async () => { const permissionResult = @@ -114,19 +124,16 @@ export default function BeerAdd() { onChangeText={(text) => setBPackaging(text)} placeholderTextColor="#aaaaaa" /> - - setSelectedPackaging(itemValue) - } - > - - - - - - - +