diff --git a/src/app/(root)/(routes)/cards/[cardId]/modify/loading.tsx b/src/app/(root)/(routes)/cards/[cardId]/modify/loading.tsx new file mode 100644 index 00000000..6c1e0885 --- /dev/null +++ b/src/app/(root)/(routes)/cards/[cardId]/modify/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)/cards/components/card-list-content/CardListContent.tsx b/src/app/(root)/(routes)/cards/components/card-list-content/CardListContent.tsx index f8429750..c79580b1 100644 --- a/src/app/(root)/(routes)/cards/components/card-list-content/CardListContent.tsx +++ b/src/app/(root)/(routes)/cards/components/card-list-content/CardListContent.tsx @@ -2,8 +2,8 @@ import { Suspense } from 'react' import { ErrorBoundary } from 'react-error-boundary' -import Loading from '@/app/loading' import DefaultErrorTemplate from '@/components/domain/errors/DefaultErrorTemplate' +import InfiniteScrollLoading from '@/components/domain/infinite-scroll-loading' import CardFilterSection from '../card-filter-section' import CardList from '../card-list/CardList' @@ -16,7 +16,7 @@ const CardListContent = () => { console.log('재시도')} /> } > - }> + }> diff --git a/src/app/(root)/(routes)/cards/my/components/my-card-list-content/MyCardListContent.tsx b/src/app/(root)/(routes)/cards/my/components/my-card-list-content/MyCardListContent.tsx index 63427186..2ac29773 100644 --- a/src/app/(root)/(routes)/cards/my/components/my-card-list-content/MyCardListContent.tsx +++ b/src/app/(root)/(routes)/cards/my/components/my-card-list-content/MyCardListContent.tsx @@ -2,8 +2,8 @@ import { Suspense, useState } from 'react' import { ErrorBoundary } from 'react-error-boundary' -import Loading from '@/app/loading' import DefaultErrorTemplate from '@/components/domain/errors/DefaultErrorTemplate' +import InfiniteScrollLoading from '@/components/domain/infinite-scroll-loading' import { TradeStatus } from '@/types/card' import MyCardList from '../my-card-list/MyCardList' import TradeStatusTabs from '../trade-status-tabs' @@ -22,7 +22,7 @@ const MyCardListContent = () => { console.log('재시도')} /> } > - }> + }> diff --git a/src/app/(root)/(routes)/chatrooms/[chatRoomId]/components/ChatList.tsx b/src/app/(root)/(routes)/chatrooms/[chatRoomId]/components/ChatList.tsx index c8f0ddb1..b05c5b28 100644 --- a/src/app/(root)/(routes)/chatrooms/[chatRoomId]/components/ChatList.tsx +++ b/src/app/(root)/(routes)/chatrooms/[chatRoomId]/components/ChatList.tsx @@ -26,9 +26,6 @@ const ChatList = forwardRef( /> ) })} - {messages.length === 0 && ( -

채팅을 시작해보세요!

- )}
) diff --git a/src/app/(root)/(routes)/chatrooms/[chatRoomId]/loading.tsx b/src/app/(root)/(routes)/chatrooms/[chatRoomId]/loading.tsx index 29a08a58..23a58db5 100644 --- a/src/app/(root)/(routes)/chatrooms/[chatRoomId]/loading.tsx +++ b/src/app/(root)/(routes)/chatrooms/[chatRoomId]/loading.tsx @@ -1,11 +1,11 @@ 'use client' import Lottie from 'react-lottie-player' -import lottieJson from '../../../../../../public/loading.json' +import lottieJson from '/public/loading.json' const Loading = () => { return ( -
+
{ + return ( +
+
+ +

잠시만 기다려 주세요.

+
+
+ ) +} + +export default Loading diff --git a/src/app/(root)/(routes)/notifications/components/notification-list-content/NotificationListContent.tsx b/src/app/(root)/(routes)/notifications/components/notification-list-content/NotificationListContent.tsx index 143ec869..307c8d93 100644 --- a/src/app/(root)/(routes)/notifications/components/notification-list-content/NotificationListContent.tsx +++ b/src/app/(root)/(routes)/notifications/components/notification-list-content/NotificationListContent.tsx @@ -2,8 +2,8 @@ import { Suspense, useState } from 'react' import { ErrorBoundary } from 'react-error-boundary' -import Loading from '@/app/loading' import DefaultErrorTemplate from '@/components/domain/errors/DefaultErrorTemplate' +import InfiniteScrollLoading from '@/components/domain/infinite-scroll-loading' import NotificationList from '../notification-list' import NotificationReadButton from '../notification-read-button' import NotificationStatusTabs from '../notification-status-tabs' @@ -21,7 +21,7 @@ const NotificationListContent = () => { console.log('재시도')} /> } > - }> + }> diff --git a/src/app/(root)/(routes)/suggestions/[myCardId]/components/my-suggestion-list-content/MySuggestionListContent.tsx b/src/app/(root)/(routes)/suggestions/[myCardId]/components/my-suggestion-list-content/MySuggestionListContent.tsx index 98f92bf4..cb22323d 100644 --- a/src/app/(root)/(routes)/suggestions/[myCardId]/components/my-suggestion-list-content/MySuggestionListContent.tsx +++ b/src/app/(root)/(routes)/suggestions/[myCardId]/components/my-suggestion-list-content/MySuggestionListContent.tsx @@ -2,8 +2,8 @@ import { Suspense, useState } from 'react' import { ErrorBoundary } from 'react-error-boundary' -import Loading from '@/app/loading' import DefaultErrorTemplate from '@/components/domain/errors/DefaultErrorTemplate' +import InfiniteScrollLoading from '@/components/domain/infinite-scroll-loading/InfiniteScrollLoading' import { DirectionType, SuggestionType } from '@/types/suggestion' import MySuggestionList from '../my-suggestion-list/MySuggestionList' import SuggestionStatusTabs from '../suggestion-status-tabs' @@ -25,7 +25,7 @@ const MySuggestionListContent = () => { console.log('재시도')} /> } > - }> + }> { + return ( +
+
+ +

잠시만 기다려 주세요.

+
+
+ ) +} + +export default Loading diff --git a/src/app/loading.tsx b/src/app/loading.tsx index f4196af2..e1c6e03b 100644 --- a/src/app/loading.tsx +++ b/src/app/loading.tsx @@ -1,12 +1,12 @@ 'use client' import Lottie from 'react-lottie-player' -import lottieJson from '../../public/loading.json' +import lottieJson from '/public/loading.json' const Loading = () => { return ( -
-
+
+
{ const onClickLogout = () => { Cookies.remove(Environment.tokenName()) + Cookies.remove(Environment.refreshTokenName()) apiClient.setDefaultHeader('Authorization', '') location.reload() } diff --git a/src/components/domain/header/sections/RightSide.tsx b/src/components/domain/header/sections/RightSide.tsx index f1e859b9..4980cb91 100644 --- a/src/components/domain/header/sections/RightSide.tsx +++ b/src/components/domain/header/sections/RightSide.tsx @@ -2,6 +2,7 @@ import React from 'react' import Link from 'next/link' +import { useRouter } from 'next/navigation' import Button from '@/components/ui/button' import AppPath from '@/config/appPath' import useNotificationCountQuery from '@/hooks/api/queries/useNotificationCountQuery' @@ -33,6 +34,7 @@ type RightSideProps = { const RightSide = ({ isLoggedIn, currentUser }: RightSideProps) => { const { data } = useNotificationCountQuery({ isLoggedIn }) + const router = useRouter() return isLoggedIn ? ( <> @@ -40,10 +42,13 @@ const RightSide = ({ isLoggedIn, currentUser }: RightSideProps) => { ) : ( - ) } diff --git a/src/components/domain/infinite-scroll-loading/InfiniteScrollLoading.tsx b/src/components/domain/infinite-scroll-loading/InfiniteScrollLoading.tsx new file mode 100644 index 00000000..448218a8 --- /dev/null +++ b/src/components/domain/infinite-scroll-loading/InfiniteScrollLoading.tsx @@ -0,0 +1,16 @@ +import Lottie from 'react-lottie-player' +import lottieJson from '/public/loading.json' + +const InfiniteScrollLoading = () => ( + +) + +export default InfiniteScrollLoading diff --git a/src/components/domain/infinite-scroll-loading/index.tsx b/src/components/domain/infinite-scroll-loading/index.tsx new file mode 100644 index 00000000..266a7994 --- /dev/null +++ b/src/components/domain/infinite-scroll-loading/index.tsx @@ -0,0 +1,3 @@ +import InfiniteScrollLoading from './InfiniteScrollLoading' + +export default InfiniteScrollLoading diff --git a/src/types/declaration.d.ts b/src/types/declaration.d.ts new file mode 100644 index 00000000..65686664 --- /dev/null +++ b/src/types/declaration.d.ts @@ -0,0 +1,4 @@ +declare module '*.json' { + const value: any + export default value +}