diff --git a/.yarn/cache/@esbuild-darwin-arm64-npm-0.25.8-351c587628-10c0.zip b/.yarn/cache/@esbuild-win32-x64-npm-0.25.8-c2c2332051-10c0.zip similarity index 54% rename from .yarn/cache/@esbuild-darwin-arm64-npm-0.25.8-351c587628-10c0.zip rename to .yarn/cache/@esbuild-win32-x64-npm-0.25.8-c2c2332051-10c0.zip index 68a34038..fe80910f 100644 Binary files a/.yarn/cache/@esbuild-darwin-arm64-npm-0.25.8-351c587628-10c0.zip and b/.yarn/cache/@esbuild-win32-x64-npm-0.25.8-c2c2332051-10c0.zip differ diff --git a/.yarn/cache/@parcel-watcher-darwin-arm64-npm-2.5.1-12be747bca-10c0.zip b/.yarn/cache/@parcel-watcher-darwin-arm64-npm-2.5.1-12be747bca-10c0.zip deleted file mode 100644 index bec9ed1d..00000000 Binary files a/.yarn/cache/@parcel-watcher-darwin-arm64-npm-2.5.1-12be747bca-10c0.zip and /dev/null differ diff --git a/.yarn/cache/@parcel-watcher-win32-x64-npm-2.5.1-6e3012ad80-10c0.zip b/.yarn/cache/@parcel-watcher-win32-x64-npm-2.5.1-6e3012ad80-10c0.zip new file mode 100644 index 00000000..5fc48fe1 Binary files /dev/null and b/.yarn/cache/@parcel-watcher-win32-x64-npm-2.5.1-6e3012ad80-10c0.zip differ diff --git a/.yarn/cache/@rollup-rollup-darwin-arm64-npm-4.46.2-78a61e53eb-10c0.zip b/.yarn/cache/@rollup-rollup-darwin-arm64-npm-4.46.2-78a61e53eb-10c0.zip deleted file mode 100644 index ddd996b1..00000000 Binary files a/.yarn/cache/@rollup-rollup-darwin-arm64-npm-4.46.2-78a61e53eb-10c0.zip and /dev/null differ diff --git a/.yarn/cache/@rollup-rollup-win32-x64-msvc-npm-4.46.2-66021925a7-10c0.zip b/.yarn/cache/@rollup-rollup-win32-x64-msvc-npm-4.46.2-66021925a7-10c0.zip new file mode 100644 index 00000000..a465991d Binary files /dev/null and b/.yarn/cache/@rollup-rollup-win32-x64-msvc-npm-4.46.2-66021925a7-10c0.zip differ diff --git a/.yarn/cache/@sentry-cli-darwin-npm-2.53.0-c906d44a58-10c0.zip b/.yarn/cache/@sentry-cli-darwin-npm-2.53.0-c906d44a58-10c0.zip deleted file mode 100644 index 0a326a1a..00000000 Binary files a/.yarn/cache/@sentry-cli-darwin-npm-2.53.0-c906d44a58-10c0.zip and /dev/null differ diff --git a/.yarn/cache/@sentry-cli-win32-x64-npm-2.53.0-e37569fa05-10c0.zip b/.yarn/cache/@sentry-cli-win32-x64-npm-2.53.0-e37569fa05-10c0.zip new file mode 100644 index 00000000..d760707e Binary files /dev/null and b/.yarn/cache/@sentry-cli-win32-x64-npm-2.53.0-e37569fa05-10c0.zip differ diff --git a/.yarn/cache/@tailwindcss-oxide-darwin-arm64-npm-4.1.11-9385878a36-10c0.zip b/.yarn/cache/@tailwindcss-oxide-darwin-arm64-npm-4.1.11-9385878a36-10c0.zip deleted file mode 100644 index cafec901..00000000 Binary files a/.yarn/cache/@tailwindcss-oxide-darwin-arm64-npm-4.1.11-9385878a36-10c0.zip and /dev/null differ diff --git a/.yarn/cache/@tailwindcss-oxide-win32-x64-msvc-npm-4.1.11-3a4bbe0b3d-10c0.zip b/.yarn/cache/@tailwindcss-oxide-win32-x64-msvc-npm-4.1.11-3a4bbe0b3d-10c0.zip new file mode 100644 index 00000000..71656e28 Binary files /dev/null and b/.yarn/cache/@tailwindcss-oxide-win32-x64-msvc-npm-4.1.11-3a4bbe0b3d-10c0.zip differ diff --git a/.yarn/cache/fsevents-patch-6b67494872-10c0.zip b/.yarn/cache/fsevents-patch-6b67494872-10c0.zip deleted file mode 100644 index 996683a7..00000000 Binary files a/.yarn/cache/fsevents-patch-6b67494872-10c0.zip and /dev/null differ diff --git a/.yarn/cache/lightningcss-darwin-arm64-npm-1.30.1-4f54e7a15b-10c0.zip b/.yarn/cache/lightningcss-darwin-arm64-npm-1.30.1-4f54e7a15b-10c0.zip deleted file mode 100644 index baa9de0e..00000000 Binary files a/.yarn/cache/lightningcss-darwin-arm64-npm-1.30.1-4f54e7a15b-10c0.zip and /dev/null differ diff --git a/.yarn/cache/lightningcss-win32-x64-msvc-npm-1.30.1-2e0d6b2fcc-10c0.zip b/.yarn/cache/lightningcss-win32-x64-msvc-npm-1.30.1-2e0d6b2fcc-10c0.zip new file mode 100644 index 00000000..dd7ed013 Binary files /dev/null and b/.yarn/cache/lightningcss-win32-x64-msvc-npm-1.30.1-2e0d6b2fcc-10c0.zip differ diff --git a/.yarn/cache/turbo-darwin-arm64-npm-2.5.6-9d889b055e-10c0.zip b/.yarn/cache/turbo-windows-64-npm-2.5.6-b19e284eea-10c0.zip similarity index 58% rename from .yarn/cache/turbo-darwin-arm64-npm-2.5.6-9d889b055e-10c0.zip rename to .yarn/cache/turbo-windows-64-npm-2.5.6-b19e284eea-10c0.zip index d9bc12a2..acaab477 100644 Binary files a/.yarn/cache/turbo-darwin-arm64-npm-2.5.6-9d889b055e-10c0.zip and b/.yarn/cache/turbo-windows-64-npm-2.5.6-b19e284eea-10c0.zip differ diff --git a/apps/nowait-user/public/beef.png b/apps/nowait-user/public/beef.png deleted file mode 100644 index 3ef8842b..00000000 Binary files a/apps/nowait-user/public/beef.png and /dev/null differ diff --git a/apps/nowait-user/public/bookmarkStoreImage.png b/apps/nowait-user/public/bookmarkStoreImage.png deleted file mode 100644 index 2ec60c77..00000000 Binary files a/apps/nowait-user/public/bookmarkStoreImage.png and /dev/null differ diff --git a/apps/nowait-user/public/test-map.png b/apps/nowait-user/public/test-map.png deleted file mode 100644 index 197d4e0a..00000000 Binary files a/apps/nowait-user/public/test-map.png and /dev/null differ diff --git a/apps/nowait-user/src/assets/bankImage.png b/apps/nowait-user/src/assets/bankImage.png new file mode 100644 index 00000000..1cc37c63 Binary files /dev/null and b/apps/nowait-user/src/assets/bankImage.png differ diff --git a/apps/nowait-user/src/assets/boothMap.png b/apps/nowait-user/src/assets/boothMap.png index 381d2c35..197d4e0a 100644 Binary files a/apps/nowait-user/src/assets/boothMap.png and b/apps/nowait-user/src/assets/boothMap.png differ diff --git a/apps/nowait-user/src/assets/notFound.png b/apps/nowait-user/src/assets/notFound.png index 0464d616..b796dd9b 100644 Binary files a/apps/nowait-user/src/assets/notFound.png and b/apps/nowait-user/src/assets/notFound.png differ diff --git a/apps/nowait-user/src/components/EmptyPage.tsx b/apps/nowait-user/src/components/EmptyPage.tsx index ac559f8d..623a7952 100644 --- a/apps/nowait-user/src/components/EmptyPage.tsx +++ b/apps/nowait-user/src/components/EmptyPage.tsx @@ -26,12 +26,12 @@ const EmptyPage = ({ mode, title, buttonText }: PropsType) => { navigate(`/${storeId}`)} >

{buttonText}

- - + +
diff --git a/apps/nowait-user/src/components/SmallActionButton.tsx b/apps/nowait-user/src/components/SmallActionButton.tsx index b4b4ffea..eba7d4b3 100644 --- a/apps/nowait-user/src/components/SmallActionButton.tsx +++ b/apps/nowait-user/src/components/SmallActionButton.tsx @@ -1,5 +1,5 @@ interface PropsType { - mode? : "default" | "orderDetails" + mode?: "default" | "orderDetails"; type?: "button" | "submit" | "reset"; ariaLabel: string; children: React.ReactNode; @@ -18,10 +18,16 @@ export const SmallActionButton = ({ diff --git a/apps/nowait-user/src/components/order/TotalButton.tsx b/apps/nowait-user/src/components/order/TotalButton.tsx index e1672b33..b2c59602 100644 --- a/apps/nowait-user/src/components/order/TotalButton.tsx +++ b/apps/nowait-user/src/components/order/TotalButton.tsx @@ -1,6 +1,6 @@ import { sumQuantity, sumTotalPrice } from "../../utils/sumUtils"; import { useCartStore } from "../../stores/cartStore"; -import { useEffect, useState } from "react"; +import React, { useEffect, useState } from "react"; import NumberFlow from "@number-flow/react"; interface PropsType { @@ -18,8 +18,7 @@ const TotalButton = ({ const baseTotal = sumTotalPrice(cart); const [price, setPrice] = useState(baseTotal); const [trend, setTrend] = useState(0); - console.log(trend); - console.log(addedPrice); + useEffect(() => { if (addedPrice !== undefined) { setTrend(1); @@ -49,4 +48,4 @@ const TotalButton = ({ ); }; -export default TotalButton; +export default React.memo(TotalButton) diff --git a/apps/nowait-user/src/pages/NotFound/NotFound.tsx b/apps/nowait-user/src/pages/NotFound/NotFound.tsx index 891d82ac..f982d00f 100644 --- a/apps/nowait-user/src/pages/NotFound/NotFound.tsx +++ b/apps/nowait-user/src/pages/NotFound/NotFound.tsx @@ -3,13 +3,8 @@ const NotFound = () => { return (
- 페이지를 찾을 수 없습니다 + 페이지를 찾을 수 없습니다

페이지를 찾을 수 없어요

-

- 페이지가 존재하지 않거나, 사용할 수 없는 페이지입니다. -
- 입력하신 주소가 정확한지 다시 한번 확인해 주세요. -

); diff --git a/apps/nowait-user/src/pages/order/home/StorePage.tsx b/apps/nowait-user/src/pages/order/home/StorePage.tsx index 08dfcb17..5ee6317c 100644 --- a/apps/nowait-user/src/pages/order/home/StorePage.tsx +++ b/apps/nowait-user/src/pages/order/home/StorePage.tsx @@ -23,24 +23,30 @@ const StorePage = () => { //메뉴 추가 시 toast 띄우기 useEffect(() => { - if (added) showToast("메뉴를 담았습니다"); - navigate(location.pathname, { replace: true }); + if (added) { + showToast("메뉴를 담았습니다"); + navigate(location.pathname, { replace: true }); + } }, [added]); - const { data: menus, isLoading } = useQuery({ + const { data: menus, isLoading } = useQuery({ queryKey: ["storeMenus", storeId], queryFn: () => getStoreMenus(storeId!), select: (data) => data?.response, }); - console.log(menus,"asd") + console.log(menus, "asd"); return (
- + - +
{cart && cart.length > 0 && ( @@ -61,4 +67,4 @@ const StorePage = () => { ); }; -export default StorePage; \ No newline at end of file +export default StorePage; diff --git a/apps/nowait-user/src/pages/order/remittance/RemittancePage.tsx b/apps/nowait-user/src/pages/order/remittance/RemittancePage.tsx index 1aed4920..98c92a4b 100644 --- a/apps/nowait-user/src/pages/order/remittance/RemittancePage.tsx +++ b/apps/nowait-user/src/pages/order/remittance/RemittancePage.tsx @@ -33,6 +33,7 @@ const RemittancePage = () => { enabled: !!storeId, select: (data) => data?.response, }); + // 정보 없으면 홈으로 이동 useEffect(() => { if (cart.length === 0) { diff --git a/apps/nowait-user/src/pages/order/remittance/components/remitOptions/DirectRemitOption.tsx b/apps/nowait-user/src/pages/order/remittance/components/remitOptions/DirectRemitOption.tsx index 6ab44c91..dddfd5b7 100644 --- a/apps/nowait-user/src/pages/order/remittance/components/remitOptions/DirectRemitOption.tsx +++ b/apps/nowait-user/src/pages/order/remittance/components/remitOptions/DirectRemitOption.tsx @@ -3,12 +3,13 @@ import SlideToggle from "../SlideToggle"; import useThrottle from "../../../../../hooks/useThrottle"; import { useToastStore } from "../../../../../stores/toastStore"; import { accountFormat } from "../../../../../utils/accountFormat"; +import BankImage from "../../../../../assets/bankImage.png"; interface PropsType { remitValue: string; setRemitValue: React.Dispatch>; totalPrice: number; - account: string; + account?: string; } const DirectRemitOption = ({ remitValue, @@ -59,7 +60,8 @@ const DirectRemitOption = ({
계좌이체 은행 이미지

diff --git a/apps/nowait-user/src/pages/order/remittance/components/remitOptions/RemitOptions.tsx b/apps/nowait-user/src/pages/order/remittance/components/remitOptions/RemitOptions.tsx index 395a4183..10b8bb91 100644 --- a/apps/nowait-user/src/pages/order/remittance/components/remitOptions/RemitOptions.tsx +++ b/apps/nowait-user/src/pages/order/remittance/components/remitOptions/RemitOptions.tsx @@ -25,7 +25,7 @@ const RemitOptions = ({ isLoading, }: PropsType) => { if (isLoading) return ; - + return (
@@ -41,7 +41,7 @@ const RemitOptions = ({ setRemitValue={setRemitValue} /> ) : null} - {account && ( + {account?.trim() !== "" && ( { const [selectedBooth, setSelectedBooth] = useState(null); const [isDragging, setIsDragging] = useState(false); + const [positionX, setPositionX] = useState(0); + const [positionY, setPositionY] = useState(0); + const { data: storeMarkers } = useQuery({ queryKey: ["storesMarkers"], queryFn: getAllStores, select: (data) => data?.response?.storePageReadResponses, }); + // 뷰포트 크기 계산 + const viewportRef = useRef(null); + const viewportWidth = viewportRef.current?.clientWidth ?? 430; + const viewportHeight = viewportRef.current?.clientHeight ?? 812; + // 부스 + 마커 좌표 const booths = storeMarkers?.map((booth) => ({ ...booth, ...boothPosition[booth.storeId], })); - - // 마커 클릭시 나오는 부스 정보 - const detailBooth = booths?.find((booth) => booth.storeId === selectedBooth); + console.log(booths, "부스"); + useEffect(() => { + if (!booths || booths.length === 0) return; + console.log("실행"); + const positions = Object.values(boothPosition).map((booth) => ({ + top: parseFloat(booth.top), + left: parseFloat(booth.left), + })); + const avgTop = + positions.reduce((sum, booth) => sum + booth.top, 0) / positions.length; + const avgLeft = + positions.reduce((sum, booth) => sum + booth.left, 0) / positions.length; + const initialX = -((avgLeft / 100) * 1100 - viewportWidth / 2); + const initialY = -((avgTop / 100) * 1100 - viewportHeight / 2); + setPositionX(initialX); + setPositionY(initialY); + }, [booths]); const openBoothButton = (id: number) => { - console.log(id); if (selectedBooth === id) { setSelectedBooth(null); } else { @@ -55,16 +77,17 @@ const MapPage = () => { timeConstant: 0, }} dragConstraints={{ - left: -(1100 - 430), + left: -(1100 - viewportWidth), right: 0, - top: -(1100 - 812), + top: -(1100 - viewportHeight), bottom: 0, }} // 클릭, 드래그 구분 onPointerDown={() => setIsDragging(false)} onDragStart={() => setIsDragging(true)} - onPointerUp={() => { + onPointerUp={(e) => { if (!isDragging) { + if ((e.target as HTMLElement).closest("button")) return; setSelectedBooth(null); } }} @@ -73,6 +96,8 @@ const MapPage = () => { height: "1100px", position: "relative", cursor: "grab", + x: positionX, + y: positionY, }} > { pointerEvents: "none", userSelect: "none", }} - // src={boothMap} - src="/test-map.png" + src={BoothMap} alt="축제 맵 이미지" /> {/* 마커 */} @@ -120,7 +144,9 @@ const MapPage = () => {
{/* 부스 리스트 */} {selectedBooth !== null ? ( - + booth.storeId === selectedBooth)} + /> ) : ( )} diff --git a/apps/nowait-user/src/pages/waiting/boothMap/constants/boothPosition.ts b/apps/nowait-user/src/pages/waiting/boothMap/constants/boothPosition.ts index 19fd1da7..156c3cad 100644 --- a/apps/nowait-user/src/pages/waiting/boothMap/constants/boothPosition.ts +++ b/apps/nowait-user/src/pages/waiting/boothMap/constants/boothPosition.ts @@ -2,5 +2,4 @@ export const boothPosition: Record = { 1 : {top:"52.5%",left:"52.0%"}, 2 : {top:"41.2%",left:"50.8%"}, 3 : {top:"64.6%",left:"53.0%"} - };