From 2d06e0fb12b3f7634cb5868a0a288640f67136cd Mon Sep 17 00:00:00 2001 From: KeviNmp4 Date: Sun, 12 May 2024 21:26:44 +0200 Subject: [PATCH] Added: custom style for DropDownPicker, added icons for DropDownPicker, in style.js added new color for placeholder; Edited: Component for button, where you can now define background, border, ... by class --- frontend/app/(app)/(tabs)/beer/add.js | 57 +++++-- frontend/assets/DropdownIcons/arrow-down.png | Bin 0 -> 522 bytes frontend/assets/DropdownIcons/arrow-up.png | Bin 0 -> 807 bytes frontend/assets/DropdownIcons/close.png | Bin 0 -> 338 bytes frontend/assets/DropdownIcons/tick.png | Bin 0 -> 1214 bytes frontend/components/Button.js | 7 +- frontend/components/DropdownTheme.js | 170 +++++++++++++++++++ frontend/components/style.js | 1 + 8 files changed, 221 insertions(+), 14 deletions(-) create mode 100644 frontend/assets/DropdownIcons/arrow-down.png create mode 100644 frontend/assets/DropdownIcons/arrow-up.png create mode 100644 frontend/assets/DropdownIcons/close.png create mode 100644 frontend/assets/DropdownIcons/tick.png create mode 100644 frontend/components/DropdownTheme.js diff --git a/frontend/app/(app)/(tabs)/beer/add.js b/frontend/app/(app)/(tabs)/beer/add.js index cb38922..0bdb726 100644 --- a/frontend/app/(app)/(tabs)/beer/add.js +++ b/frontend/app/(app)/(tabs)/beer/add.js @@ -1,9 +1,12 @@ import { StyleSheet, TextInput, View, Image } from "react-native"; import { useState } from "react"; import Button from "@components/Button"; +import Text from "@components/Text"; import { colors } from "@components/style"; import * as ImagePicker from "expo-image-picker"; import DropDownPicker from "react-native-dropdown-picker"; +/* import DropdownTheme from "@components/DropdownTheme"; */ +const DropdownTheme = require("@components/DropdownTheme"); export default function BeerAdd() { const [b_name, setBName] = useState(""); @@ -16,13 +19,16 @@ export default function BeerAdd() { const [open, setOpen] = useState(false); const [value, setValue] = useState(null); const [items, setItems] = useState([ - { label: "Can", value: "can" }, + { label: "Tank beer", value: "tank" }, + { label: "Cask beer", value: "cask" }, { label: "Glass bottle", value: "glass" }, - { label: "Oddel barrel", value: "barrel" }, - { label: "Tank", value: "tank" }, - { label: "PET bottle", value: "PET" }, + { label: "Can", value: "can" }, + { label: "PET bottle", value: "pet" }, ]); + DropDownPicker.addTheme("DropdownTheme", DropdownTheme); + DropDownPicker.setTheme("DropdownTheme"); + ImagePicker.getCameraPermissionsAsync(); //check if the user has granted permission to access the camera const pickImage = async () => { const permissionResult = @@ -96,6 +102,9 @@ export default function BeerAdd() { return ( + + Spill your thoughts about the beer you just sipped! +