diff --git a/src/app/(root)/(routes)/cards/[cardId]/components/description-section/DescriptionSection.tsx b/src/app/(root)/(routes)/cards/[cardId]/components/description-section/DescriptionSection.tsx
index 574ef132..e69f9a7c 100644
--- a/src/app/(root)/(routes)/cards/[cardId]/components/description-section/DescriptionSection.tsx
+++ b/src/app/(root)/(routes)/cards/[cardId]/components/description-section/DescriptionSection.tsx
@@ -1,11 +1,14 @@
import formatDistanceToNow from 'date-fns/formatDistanceToNow'
import koLocale from 'date-fns/locale/ko'
+import { useRouter } from 'next/navigation'
import Badge from '@/components/ui/badge'
+import AppPath from '@/config/appPath'
import { CATEGORY_OBJS, TRADE_STATUS_OBJS } from '@/constants/card'
import { useAuth } from '@/contexts/AuthProvider'
import { TYPOGRAPHY } from '@/styles/sizes'
import { CardDetail } from '@/types/card'
import { cn } from '@/utils'
+import { getQueryParams } from '@/utils/getQueryParams'
import { getValueByKey } from '@/utils/getValueByKey'
import Dibs from './Dibs'
import MoreButton from './MoreButton'
@@ -36,6 +39,7 @@ const DescriptionSection = ({
}: DescriptionSectionProps) => {
const { isLoggedIn } = useAuth()
const { currentUser } = useAuth()
+ const router = useRouter()
const isMyItem = currentUser?.userId === authorId
@@ -68,7 +72,14 @@ const DescriptionSection = ({
TYPOGRAPHY.description,
)}
>
- {getValueByKey(CATEGORY_OBJS, category)}
+
+ router.push(`${AppPath.cards()}?${getQueryParams({ category })}`)
+ }
+ >
+ {getValueByKey(CATEGORY_OBJS, category)}
+
{formatDistanceToNow(new Date(createdAt), {
diff --git a/src/app/(root)/(routes)/cards/[cardId]/components/trade-section/SuggestList.tsx b/src/app/(root)/(routes)/cards/[cardId]/components/trade-section/SuggestList.tsx
index 192b496b..9e1b5cfb 100644
--- a/src/app/(root)/(routes)/cards/[cardId]/components/trade-section/SuggestList.tsx
+++ b/src/app/(root)/(routes)/cards/[cardId]/components/trade-section/SuggestList.tsx
@@ -1,4 +1,6 @@
+import { Suspense } from 'react'
import { useRouter } from 'next/navigation'
+import Loading from '@/app/loading'
import SuggestCard from '@/components/domain/card/suggest-card'
import NoData from '@/components/domain/no-data'
import { Tabs, TabsTrigger, TabsList, TabsContent } from '@/components/ui/tabs'
@@ -51,19 +53,21 @@ const SuggestList = ({ pokeAvailable, toCardId }: SuggestListProps) => {
오퍼하기
찔러보기
- {['OFFER', 'POKE'].map((type) => (
-
- {!pokeAvailable && type === 'POKE' ? (
-
- ) : (
- filterData(type)
- )}
-
- ))}
+ }>
+ {['OFFER', 'POKE'].map((type) => (
+
+ {!pokeAvailable && type === 'POKE' ? (
+
+ ) : (
+ filterData(type)
+ )}
+
+ ))}
+
)
}
diff --git a/src/app/(root)/(routes)/chatrooms/[chatRoomId]/loading.tsx b/src/app/(root)/(routes)/chatrooms/[chatRoomId]/loading.tsx
new file mode 100644
index 00000000..29a08a58
--- /dev/null
+++ b/src/app/(root)/(routes)/chatrooms/[chatRoomId]/loading.tsx
@@ -0,0 +1,25 @@
+'use client'
+
+import Lottie from 'react-lottie-player'
+import lottieJson from '../../../../../../public/loading.json'
+
+const Loading = () => {
+ return (
+
+ )
+}
+
+export default Loading
diff --git a/src/app/(root)/(routes)/notifications/components/notification-card/NotificationCard.tsx b/src/app/(root)/(routes)/notifications/components/notification-card/NotificationCard.tsx
index 0ac4ead8..861d5411 100644
--- a/src/app/(root)/(routes)/notifications/components/notification-card/NotificationCard.tsx
+++ b/src/app/(root)/(routes)/notifications/components/notification-card/NotificationCard.tsx
@@ -14,9 +14,13 @@ const NotificationCard = ({
}: NotificationCardProps) => {
const router = useRouter()
const { mutate } = useNotificationUpdateMutation()
+ const isCompleteRequestNotification = content.includes('성사')
+
const handleReadNotification = async () => {
if (!read) {
mutate({ notificationId, cardId })
+ } else if (isCompleteRequestNotification) {
+ router.push(AppPath.chatRooms())
} else {
router.push(AppPath.mySuggestions(cardId))
}
diff --git a/src/app/loading.tsx b/src/app/loading.tsx
index 37426efe..a1c7446a 100644
--- a/src/app/loading.tsx
+++ b/src/app/loading.tsx
@@ -5,7 +5,7 @@ import lottieJson from '../../public/loading.json'
const Loading = () => {
return (
-
+
{
const { mutate } = useSuggestionCreateMutation(toCardId, fromCardId)
-
+ const router = useRouter()
const onClickSuggest = async (suggestionType: SuggestionType) => {
mutate({ suggestionType, fromCardId, toCardId })
}
@@ -44,12 +46,13 @@ const SuggestCard = ({
gap={'space'}
className="h-full"
>
-
+
router.push(AppPath.card(String(fromCardId)))}
/>
diff --git a/src/hooks/useDibs.ts b/src/hooks/useDibs.ts
index 3d0004eb..ab8c1e69 100644
--- a/src/hooks/useDibs.ts
+++ b/src/hooks/useDibs.ts
@@ -1,10 +1,15 @@
'use client'
-import { useState } from 'react'
+import { useEffect, useState } from 'react'
import { deleteCardDibs, postCardDibs } from '@/services/card/card'
import { toast } from './useToast'
const useDibs = (isMyDib: boolean, count: number) => {
+ useEffect(() => {
+ setIsDibsActive(isMyDib)
+ setDibsCount(count)
+ }, [count, isMyDib])
+
const [isDibsActive, setIsDibsActive] = useState(isMyDib)
const [dibsCount, setDibsCount] = useState(count)