-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #257 from boostcampwm-2024/optimization/front-#254
[FE] 웹 최적화 & Suspense를 이용해 Skeleton UI 적용
- Loading branch information
Showing
37 changed files
with
781 additions
and
200 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
user-agent: * | ||
allow: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { FallbackProps } from 'react-error-boundary'; | ||
import logoPng from 'assets/logo.png'; | ||
import logoWebp from 'assets/logo.webp'; | ||
|
||
export default function GlobalErrorFallback({ error }: FallbackProps) { | ||
return ( | ||
<div className='flex flex-col items-center justify-center mt-40 text-gray-800'> | ||
<div className='flex items-center mb-6'> | ||
<picture> | ||
<source srcSet={logoWebp} type='image/webp' /> | ||
<img src={logoPng} alt='Logo' className='h-48' /> | ||
</picture> | ||
</div> | ||
<h1 className='mb-4 text-2xl font-bold'>오류가 발생했습니다!</h1> | ||
<p className='mb-6 text-lg text-center'> | ||
문제가 지속적으로 발생하면 관리자에게 문의해주세요. | ||
</p> | ||
<pre className='w-full max-w-lg p-4 mb-6 text-sm text-left bg-gray-200 rounded-md shadow-md'> | ||
{error.message} | ||
</pre> | ||
<div className='flex space-x-4'> | ||
<a | ||
href='/' | ||
className='px-6 py-2 font-medium text-white transition bg-blue-500 rounded-md shadow hover:bg-blue-600' | ||
> | ||
Home으로 돌아가기 | ||
</a> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
const AccountConditionSkeleton = () => { | ||
return ( | ||
<div className='flex flex-col gap-4 rounded-lg bg-white p-4'> | ||
<div className='flex items-center justify-between'> | ||
{/* 계좌 정보 타이틀 */} | ||
<div className='h-6 w-24 animate-pulse rounded bg-gray-200' /> | ||
{/* 날짜 정보 */} | ||
<div className='h-5 w-32 animate-pulse rounded bg-gray-200' /> | ||
</div> | ||
|
||
<div className='flex flex-col gap-2'> | ||
{/* 총자산, 수익률 등의 정보 */} | ||
<div className='flex items-center justify-between'> | ||
<div className='h-5 w-20 animate-pulse rounded bg-gray-200' /> | ||
<div className='h-7 w-32 animate-pulse rounded bg-gray-200' /> | ||
</div> | ||
<div className='flex items-center justify-between'> | ||
<div className='h-5 w-20 animate-pulse rounded bg-gray-200' /> | ||
<div className='h-7 w-32 animate-pulse rounded bg-gray-200' /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
const MyStocksListSkeleton = () => { | ||
return ( | ||
<div className='flex flex-col gap-2 rounded-lg bg-white p-4'> | ||
{/* 보유종목 타이틀 */} | ||
<div className='mb-2 h-6 w-24 animate-pulse rounded bg-gray-200' /> | ||
|
||
{/* 테이블 헤더 */} | ||
<div className='flex items-center justify-between border-b pb-2'> | ||
<div className='h-4 w-32 animate-pulse rounded bg-gray-200' /> | ||
<div className='h-4 w-20 animate-pulse rounded bg-gray-200' /> | ||
<div className='h-4 w-24 animate-pulse rounded bg-gray-200' /> | ||
</div> | ||
|
||
{/* 보유주식 리스트 */} | ||
{Array.from({ length: 5 }).map((_, index) => ( | ||
<div | ||
key={index} | ||
className='flex items-center justify-between border-b py-3' | ||
> | ||
<div className='h-5 w-40 animate-pulse rounded bg-gray-200' /> | ||
<div className='h-5 w-24 animate-pulse rounded bg-gray-200' /> | ||
<div className='h-5 w-28 animate-pulse rounded bg-gray-200' /> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
}; | ||
|
||
export const AccountSkeleton = () => { | ||
return ( | ||
<div className='flex min-h-[500px] flex-col gap-3'> | ||
<AccountConditionSkeleton /> | ||
<MyStocksListSkeleton /> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.