-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc: migrate some Skeleton to use the new API
- Loading branch information
Showing
8 changed files
with
74 additions
and
189 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,68 +1,31 @@ | ||
import styled from 'styled-components' | ||
|
||
import { NAV_HEIGHT, theme } from '~/styles' | ||
import { PropsWithChildren } from 'react' | ||
|
||
import { Skeleton } from './designSystem' | ||
|
||
const SkeletonDetailsPage = () => { | ||
return ( | ||
<div> | ||
<SkeletonHeader> | ||
<Skeleton variant="text" width={312} height={12} /> | ||
</SkeletonHeader> | ||
<SkeletonBody> | ||
<SkeletonBodyFirst> | ||
<Skeleton variant="text" width={80} height={12} /> | ||
<Skeleton variant="text" width={200} height={12} /> | ||
</SkeletonBodyFirst> | ||
<SkeletonBodySecond> | ||
<SkeletonBodyFirst> | ||
<Skeleton variant="text" width={80} height={12} /> | ||
<Skeleton variant="text" width={200} height={12} /> | ||
</SkeletonBodyFirst> | ||
<SkeletonBodyFirst> | ||
<Skeleton variant="text" width={80} height={12} /> | ||
<Skeleton variant="text" width={200} height={12} /> | ||
</SkeletonBodyFirst> | ||
</SkeletonBodySecond> | ||
</SkeletonBody> | ||
<div className="flex h-18 items-center"> | ||
<Skeleton className="w-78" variant="text" /> | ||
</div> | ||
<div className="grid grid-cols-2 gap-6"> | ||
{[0, 1, 2, 3].map((i) => ( | ||
<div className="flex flex-col gap-3 pb-3 pt-1" key={`skeleton-details-page-${i}`}> | ||
{i !== 1 && ( | ||
<> | ||
<Skeleton className="w-20" variant="text" /> | ||
<Skeleton className="w-50" variant="text" /> | ||
</> | ||
)} | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default SkeletonDetailsPage | ||
|
||
const SkeletonHeader = styled.div` | ||
height: ${NAV_HEIGHT}px; | ||
display: flex; | ||
align-items: center; | ||
` | ||
|
||
const SkeletonBody = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: ${theme.spacing(6)}; | ||
` | ||
|
||
const SkeletonBodyFirst = styled.div` | ||
width: 100%; | ||
padding: ${theme.spacing(1)} 0 ${theme.spacing(2)} 0; | ||
box-sizing: border-box; | ||
display: flex; | ||
flex-direction: column; | ||
gap: ${theme.spacing(3)}; | ||
` | ||
|
||
const SkeletonBodySecond = styled.div` | ||
width: 100%; | ||
padding: ${theme.spacing(1)} 0 ${theme.spacing(2)} 0; | ||
box-sizing: border-box; | ||
display: flex; | ||
gap: ${theme.spacing(4)}; | ||
` | ||
|
||
export const LoadingSkeletonWrapper = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: ${theme.spacing(12)}; | ||
` | ||
export const LoadingSkeletonWrapper = ({ children }: PropsWithChildren) => ( | ||
<div className="flex flex-col gap-12">{children}</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
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
Oops, something went wrong.