-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] - 메인페이지 skeleton 작업 #221
Changes from all commits
cf0b4f4
dc3f5a3
1445119
dde39b3
4039e35
5f410d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
|
||
import TravelogueCardSkeleton from "./TravelogueCardSkeleton"; | ||
|
||
const meta = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 스토리북 까지 👍👍 |
||
title: "skeleton/TravelogueCardSkeleton", | ||
component: TravelogueCardSkeleton, | ||
decorators: [ | ||
(Story, context) => { | ||
return ( | ||
<div style={{ width: "48rem" }}> | ||
<Story args={{ ...context.args }} /> | ||
</div> | ||
); | ||
}, | ||
], | ||
} satisfies Meta<typeof TravelogueCardSkeleton>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = {}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { keyframes } from "@emotion/react"; | ||
import styled from "@emotion/styled"; | ||
|
||
const skeletonAnimation = keyframes` | ||
0% { | ||
background-position: -100% 0; | ||
} | ||
100% { | ||
background-position: 100% 0; | ||
} | ||
`; | ||
|
||
const SkeletonBase = styled.div` | ||
background-color: ${(props) => props.theme.colors.skeleton.base}; | ||
background-image: linear-gradient( | ||
90deg, | ||
${(props) => props.theme.colors.skeleton.base} 6rem, | ||
${(props) => props.theme.colors.skeleton.highlight} 12rem, | ||
${(props) => props.theme.colors.skeleton.base} 18rem | ||
); | ||
background-size: 200% 200%; | ||
background-repeat: no-repeat; | ||
|
||
animation: ${skeletonAnimation} 1.2s ease-in-out infinite; | ||
`; | ||
Comment on lines
+14
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 해당 부분이 스켈레톤의 핵심으로 보여지는데 이해하는데 좀 걸렸네요! 스켈레톤은 처음이였는데 학습해볼 수 있었습니다 |
||
|
||
export const Layout = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: ${(props) => props.theme.spacing.m}; | ||
`; | ||
|
||
export const ThumbnailCard = styled(SkeletonBase)` | ||
width: 100%; | ||
height: 25rem; | ||
border-radius: 10px; | ||
`; | ||
|
||
export const BottomBarContainer = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
width: 100%; | ||
padding: 0 ${(props) => props.theme.spacing.m}; | ||
`; | ||
|
||
export const TitleContainer = styled.div` | ||
display: flex; | ||
gap: ${(props) => props.theme.spacing.s}; | ||
`; | ||
|
||
export const ProfileSkeleton = styled(SkeletonBase)` | ||
width: 2.2rem; | ||
height: 2.2rem; | ||
border-radius: 50%; | ||
`; | ||
|
||
export const TitleSkeleton = styled(SkeletonBase)` | ||
width: 13rem; | ||
height: 2.2rem; | ||
border-radius: 10px; | ||
`; | ||
|
||
export const LikesSkeleton = styled(SkeletonBase)` | ||
width: 5rem; | ||
height: 2.2rem; | ||
border-radius: 10px; | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import * as S from "./TravelogueCardSkeleton.styled"; | ||
|
||
const TravelogueCardSkeleton = () => { | ||
return ( | ||
<S.Layout> | ||
<S.ThumbnailCard /> | ||
|
||
<S.BottomBarContainer> | ||
<S.TitleContainer> | ||
<S.ProfileSkeleton /> | ||
<S.TitleSkeleton /> | ||
</S.TitleContainer> | ||
|
||
<S.LikesSkeleton /> | ||
</S.BottomBarContainer> | ||
</S.Layout> | ||
); | ||
}; | ||
|
||
export default TravelogueCardSkeleton; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,8 @@ export const SEMANTIC_COLORS = { | |
danger: "#ea0000", | ||
kakao: "#f9e007", | ||
dimmed: "#0000004d", | ||
skeleton: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. token 추가 감사합니다 :) |
||
base: PRIMITIVE_COLORS.gray[200], | ||
highlight: PRIMITIVE_COLORS.gray[100], | ||
}, | ||
} as const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
리버 덕분에 로딩 상황에서 스켈레톤 ui를 잘볼 수 있겠네요 👍🥰