diff --git a/frontend/app/(app)/(tabs)/beer/add.js b/frontend/app/(app)/(tabs)/beer/add.js
index e124b03..1b64cc0 100644
--- a/frontend/app/(app)/(tabs)/beer/add.js
+++ b/frontend/app/(app)/(tabs)/beer/add.js
@@ -108,8 +108,12 @@ export default function BeerAdd() {
async function addBeer() {
// TODO: after the request - redirect to /beer/{new_beer_id}?; plus some modal about successful state
+
const data = new FormData();
- data.append("photos", dataURItoBlob(image.uri));
+ if (Platform.OS == "web") {
+ // TODO: On phone its imposibble to upload an image
+ data.append("photos", dataURItoBlob(image.uri));
+ }
data.append("brand", b_brand);
data.append("name", b_name);
data.append("degree", b_degree);
@@ -124,7 +128,9 @@ export default function BeerAdd() {
const res = await req.json();
if (res.code == 201 && res.data._id) {
- window.location.href = `/beer/${res.data._id}`;
+ // TODO: reditect using expo router
+ // window.location.href = `/beer/${res.data._id}`;
+ alert("Added");
} else {
alert(
"Beer was not added successfully. Please check your data and try again.",
@@ -198,9 +204,8 @@ export default function BeerAdd() {
) : (
false
)}
-
- {image && }
+ {image && }
diff --git a/frontend/app/(app)/(tabs)/beer/index.js b/frontend/app/(app)/(tabs)/beer/index.js
index 42092df..2977b1f 100644
--- a/frontend/app/(app)/(tabs)/beer/index.js
+++ b/frontend/app/(app)/(tabs)/beer/index.js
@@ -4,15 +4,17 @@ import {
FlatList,
Dimensions,
StatusBar,
+ Image,
} from "react-native";
import Text from "@components/Text";
import Button from "@components/Button";
import { colors } from "@components/style";
import { router } from "expo-router";
import { useEffect, useState } from "react";
-import { FlashList } from "@shopify/flash-list";
+// import { FlashList } from "@shopify/flash-list";
export default function Tab() {
+ const API_HOST = process.env.EXPO_PUBLIC_API_URL.replace("/api/v1", "");
const [data, setData] = useState([]);
useEffect(() => {
fetchData();
@@ -62,10 +64,33 @@ export default function Tab() {
keyExtractor={(item) => String(item._id)}
renderItem={({ item }) => (
- Name: {item.name}
- Brand: {item.brand}
- Degree: {item.degree}
- Packaging: {item.packaging}
+
+
+ Name: {item.name}
+ Brand: {item.brand}
+ Degree: {item.degree}
+ Packaging: {item.packaging}
+
+
+
)}
/>
@@ -92,4 +117,12 @@ export const styles = StyleSheet.create({
padding: 13,
marginBottom: "5%",
},
+ itemImg: {
+ height: 300,
+ resizeMode: "contain",
+ },
+ itemDesc: {
+ alignItems: "center",
+ paddingBottom: "2%",
+ },
});
diff --git a/frontend/app/(app)/(tabs)/review/add.js b/frontend/app/(app)/(tabs)/review/add.js
index f12643f..e65aadf 100644
--- a/frontend/app/(app)/(tabs)/review/add.js
+++ b/frontend/app/(app)/(tabs)/review/add.js
@@ -7,7 +7,6 @@ import * as ImagePicker from "expo-image-picker";
import DropDownPicker from "react-native-dropdown-picker";
const DropdownTheme = require("@components/DropdownTheme");
import { Platform } from "react-native";
-import RangeSlider, { Slider } from "react-native-range-slider-expo";
export default function reviewAdd() {
const [b_name, setBName] = useState("");