Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hyuna committed Aug 14, 2024
2 parents 83f8463 + 995d57f commit 45d8225
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions src/app/bugReport/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ const BugReport = () => {
});
};

const handleRemoveImage = (index: number) => {
setData((prevData) => ({
...prevData,
file_name: prevData.file_name.filter((_, i) => i !== index),
}));
};

return (
<TopBack
linkChildren="버그 제보"
Expand Down Expand Up @@ -130,12 +137,20 @@ const BugReport = () => {
) : (
<div className=" flex gap-1">
{data.file_name.map((item, index) => (
<img
key={index}
src={`${process.env.NEXT_PUBLIC_FILE_APP}${item}`}
width={200}
height={200}
/>
<div key={index} className="relative w-25 h-25 overflow-hidden">
<img
key={index}
src={`${process.env.NEXT_PUBLIC_FILE_APP}${item}`}
width={200}
height={200}
/>
<button
onClick={() => handleRemoveImage(index)}
className="absolute top-1 right-1 text-white bg-black bg-opacity-50 rounded-full px-2 py-1"
>
&times;
</button>
</div>
))}
<label
htmlFor="file-input"
Expand Down

0 comments on commit 45d8225

Please sign in to comment.