Refactor: 페이지 리팩토링
This commit is contained in:
parent
3d16081a6d
commit
04cb52e79c
@ -1,4 +1,4 @@
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
import { Suspense, useState, useEffect, useRef } from 'react';
|
||||
import { useParams, Link } from 'react-router-dom';
|
||||
import useReviewByStatusQuery from '@/queries/reviews/useReviewByStatusQuery';
|
||||
import useAuthStore from '@/stores/useAuthStore';
|
||||
@ -49,8 +49,9 @@ export default function ProjectReviewList() {
|
||||
}, [hasNextPage, isFetchingNextPage, fetchNextPage]);
|
||||
|
||||
return (
|
||||
<Suspense fallback={<div></div>}>
|
||||
<div>
|
||||
<header className="bg-background sticky top-0 z-10 flex h-[57px] items-center gap-1 border-b px-4">
|
||||
<header className="sticky top-0 z-10 flex h-[57px] items-center gap-1 border-b bg-white px-4">
|
||||
<h1 className="text-xl font-semibold">프로젝트 리뷰</h1>
|
||||
<Link
|
||||
to={`/admin/${workspaceId}/reviews/request`}
|
||||
@ -70,12 +71,13 @@ export default function ProjectReviewList() {
|
||||
workspaceId={Number(workspaceId)}
|
||||
/>
|
||||
|
||||
{isFetchingNextPage && <div className="py-4 text-center">로딩 중...</div>}
|
||||
{isFetchingNextPage}
|
||||
|
||||
<div
|
||||
ref={loadMoreRef}
|
||||
className="h-1"
|
||||
/>
|
||||
</div>
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import useWorkspaceReviewsQuery from '@/queries/workspaces/useWorkspaceReviewsQu
|
||||
import useAuthStore from '@/stores/useAuthStore';
|
||||
import ReviewList from '@/components/ReviewList';
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
||||
import { Suspense } from 'react';
|
||||
export default function WorkspaceReviewList() {
|
||||
const { workspaceId } = useParams<{ workspaceId: string }>();
|
||||
const profile = useAuthStore((state) => state.profile);
|
||||
@ -49,8 +49,9 @@ export default function WorkspaceReviewList() {
|
||||
}, [hasNextPage, isFetchingNextPage, fetchNextPage]);
|
||||
|
||||
return (
|
||||
<Suspense fallback={<div></div>}>
|
||||
<div>
|
||||
<header className="bg-background sticky top-0 z-10 flex h-[57px] items-center gap-1 border-b px-4">
|
||||
<header className="sticky top-0 z-10 flex h-[57px] items-center gap-1 border-b bg-white px-4">
|
||||
<h1 className="text-xl font-semibold">워크스페이스 리뷰</h1>
|
||||
<Link
|
||||
to={`/admin/${workspaceId}/reviews/request`}
|
||||
@ -70,12 +71,13 @@ export default function WorkspaceReviewList() {
|
||||
workspaceId={Number(workspaceId)}
|
||||
/>
|
||||
|
||||
{isFetchingNextPage && <div className="py-4 text-center">로딩 중...</div>}
|
||||
{isFetchingNextPage}
|
||||
|
||||
<div
|
||||
ref={loadMoreRef}
|
||||
className="h-1"
|
||||
/>
|
||||
</div>
|
||||
</Suspense>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user