Skip to content

Commit

Permalink
Merge pull request #148 from newnivers/feat/#147
Browse files Browse the repository at this point in the history
QA(domain/my-info): 마이페이지 QA 대응
  • Loading branch information
choi2601 authored Feb 5, 2024
2 parents 59a0fc7 + c03b1ca commit e03aeea
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
18 changes: 17 additions & 1 deletion app/my-info/QR/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,23 @@ function QRPage() {
<Typography typo="subhead01">티켓 인증</Typography>

<SpacerSkleton type="vertical" align="center" gap={30}>
<Image src={ticketInfo.qrCode} width={200} height={200} alt="qr-code" />
{ticketInfo?.qrCode ? (
<Image
src={ticketInfo.qrCode}
width={200}
height={200}
alt="qr-code"
/>
) : (
<SpacerSkleton type="vertical">
<Typography typo="subhead02">
QR은 작품 2시간 전 생성됩니다.
</Typography>
<Typography typo="subhead03">
QR로 관객확인 및 입장이 가능합니다.
</Typography>
</SpacerSkleton>
)}
<SpacerSkleton gap={10}>
<SpacerSkleton
type="vertical"
Expand Down
7 changes: 5 additions & 2 deletions app/my-info/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { useEffect, useState } from "react";
import Link from "next/link";
import { useSearchParams } from "next/navigation";
import dayjs from "dayjs";
import styled, { css } from "styled-components";
import httpClient from "@/api/core";
import { SpacerSkleton } from "@/components/common/spacer";
Expand All @@ -11,8 +12,6 @@ import {
Account,
Cardboard,
ReviewCardboard,
purchaseList,
reviewList,
} from "@/components/domains/my-info";
import { AuthUserInfo } from "@/contexts";
import { useAuthUserStorage } from "@/hooks";
Expand All @@ -33,6 +32,7 @@ interface MyInfoItem {
place: string;
visitorCount: number;
description?: string;
startAt?: string;
}

function MyInfoPage() {
Expand Down Expand Up @@ -65,6 +65,7 @@ function MyInfoPage() {
if (!myInfo) {
return;
}
console.log(myInfo);

return (
<AuthUserInfo.Provider>
Expand Down Expand Up @@ -118,13 +119,15 @@ function MyInfoPage() {
image={value.artThumbnail}
title={value.artTitle}
visitor_count={value.visitorCount}
start_at={dayjs(value.startAt).format("YYYY.MM.DD")}
space={value.place}
/>
</CardboardList>
))
: myInfo.reviewList.map((value) => (
<CardboardList key={value.artTitle}>
<ReviewCardboard
reviewId={value.id}
price="무료"
image={value.artThumbnail}
title={value.artTitle}
Expand Down
2 changes: 2 additions & 0 deletions components/domains/my-info/cardboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ interface Props {
price?: string;
visitor_count: number;
space: string;
start_at: string;
}

const workInfos = {
price: "관람가격",
visitor_count: "관람인원",
space: "관람장소",
start_at: "관람일시",
} as const;

type Entries<T> = {
Expand Down
9 changes: 8 additions & 1 deletion components/domains/my-info/reviewCardboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { SpacerSkleton } from "@/components/common/spacer";
import Typography from "@/components/common/text/Typography";

interface Props {
reviewId: number;
image: string;
title: string;
start_at?: string;
Expand All @@ -26,7 +27,13 @@ type Entries<T> = {
[K in keyof T]: [K, T[K]];
}[keyof T][];

export function ReviewCardboard({ image, title, review, ...rest }: Props) {
export function ReviewCardboard({
reviewId,
image,
title,
review,
...rest
}: Props) {
const reviewTextRef = useRef<HTMLDivElement | null>(null);
const [isShow, setShow] = useState(false);

Expand Down

0 comments on commit e03aeea

Please sign in to comment.