From 951dcd8cdf255ca9006148d267054684be05fc6a Mon Sep 17 00:00:00 2001 From: olexh Date: Wed, 6 Mar 2024 00:44:29 +0200 Subject: [PATCH] add removing blur by click --- .../_components/ui/collection-item.tsx | 41 ++++++++++++------- components/ui/label.tsx | 2 +- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/app/(pages)/collections/(collections)/_components/ui/collection-item.tsx b/app/(pages)/collections/(collections)/_components/ui/collection-item.tsx index 83ba9528..66ca014e 100644 --- a/app/(pages)/collections/(collections)/_components/ui/collection-item.tsx +++ b/app/(pages)/collections/(collections)/_components/ui/collection-item.tsx @@ -1,9 +1,12 @@ +'use client'; + import React from 'react'; import IconamoonCommentFill from '~icons/iconamoon/comment-fill'; import MaterialSymbolsGridViewRounded from '~icons/material-symbols/grid-view-rounded'; import MaterialSymbolsMoreHoriz from '~icons/material-symbols/more-horiz'; import Link from 'next/link'; +import { useRouter } from 'next/navigation'; import AnimeCard from '@/components/anime-card'; import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; @@ -17,6 +20,9 @@ interface Props { } const Component = ({ collection }: Props) => { + const router = useRouter(); + const [spoiler, setSpoiler] = React.useState(collection.spoiler); + return (
@@ -34,17 +40,25 @@ const Component = ({ collection }: Props) => {
-
)}
- {collection.collection.reverse().map((item, index) => ( + {[...collection.collection].reverse().map((item, index) => (