diff --git a/components/create/details.tsx b/components/create/details.tsx index 755ae5e..78364f7 100644 --- a/components/create/details.tsx +++ b/components/create/details.tsx @@ -1,6 +1,12 @@ import Tag from "@/components/global/tag"; import Beat from "@/components/global/beat"; -import { View, Text, TextInput, Pressable } from "react-native"; +import { + View, + Text, + TextInput, + Pressable, + ImageBackground, +} from "react-native"; import { useEffect, useState } from "react"; import { beat } from "@/types"; import { Image } from "expo-image"; @@ -10,6 +16,7 @@ import Icon from "../Icon"; import { useUser } from "@/hooks/useUser"; import { useDrops } from "@/hooks/useDrops"; import { router } from "expo-router"; +import { ScrollView } from "react-native-gesture-handler"; const colors = [ "bg-beatdrop-tag-orange", @@ -122,6 +129,12 @@ const Details = ({ setImages(allImages); }; + const handleRemoveImage = (selectedImage: ImagePicker.ImagePickerAsset) => { + const newImages = images.filter((image) => image.uri !== selectedImage.uri); + + setImages(newImages); + }; + return ( @@ -183,26 +196,34 @@ const Details = ({ ))} - + + - Upload image + + + Upload Photos + - - {images.map((image) => { - return ( - Selected Image - ); - })} + + {images.map((image) => ( + + handleRemoveImage(image)} + className="absolute top-1 right-1 rounded-full bg-black" + > + + + + ))} +