From 9d83a266ffc8683c9fe68b783e65d4d37a139718 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Jan 2026 22:35:44 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=ED=85=8C=EC=9D=B4=EB=B8=94=20?= =?UTF-8?q?=EC=98=A4=EB=8D=94=20=EB=A9=94=EC=9D=B8=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EC=8A=A4=EC=BC=88=EB=A0=88=ED=86=A4=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/MenuList.tsx | 27 +++++-------------- .../components/common/MenuListSkeleton.tsx | 22 +++++++++++++++ .../pages/order/remittance/RemittancePage.tsx | 2 +- 3 files changed, 29 insertions(+), 22 deletions(-) create mode 100644 apps/nowait-user/src/components/common/MenuListSkeleton.tsx diff --git a/apps/nowait-user/src/components/common/MenuList.tsx b/apps/nowait-user/src/components/common/MenuList.tsx index 5e2a3d04..913485b4 100644 --- a/apps/nowait-user/src/components/common/MenuList.tsx +++ b/apps/nowait-user/src/components/common/MenuList.tsx @@ -1,5 +1,6 @@ import type { MenuType } from "../../types/order/menu"; import MenuItem from "./MenuItem"; +import MenuListSkeleton from "./MenuListSkeleton"; const MenuList = ({ mode, @@ -10,32 +11,16 @@ const MenuList = ({ menus: MenuType[] | undefined; isLoading: boolean; }) => { + + if (isLoading) return ; return (

메뉴

    - {!isLoading ? ( - menus?.map((menu: MenuType) => { - return ; - }) - ) : ( - <> - {Array.from({ length: 5 }).map((_, i) => { - return ( -
  • -
    -
    -

    -

    -

    -
    -
    -
  • - ); - })} - - )} + {menus?.map((menu: MenuType) => { + return ; + })}
); diff --git a/apps/nowait-user/src/components/common/MenuListSkeleton.tsx b/apps/nowait-user/src/components/common/MenuListSkeleton.tsx new file mode 100644 index 00000000..f3a081cf --- /dev/null +++ b/apps/nowait-user/src/components/common/MenuListSkeleton.tsx @@ -0,0 +1,22 @@ +const MenuListSkeleton = () => { + return ( +
+

메뉴

+
    + {Array.from({ length: 5 }).map((_, i) => ( +
  • +
    +
    +
    +
    +
    +
    +
    +
  • + ))} +
+
+ ); +}; + +export default MenuListSkeleton; diff --git a/apps/nowait-user/src/pages/order/remittance/RemittancePage.tsx b/apps/nowait-user/src/pages/order/remittance/RemittancePage.tsx index 619252cc..ed83ca02 100644 --- a/apps/nowait-user/src/pages/order/remittance/RemittancePage.tsx +++ b/apps/nowait-user/src/pages/order/remittance/RemittancePage.tsx @@ -70,7 +70,7 @@ const RemittancePage = () => { setErrorMessage(null); modal.open(); }; - console.log(remittance); + return (
From 00926f660b67c45a18f1fae63b2cd6d77c6c10ff Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 17 Jan 2026 21:05:53 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=EC=A3=BC=EB=AC=B8=20=EB=8C=80?= =?UTF-8?q?=EA=B8=B0=20=EC=BD=94=EB=93=9C=20=EC=A0=95=EB=A6=AC=20=EB=B0=8F?= =?UTF-8?q?=20API=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/nowait-user/src/api/client.ts | 13 ++++ apps/nowait-user/src/api/menu.ts | 12 +--- apps/nowait-user/src/api/order.ts | 14 ++-- .../src/pages/order/home/StorePage.tsx | 9 ++- .../order/orderDetails/OrderDetailsPage.tsx | 63 +---------------- .../orderDetails/components/OrderCard.tsx | 62 ++++++++++++++++ .../pages/order/remittance/RemittancePage.tsx | 70 +++++++++++++------ .../waiting/storeDetail/StoreDetailPage.tsx | 2 +- 8 files changed, 139 insertions(+), 106 deletions(-) create mode 100644 apps/nowait-user/src/api/client.ts create mode 100644 apps/nowait-user/src/pages/order/orderDetails/components/OrderCard.tsx diff --git a/apps/nowait-user/src/api/client.ts b/apps/nowait-user/src/api/client.ts new file mode 100644 index 00000000..848232a0 --- /dev/null +++ b/apps/nowait-user/src/api/client.ts @@ -0,0 +1,13 @@ +// api/client.ts +import axios from "axios"; + +const API_URI = import.meta.env.VITE_SERVER_URI; + +export const authApi = axios.create({ + baseURL: `${API_URI}/v1`, + withCredentials: true, +}); + +export const publicApi = axios.create({ + baseURL: `${API_URI}/v1`, +}); \ No newline at end of file diff --git a/apps/nowait-user/src/api/menu.ts b/apps/nowait-user/src/api/menu.ts index 5e1a0f8a..dcfba61c 100644 --- a/apps/nowait-user/src/api/menu.ts +++ b/apps/nowait-user/src/api/menu.ts @@ -1,5 +1,5 @@ import type { MenuType } from "../types/order/menu"; -import axios from "axios"; +import { publicApi } from "./client"; interface AllMenuServerResponse { success: boolean; @@ -17,16 +17,10 @@ interface MenuServerResponse { status: number; } -const API_URI = import.meta.env.VITE_SERVER_URI; - -const UserApi = axios.create({ - baseURL: `${API_URI}/v1`, -}); - //주점에 해당하는 모든 메뉴 조회 export const getStoreMenus = async (publicCode: string) => { try { - const res = await UserApi.get( + const res = await publicApi.get( `/stores/${publicCode}/menus` ); if (res?.data.success) return res.data; @@ -40,6 +34,6 @@ export const getStoreMenu = async ( publicCode: string, menuId: number ): Promise => { - const res = await UserApi.get(`/stores/${publicCode}/menus/${menuId}`); + const res = await publicApi.get(`/stores/${publicCode}/menus/${menuId}`); return res.data; }; diff --git a/apps/nowait-user/src/api/order.ts b/apps/nowait-user/src/api/order.ts index 258c20a9..1a960fb0 100644 --- a/apps/nowait-user/src/api/order.ts +++ b/apps/nowait-user/src/api/order.ts @@ -4,13 +4,7 @@ import type { OrderType, StorePaymentsResponse, } from "../types/order/order"; -import axios from "axios"; - -const API_URI = import.meta.env.VITE_SERVER_URI; - -const UserApi = axios.create({ - baseURL: `${API_URI}/v1`, -}); +import { authApi, publicApi } from "./client"; //주문 생성 export const createOrder = async ( @@ -18,7 +12,7 @@ export const createOrder = async ( tableId: number, payload: OrderType ): Promise => { - const res = await UserApi.post( + const res = await authApi.post( `/stores/${publicCode}/tables/${tableId}/orders`, payload ); @@ -30,7 +24,7 @@ export const getOrderDetails = async ( publicCode: string, tableId: number ): Promise => { - const res = await UserApi.get( + const res = await authApi.get( `/stores/${publicCode}/tables/${tableId}/orders` ); return res.data; @@ -38,7 +32,7 @@ export const getOrderDetails = async ( //주점 QR, 계좌번호 조회 export const getStorePayments = async (publicCode: string) => { - const res = await UserApi.get( + const res = await publicApi.get( `/stores/${publicCode}/payments` ); return res.data; diff --git a/apps/nowait-user/src/pages/order/home/StorePage.tsx b/apps/nowait-user/src/pages/order/home/StorePage.tsx index f9dabe09..380b036f 100644 --- a/apps/nowait-user/src/pages/order/home/StorePage.tsx +++ b/apps/nowait-user/src/pages/order/home/StorePage.tsx @@ -29,12 +29,12 @@ const StorePage = () => { } }, [added]); + const hasCartItems = cart.length > 0; + const pagePaddingBottom = hasCartItems ? "pb-[116px]" : ""; return (
0 ? "pb-[116px]" : "" - } px-5`} + className={`flex flex-col grow min-h-dvh pt-7.5 ${pagePaddingBottom} px-5`} >
@@ -46,14 +46,13 @@ const StorePage = () => { />
- {cart && cart.length > 0 && ( + {hasCartItems && ( {modal.isOpen && ( { - if (remitValue === "kakao") { - window.open(`${remittance?.kakaoPayUrl}`, "_blank"); - } else if (remitValue === "toss") { - window.open(`${remittance?.tossUrl}`, "_blank"); - } else if (remitValue === "naver") { - window.open(`${remittance?.naverPayUrl}`, "_blank"); - } - navigate(`/${storeId}/remittanceWait`, { state: payer }); - }} + open={handleConfirm} close={modal.close} title={`${ remitValue === "direct" ? "직접 " : "" diff --git a/apps/nowait-user/src/pages/waiting/storeDetail/StoreDetailPage.tsx b/apps/nowait-user/src/pages/waiting/storeDetail/StoreDetailPage.tsx index c68cafa9..a8cc80a0 100644 --- a/apps/nowait-user/src/pages/waiting/storeDetail/StoreDetailPage.tsx +++ b/apps/nowait-user/src/pages/waiting/storeDetail/StoreDetailPage.tsx @@ -19,7 +19,7 @@ const StoreDetailPage = () => { return (
-
+