Skip to content

Commit

Permalink
run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
vraimondi04 committed Aug 26, 2024
1 parent e7722ee commit 7880243
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions components/create/details.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import Tag from "@/components/global/tag";
import Beat from "@/components/global/beat";
import { View, Text, TextInput, Pressable, ImageBackground } 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";

Check warning on line 12 in components/create/details.tsx

View workflow job for this annotation

GitHub Actions / linting

'Image' is defined but never used
Expand Down Expand Up @@ -88,11 +94,15 @@ const Details = ({
setImages(allImages);
};

const handleRemoveImage = async (selectedImage: ImagePicker.ImagePickerAsset) => {
const newImages = images.filter(function(image, index) { return image.uri !== selectedImage.uri });
const handleRemoveImage = async (
selectedImage: ImagePicker.ImagePickerAsset,
) => {
const newImages = images.filter(function (image, index) {
return image.uri !== selectedImage.uri;
});

setImages(newImages);
}
};

return (
<View className="w-full">
Expand Down Expand Up @@ -173,12 +183,20 @@ const Details = ({
<ImageBackground
key={image.uri}
source={{ uri: image.uri }}
style={{ width: 140, height: 140, borderRadius: 8, overflow: "hidden" }}
style={{
width: 140,
height: 140,
borderRadius: 8,
overflow: "hidden",
}}
alt="Selected Image"
>
<Pressable onPress={() => handleRemoveImage(image)} className="absolute top-1 right-1 rounded-full bg-black">
<Icon size={28} name="Close_SM" color={'#EFEFEF'}></Icon>
</Pressable>
<Pressable
onPress={() => handleRemoveImage(image)}
className="absolute top-1 right-1 rounded-full bg-black"
>
<Icon size={28} name="Close_SM" color={"#EFEFEF"}></Icon>
</Pressable>
</ImageBackground>
</View>
);
Expand Down

0 comments on commit 7880243

Please sign in to comment.