-
Notifications
You must be signed in to change notification settings - Fork 2
[#143] 마이페이지 스켈레톤 UI 적용 #216
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
Changes from 7 commits
2680836
1e7bb19
e710860
fe2acb8
2e0331b
57201a0
5a4920a
5080b49
927c77a
8f80cd9
3f09197
0f1f333
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,69 @@ | ||
| import { cn } from "@/lib/utils"; | ||
| import Skeleton from "react-loading-skeleton"; | ||
| import "react-loading-skeleton/dist/skeleton.css"; | ||
| import Image from "next/image"; | ||
|
|
||
| const ReviewItemSkeleton = () => { | ||
| return ( | ||
| <div | ||
| className={cn( | ||
| "flex flex-col gap-[51px] border-b border-gray-300 py-[16px] pb-[28px] pt-[39px]", | ||
| "tablet:gap-[54px]", | ||
| "pc:gap-[50px] pc:py-[80px]" | ||
| )} | ||
| > | ||
| <div className="flex w-full flex-col items-start justify-center gap-8 px-[14px]"> | ||
| <div className="flex w-full flex-col items-center justify-center gap-[26px]"> | ||
|
||
| <div className="flex w-full flex-col items-start gap-5"> | ||
| {/*별점 컴포넌트 */} | ||
| <Skeleton width={200} height={20} /> | ||
| {/* 와인 정보 */} | ||
| <div | ||
| className={cn( | ||
| "flex w-full items-center gap-2", | ||
| "tablet:gap-4", | ||
| "pc:gap-[17px]" | ||
| )} | ||
| > | ||
| <div className="relative h-[80px] w-[60px]"> | ||
| <Image | ||
| src="/images/placeholder/img-wine.svg" | ||
| alt="wine placeholder" | ||
|
||
| fill | ||
| /> | ||
| </div> | ||
| <div> | ||
| <Skeleton width={300} height={20} style={{ marginBottom: 6 }} /> | ||
| <Skeleton width={100} height={16} /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div className="w-full"> | ||
| {/* FlavorIconList 컴포넌트 */} | ||
| <Skeleton width={600} height={20} style={{ marginBottom: 6 }} /> | ||
| </div> | ||
| {/* 리뷰 내용 */} | ||
| <div className="w-full"> | ||
| <Skeleton width="100%" height={20} style={{ marginBottom: 8 }} /> | ||
| <Skeleton width="85%" height={20} /> | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* WineTaste 컴포넌트 */} | ||
| <div | ||
| className={cn( | ||
| "flex w-full flex-col gap-3", | ||
| "tablet:grid tablet:grid-cols-2 tablet:gap-4", | ||
| "pc:grid pc:grid-cols-2 pc:gap-4" | ||
| )} | ||
| > | ||
| {Array.from({ length: 4 }).map((_, i) => ( | ||
| <Skeleton key={i} width="100%" height={16} /> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default ReviewItemSkeleton; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,17 +7,29 @@ import { buildTasteData } from "@/components/wine-taste"; | |
| import { ReviewItemType } from "../../_types/review-type"; | ||
| import { ReviewInfo, ReviewRating } from "."; | ||
| import FlavorIconList from "@/components/flavor-icon-list/flavor-icon-list"; | ||
| import ReviewItemSkeleton from "./review-item-skeleton"; | ||
|
|
||
| const ReviewItem = ({ review }: { review: ReviewItemType }) => { | ||
| const ReviewItem = ({ | ||
| review, | ||
| skeleton = false, | ||
| }: { | ||
| review?: ReviewItemType; | ||
| skeleton?: boolean; | ||
| }) => { | ||
| const [optionMenu, setOptionMenu] = useState(false); | ||
|
|
||
| if (skeleton) { | ||
| return <ReviewItemSkeleton />; | ||
| } | ||
|
|
||
| if (!review) return null; | ||
|
||
|
|
||
| const tastes = buildTasteData({ | ||
| lightBold: review.lightBold, | ||
| smoothTannic: review.smoothTannic, | ||
| drySweet: review.drySweet, | ||
| softAcidic: review.softAcidic, | ||
| }); | ||
|
|
||
| return ( | ||
| <div | ||
| className={cn( | ||
|
|
||
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.
별거 아니지만 모바일 -> 태블릿 -> 데스크탑 순서로 바꾸시면 연수님이 작성하신 다른 파일들과 동일해서 좋을 것 같아요!