File tree 4 files changed +56
-2
lines changed
4 files changed +56
-2
lines changed Original file line number Diff line number Diff line change 1
1
import useGetBoard from '@/hooks/queries/useGetBoard' ;
2
2
import useGetCommentList from '@/hooks/queries/useGetCommentList' ;
3
3
import { BoardCardId } from './BoardCardPackage/BoardCardIdPackage' ;
4
+ import BoardIdLoading from '../Loading/BoardIdLoading' ;
4
5
5
6
export default function BoardIdCard ( { boardId } : { boardId : number } ) {
6
- const { data : board } = useGetBoard ( boardId ) ;
7
+ const { data : board , isLoading } = useGetBoard ( boardId ) ;
7
8
const { data : commentList , Observer } = useGetCommentList ( boardId ) ;
8
9
10
+ if ( isLoading ) return < BoardIdLoading /> ;
9
11
if ( board ) {
10
12
return (
11
13
< BoardCardId >
Original file line number Diff line number Diff line change 1
1
import { BoardCardModal } from '@/components/ui/BoardCard/BoardCardPackage/BoardCardModalPackage' ;
2
2
import useGetBoard from '@/hooks/queries/useGetBoard' ;
3
3
import useGetCommentList from '@/hooks/queries/useGetCommentList' ;
4
+ import ModalBoardLoading from '../Loading/ModalBoardLoading' ;
4
5
5
6
export default function ModalBoardCard ( { boardId } : { boardId : number } ) {
6
- const { data : board } = useGetBoard ( boardId ) ;
7
+ const { data : board , isLoading } = useGetBoard ( boardId ) ;
7
8
const { data : commentList , Observer } = useGetCommentList ( boardId ) ;
8
9
10
+ if ( isLoading ) return < ModalBoardLoading /> ;
9
11
if ( board ) {
10
12
return (
11
13
< BoardCardModal imgs = { board . fileNames } >
Original file line number Diff line number Diff line change
1
+ import { Divider , FlexBox , Skeleton } from '../ui' ;
2
+
3
+ export default function BoardIdLoading ( ) {
4
+ return (
5
+ < FlexBox
6
+ direction = "column"
7
+ justify = "between"
8
+ className = "w-full h-full gap-4 p-9"
9
+ >
10
+ < FlexBox justify = "start" className = "w-full gap-[10px]" >
11
+ < Skeleton className = "rounded-full w-14 h-14" />
12
+ < Skeleton className = "h-10 rounded-lg w-60" />
13
+ </ FlexBox >
14
+ < Divider type = "horizontal" />
15
+ < div className = "flex flex-row w-full h-full gap-9" >
16
+ < Skeleton className = "w-2/3 h-full rounded-lg" />
17
+ < div className = "flex flex-col w-1/3 gap-3" >
18
+ < Skeleton className = "w-full rounded-lg h-1/3" />
19
+ < Divider type = "horizontal" />
20
+ < Skeleton className = "w-full rounded-lg h-2/3" />
21
+ </ div >
22
+ </ div >
23
+ </ FlexBox >
24
+ ) ;
25
+ }
Original file line number Diff line number Diff line change
1
+ import { Divider , FlexBox , Skeleton } from '../ui' ;
2
+
3
+ export default function ModalBoardLoading ( ) {
4
+ return (
5
+ < FlexBox
6
+ direction = "column"
7
+ justify = "between"
8
+ className = "h-[500px] p-9 rounded-[10px] border-[1px] border-grey-200 gap-4"
9
+ >
10
+ < FlexBox justify = "start" className = "w-full gap-[10px]" >
11
+ < Skeleton className = "rounded-full w-14 h-14" />
12
+ < Skeleton className = "h-10 rounded-lg w-60" />
13
+ </ FlexBox >
14
+ < Divider type = "horizontal" />
15
+ < div className = "flex flex-row w-full h-full gap-9" >
16
+ < Skeleton className = "w-2/3 h-full rounded-lg" />
17
+ < div className = "flex flex-col w-1/3 gap-3" >
18
+ < Skeleton className = "w-full rounded-lg h-1/3" />
19
+ < Divider type = "horizontal" />
20
+ < Skeleton className = "w-full rounded-lg h-2/3" />
21
+ </ div >
22
+ </ div >
23
+ </ FlexBox >
24
+ ) ;
25
+ }
You can’t perform that action at this time.
0 commit comments