Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed apps/nowait-user/src/assets/waitSuccess.png
Binary file not shown.
Binary file added apps/nowait-user/src/assets/waitingSuccess.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions apps/nowait-user/src/components/common/QuantitySelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ interface stateProps {
mode: "state";
quantity: number;
setQuantity: React.Dispatch<React.SetStateAction<number>>;
min?: number;
max?: number;
}

interface storeProps {
Expand All @@ -16,13 +18,18 @@ interface storeProps {
price: number;
increaseQuantity: (id: number, price: number) => void;
decreaseQuantity: (id: number, price: number) => void;
min?: number;
max?: number;
}

type PropsType = stateProps | storeProps;

const QuantitySelector = (props: PropsType) => {
const isQuantityMin = props.quantity === 1;
const isQuantityMax = props.quantity === 99;
// min과 max를 props로 받고 기본값은 1,99
const min = props.min ?? 1;
const max = props.max ?? 99;
const isQuantityMin = props.quantity <= min;
const isQuantityMax = props.quantity >= max;

const increaseQuantityButton = () => {
// 전체 주문 페이지에서 수량 컨트롤(로컬 스토리지에 바로 반영)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import CenteredContentLayout from "../layout/CenteredContentLayout";
interface PropsType {
imageSrc: string;
imageAlt: string;
width?: string;
height?: string;
title: string;
message: string;
onClick: () => void;
Expand All @@ -14,6 +16,8 @@ interface PropsType {
const SuccessMessagePage = ({
imageSrc,
imageAlt,
width = "150px",
height = "150px",
title,
message,
onClick,
Expand All @@ -23,7 +27,7 @@ const SuccessMessagePage = ({
const { storeId } = useParams();
return (
<CenteredContentLayout onClick={onClick} buttonText={buttonText}>
<img src={imageSrc} alt={imageAlt} width="150px" height="150px" />
<img src={imageSrc} alt={imageAlt} width={width} height={height} />
<h1 className="text-headline-24-bold mb-2">{title}</h1>
<h2 className="whitespace-pre-line text-16-regular text-black-70 mb-3.5">
{message}
Expand Down
2 changes: 1 addition & 1 deletion apps/nowait-user/src/pages/order/home/StorePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const StorePage = () => {
</div>
</div>
{cart && cart.length > 0 && (
<PageFooterButton>
<PageFooterButton background="gradient">
<Button
textColor="white"
onClick={() => navigate(`/${storeId}/order`)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const OrderDetailsPage = () => {
return (
<div>
<BackOnlyHeader />
<div className="bg-black-15 min-h-screen py-[30px] px-5">
<div className="bg-black-15 min-h-screen py-[64px] px-5">
<h1 className="text-headline-22-bold mb-[23px] text-black-90">
주문내역 <span className="text-primary">{data.length}건</span>
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const OrderListPage = () => {
</AnimatePresence>
</motion.ul>
</section>
<PageFooterButton>
<PageFooterButton background="gradient">
<Button
textColor="white"
onClick={() => navigate(`/${storeId}/remittance`)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const RemittancePage = () => {
const { storeId } = useParams();
const modal = useModal();
const { cart } = useCartStore();
const [payer, setPayer] = useState("");
const [payer, setPayer] = useState<string>("");
const [errorMessage, setErrorMessage] = useState<string | null>("");
const [remitValue, setRemitValue] = useState("");
const totalPrice = sumTotalPrice(cart);
Expand All @@ -33,7 +33,7 @@ const RemittancePage = () => {
enabled: !!storeId,
select: (data) => data?.response,
});
console.log(remittance)
console.log(remittance);
// 기본 선택 값 지정하기
useEffect(() => {
if (!remittance) return;
Expand Down Expand Up @@ -93,7 +93,7 @@ const RemittancePage = () => {
</div>
</section>
</section>
<PageFooterButton>
<PageFooterButton background="gradient">
<Button textColor="white" onClick={orderHandleButton}>
<TotalButton variant="orderPage" actionText="이체하기" />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import LoadingSpinner from "../../../components/LoadingSpinner";
const RemittanceWaitPage = () => {
const navigate = useNavigate();
const location = useLocation();
const payer = location.state;
const payer = location.state as string;
const { storeId } = useParams();
const tableId = localStorage.getItem("tableId");
const { cart, clearCart } = useCartStore();
Expand All @@ -34,26 +34,33 @@ const RemittanceWaitPage = () => {
Number(tableId!),
payload
);
console.log(res, "주문 생성");
if (res?.success) {
//세션 아이디, 입금자명 로컬스토리지 저장
//입금자명 로컬스토리지 저장
localStorage.setItem("depositorName", res.response.depositorName);
//장바구니 비우기
clearCart();
navigate(`/${storeId}/order/success`);
} else {
// 서버가 success:false 반환한 경우
console.error("주문 실패:", res);
alert("주문 처리에 실패했습니다. 다시 시도해주세요.");
}
//장바구니 비우기
clearCart();
} catch (error) {
console.log(error);
} finally {
setIsLoading(true);
}
navigate(`/${storeId}/order/success`);
};

return (
<>
<BackOnlyHeader />
<CenteredContentLayout
onClick={orderButton}
buttonText={isLoading ? <LoadingSpinner loadingType="dotsWhite"/> : "이체했어요"}
buttonText={
isLoading ? <LoadingSpinner loadingType="dotsWhite" /> : "이체했어요"
}
>
<img
src={remittanceWait}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const WaitingSummaryPage = () => {
if (isLoading) return <FullPageLoader />;

return (
<div className="flex flex-col min-h-screen">
<div className="flex flex-col min-h-dvh">
<BackOnlyHeader />
<div className="flex flex-col flex-1">
<div className="px-5 mt-[74px]">
Expand All @@ -51,11 +51,18 @@ const WaitingSummaryPage = () => {
대기하고 있어요
</h1>
<div className="p-5.5 rounded-[16px] bg-black-10 mb-[30px]">
<div className="flex justify-between items-center mb-2.5">
<div className="flex justify-between items-start mb-2.5 ">
<p className="text-16-semibold text-black-50">부스</p>
<p className="text-16-medium text-black-90">
{store?.name} / {store?.departmentName}
</p>
<div className="max-w-[205px] text-16-medium text-black-90 text-right break-keep">
<p className="inline">{store?.name} / </p>
<span
className={`${
store!.departmentName.length > 14 ? "block" : "inline"
} w-[100%] truncate`}
>
{store?.departmentName}
</span>
</div>
</div>
<div className="flex justify-between items-center">
<p className="text-16-semibold text-black-50">입장 인원</p>
Expand Down Expand Up @@ -83,7 +90,11 @@ const WaitingSummaryPage = () => {
</div>
<PageFooterButton background="transparent">
<Button onClick={handleSubmitReservation}>
{reservationIsLoading ? <LoadingSpinner loadingType="dotsWhite"/> : "등록하기"}
{reservationIsLoading ? (
<LoadingSpinner loadingType="dotsWhite" />
) : (
"등록하기"
)}
</Button>
</PageFooterButton>
</div>
Expand Down
24 changes: 15 additions & 9 deletions apps/nowait-user/src/pages/waiting/storeDetail/StoreDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import NotFound from "../../NotFound/NotFound";
import { getStoreMenus } from "../../../api/menu";
import FullPageLoader from "../../../components/FullPageLoader";


const StoreDetailPage = () => {
const navigate = useNavigate();
const { id: storeId } = useParams();
Expand All @@ -38,7 +37,7 @@ const StoreDetailPage = () => {
queryFn: () => getStore(Number(storeId!)),
select: (data) => data?.response,
});

console.log(store)
const { data: menus, isLoading: menusIsLoading } = useQuery({
queryKey: ["storeMenus", storeId],
queryFn: () => getStoreMenus(Number(storeId!)),
Expand Down Expand Up @@ -103,10 +102,14 @@ const StoreDetailPage = () => {
{formatTimeRange(store?.openTime)}
</p>
</div>
<h2 className="mb-10 text-16-regular text-black-80 whitespace-pre-line break-keep">
<h2
className={`${
store?.noticeTitle ? "mb-10" : "mb-0"
} text-16-regular text-black-80 whitespace-pre-line break-keep`}
>
{store?.description}
</h2>
{/* 공지사항(데이터 변경 예정) */}
{/* 공지사항 */}
{store?.noticeTitle && (
<button
onClick={() =>
Expand All @@ -123,9 +126,8 @@ const StoreDetailPage = () => {
<p className="text-[14px] font-bold text-black-50 shrink-0">
공지
</p>
<h1 className="text-14-medium text-black-70 overflow-hidden whitespace-nowrap text-ellipsis line-clamp-1">
입장 시 신분증 검사 필수 입장 시 신분증
검사필수필수필수필수필수필수필수필수필수필수필수필수
<h1 className="text-14-medium text-black-70 truncate">
{store?.noticeTitle}
</h1>
</div>
<Arrow className="shrink-0" fill="#AAAAAA" />
Expand All @@ -134,9 +136,13 @@ const StoreDetailPage = () => {
</section>
<SectionDivider />
{/* 주점 메뉴 리스트 */}
<MenuList mode="store" menus={menus?.menuReadDto!} isLoading={menusIsLoading}/>
<MenuList
mode="store"
menus={menus?.menuReadDto!}
isLoading={menusIsLoading}
/>
</div>
<PageFooterButton className="gap-2">
<PageFooterButton background="gradient" className="gap-2">
<Button
className="border"
backgroundColor="white"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import BackHeader from "../../../components/BackHeader";

const StoreNoticePage = () => {
const location = useLocation();
const { notice } = location.state;
const { title, content } = location.state;
return (
<div>
<BackHeader title="공지사항" />
<section className="px-5 py-[30px] mt-[38px]">
<h1 className="text-title-18-bold text-black-90 mb-4">입장 시 신분증 검사 필수</h1>
<p className="text-16-regular text-black-80 break-keep">{notice}여기가 설명이 들어갈 곳입니다. 여기가 설명이 들어갈 곳입니다.여기가 설명이 들어갈 곳입니다.여기가 설명이 들어갈 곳입니다.여기가 설명이 들어갈 곳입니다.여기가 설명이 들어갈 곳입니다.여기가 설명이 들어갈 곳입니다.</p>
<h1 className="text-title-18-bold text-black-90 mb-4">{title}</h1>
<p className="text-16-regular text-black-80 break-keep">{content}</p>
</section>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const WaitingPartySizeForm = () => {
mode="state"
quantity={partySize}
setQuantity={setPartySize}
min={1}
max={10}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import SuccessMessagePage from "../../../components/common/SuccessMessagePage";
import { useNavigate } from "react-router-dom";
import waitSuccess from "../../../assets/waitSuccess.png";
import waitingSuccess from "../../../assets/waitingSuccess.png";

const WaitingSuccessPage = () => {
const navigate = useNavigate();

return (
<SuccessMessagePage
imageSrc={waitSuccess}
imageSrc={waitingSuccess}
imageAlt="대기 등록 완료 이미지"
width="227px"
height="150px"
title="대기 등록 완료"
message={`원활한 운영을 위해 호출시\n10분 이내로 입장해주세요!`}
onClick={() => navigate("/", { replace: true })}
Expand Down
12 changes: 8 additions & 4 deletions apps/nowait-user/src/utils/formatDate.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
export const formatDate = (iso: string) => {
const date = new Date(iso);
return `${date.getFullYear()}년 ${
date.getMonth() + 1
}월 ${date.getDate()}일 ${date.getHours()}:${String(
date.getMinutes()

// UTC 기준 시각을 가져와서 KST(+9)로 변환
const kst = new Date(date.getTime() + 9 * 60 * 60 * 1000);

return `${kst.getFullYear()}년 ${
kst.getMonth() + 1
}월 ${kst.getDate()}일 ${String(kst.getHours()).padStart(2, "0")}:${String(
kst.getMinutes()
).padStart(2, "0")}`;
};