Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions src/containers/mydashboard/InvitedDashboardList/Skeleton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
export default function Skeleton() {
return (
<div className='flex animate-pulse flex-col'>
<div className='px-7'>
<div className='size-full h-[40px] rounded-md bg-gray-fa py-[8px] pl-12 pr-4' />
</div>
<div className='h-[calc(100%-130px)] pt-6 md:h-[calc(100%-170px)]'>
<div className='hidden h-[48px] grid-cols-9 pb-6 pl-7 md:grid md:pr-7'>
<div className='h-[24px] rounded-md bg-gray-fa' />
<div className='col-span-2' />
<div className='h-[24px] rounded-md bg-gray-fa' />
<div className='col-span-2' />
<div className='h-[24px] rounded-md bg-gray-fa' />
<div className='col-span-2' />
</div>

<div className='h-full overflow-y-hidden'>
<div className='hidden h-[48px] grid-cols-6 pb-6 pl-7 md:grid md:pr-7'>
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
</div>
<div className='hidden h-[48px] grid-cols-6 pb-6 pl-7 md:grid md:pr-7'>
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
</div>
<div className='hidden h-[48px] grid-cols-6 pb-6 pl-7 md:grid md:pr-7'>
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
</div>
<div className='hidden h-[48px] grid-cols-6 pb-6 pl-7 md:grid md:pr-7'>
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
</div>
<div className='hidden h-[48px] grid-cols-6 pb-6 pl-7 md:grid md:pr-7'>
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
<div className='h-[24px] rounded-md bg-gray-fa' />
<div />
</div>
</div>
</div>
</div>
);
}
36 changes: 5 additions & 31 deletions src/containers/mydashboard/InvitedDashboardList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useState, useEffect, useCallback, useRef } from 'react';

import InvitationItemList from './ItemList';
import SearchBar from './SearchBar';
import Skeleton from './Skeleton';

import useFetchData from '@/hooks/useFetchData';
import { getInvitationsList } from '@/services/getService';
Expand Down Expand Up @@ -101,48 +102,21 @@ export default function InvitedDashboardList() {

if (error) {
return (
<section className='max-h-[calc(100vh-610px)] min-h-[580px] grow overflow-hidden rounded-lg border-0 bg-white md:max-h-[calc(100vh-390px)]'>
<div className='h-full max-w-screen-lg overflow-hidden rounded-lg border-0 bg-white'>
<p className='px-7 pb-5 pt-8 text-base font-bold text-black-33'>μ΄ˆλŒ€λ°›μ€ λŒ€μ‹œλ³΄λ“œ</p>
<div className='flex items-center justify-center'>
<p>데이터λ₯Ό κ°€μ Έμ˜€λŠ” 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€.</p>
<p>{error.message}</p>
</div>
</section>
</div>
);
}

return (
<section className='h-dvh max-h-[calc(100vh-590px)] min-h-[400px] grow overflow-hidden rounded-lg border-0 bg-white md:max-h-[calc(100dvh-465px)] lg:max-h-[calc(100dvh-410px)]'>
<section className='h-full min-h-80 overflow-hidden rounded-lg border-0 bg-white'>
<p className='px-7 pb-5 pt-8 text-base font-bold text-black-33'>μ΄ˆλŒ€λ°›μ€ λŒ€μ‹œλ³΄λ“œ</p>
{isLoading ? (
<div className='flex animate-pulse flex-col'>
<div className='px-7'>
<div className='size-full h-[40px] rounded-md bg-gray-fa py-[8px] pl-12 pr-4' />
</div>
<div className='h-[calc(100%-130px)] pt-6 md:h-[calc(100%-170px)]'>
<div className='hidden h-[48px] grid-cols-9 pb-6 pl-7 md:grid md:pr-7'>
{[...Array(3)].map((_, i) => (
<>
<div key={i} className='h-[24px] rounded-md bg-gray-fa'></div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

였.. μ΄λž˜λ„ μ—λŸ¬κ°€ λ‚˜λŠ”κ΅°μš”.. [1,2,3].map((v) => ... key={v} ...) 해도 μ—λŸ¬ λ‚˜λ €λ‚˜μš”..?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

λ‹€ λ‹€λ₯Έ μ•ŒνŒŒλ²³μ„ μ€˜λ„ μ—λŸ¬κ°€ λ‚˜λŠ”κ±° κ°™λ”λΌκ΅¬μš”
μ•„λ§ˆ λ‹€ 1둜 μ‹œμž‘ν•΄μ„œ 그런게 μ•„λ‹Œκ°€ μ‹ΆκΈ΄ν•©λ‹ˆλ‹€
κ·Έλ ‡λ‹€κ³  숫자 λ”ν•˜κ±°λ‚˜ ν•˜λŠ”κ²Œ 더 보기 μ•ˆμ’‹μ„κ±° κ°™μ•„μ„œ λ•Œλ €λ°•μ•˜μŠ΅λ‹ˆλ‹€ πŸ₯²

<div key={i} className='h-[24px]'></div>
</>
))}
</div>

<div className='h-full overflow-y-hidden'>
{[...Array(5)].map((_, i) => (
<div key={i} className='hidden h-[48px] grid-cols-6 pb-6 pl-7 md:grid md:pr-7'>
{[...Array(3)].map((__, j) => (
<>
<div key={j} className='h-[24px] rounded-md bg-gray-fa'></div>
<div key={j} className='h-[24px]'></div>
</>
))}
</div>
))}
</div>
</div>
</div>
<Skeleton />
) : (
<>
{invitations.length > 0 || isSearching ? (
Expand Down