From 1ded96f84e7684f91d00d5f4fa06e085a45c32be Mon Sep 17 00:00:00 2001 From: zoonyoung <9851248@gmail.com> Date: Sun, 28 Apr 2024 15:20:27 +0900 Subject: [PATCH 1/4] =?UTF-8?q?Refactor:=20=EB=B0=98=EC=9D=91=ED=98=95=20&?= =?UTF-8?q?=20=EC=8A=A4=ED=83=80=EC=9D=BC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/shopinfo/ShopInformation.tsx | 9 +++- src/app/shopinfo/ShopRegistration.tsx | 6 +-- src/app/shopinfo/layout.module.scss | 12 ++++++ src/app/shopinfo/layout.tsx | 6 +-- src/app/shopinfo/page.module.scss | 43 +++++++++++++++++-- src/components/common/Input/Input.module.scss | 2 +- src/components/common/Input/Input.tsx | 30 +++++++------ .../CompletionModal.module.scss | 4 +- ...n.module.scss => Registration.module.scss} | 38 +++++++++++++--- .../{Registartion.tsx => Registration.tsx} | 6 ++- 10 files changed, 120 insertions(+), 36 deletions(-) rename src/components/shopinfoPage/{Registartion.module.scss => Registration.module.scss} (66%) rename src/components/shopinfoPage/{Registartion.tsx => Registration.tsx} (96%) diff --git a/src/app/shopinfo/ShopInformation.tsx b/src/app/shopinfo/ShopInformation.tsx index a2ca2ad..8fc1a60 100644 --- a/src/app/shopinfo/ShopInformation.tsx +++ b/src/app/shopinfo/ShopInformation.tsx @@ -2,7 +2,7 @@ import Image from 'next/image'; import { GPS } from '@/utils/constants'; import { NoticeDataType, NoticeSearchDataType } from '@/types'; import { useContext, useEffect, useState } from 'react'; -import Registration from '@/components/shopinfoPage/Registartion'; +import Registration from '@/components/shopinfoPage/Registration'; import OwnerAddNotice from '@/components/ownerAddNotice/OwnerAddNotice'; import Cookies from 'js-cookie'; import Button from '@/components/common/Button'; @@ -54,7 +54,11 @@ export default function ShopInformation() { - {showShopEdit && setShowShopEdit(false)} />} + {showShopEdit && ( +
+ setShowShopEdit(false)} /> +
+ )} {showAddNotice && (
setShowAddNotice(false)} /> @@ -73,6 +77,7 @@ export default function ShopInformation() { workHour={notice.item.workhour} salary={notice.item.hourlyPay} raise={shopData ? raisePercent(notice.item.hourlyPay, shopData.originalHourlyPay) : 0} + isRaised={notice?.item.hourlyPay > shopData?.originalHourlyPay} location={shopData.address1} shopId={shopId} completed={ diff --git a/src/app/shopinfo/ShopRegistration.tsx b/src/app/shopinfo/ShopRegistration.tsx index 89b65d8..8a853a1 100644 --- a/src/app/shopinfo/ShopRegistration.tsx +++ b/src/app/shopinfo/ShopRegistration.tsx @@ -1,10 +1,10 @@ import { useState } from 'react'; -import Registration from '@/components/shopinfoPage/Registartion'; +import Registration from '@/components/shopinfoPage/Registration'; import Button from '@/components/common/Button'; import styles from './page.module.scss'; export default function ShopRegistration() { - const [showShopRegistartion, setShowShopRegisteration] = useState(false); + const [showShopRegistration, setShowShopRegisteration] = useState(false); return (

내 가게

@@ -15,7 +15,7 @@ export default function ShopRegistration() { 가게 등록하기
- {showShopRegistartion && setShowShopRegisteration(false)} />} + {showShopRegistration && setShowShopRegisteration(false)} />} ); diff --git a/src/app/shopinfo/layout.module.scss b/src/app/shopinfo/layout.module.scss index ec5c969..7840389 100644 --- a/src/app/shopinfo/layout.module.scss +++ b/src/app/shopinfo/layout.module.scss @@ -1,6 +1,10 @@ +@import '@/styles/_media.scss'; + .layout { + width: 100%; display: flex; flex-direction: column; + align-items: center; min-height: 100vh; } @@ -9,4 +13,12 @@ flex-direction: column; flex-grow: 1; position: relative; + width: 100%; + max-width: 1200px; +} + +@include media(mobile) { + .box { + padding: 0 1rem; + } } diff --git a/src/app/shopinfo/layout.tsx b/src/app/shopinfo/layout.tsx index cc9721c..888534d 100644 --- a/src/app/shopinfo/layout.tsx +++ b/src/app/shopinfo/layout.tsx @@ -8,10 +8,8 @@ export default function shopInfoLayout({ children }: { children: React.ReactNode
-
- {children} -
-
+
{children}
+
); diff --git a/src/app/shopinfo/page.module.scss b/src/app/shopinfo/page.module.scss index 630deff..0985541 100644 --- a/src/app/shopinfo/page.module.scss +++ b/src/app/shopinfo/page.module.scss @@ -1,9 +1,11 @@ @import '@/styles/_index'; +@import '@/styles/_media'; .layout { font-size: 1.6rem; padding: 3rem; flex-grow: 1; + max-width: 1200px; } .title { @@ -25,7 +27,7 @@ width: 100%; display: flex; flex-direction: column; - gap: 1rem; + gap: 2rem; } .mainImage { @@ -64,16 +66,49 @@ } .modalBox { - width: 100%; height: 100%; + z-index: 100; position: absolute; top: 0; + bottom: 0; left: 0; - z-index: 1000; + right: 0; } .cardList { display: grid; + place-items: center; + width: 100%; grid-template-columns: repeat(3, 1fr); - gap: 1rem; + grid-column-gap: 1.4rem; +} + +@include media(mobile) { + .shopBox { + flex-direction: column; + } + + .mainImage { + width: 100%; + height: auto; + } + + .buttonBox { + gap: 0.6rem; + } + + .registerLayout { + padding: 10rem 1rem; + gap: 1.6rem; + } + + .registerButton { + padding: 0 1rem; + } +} + +@include media(tablet) { + .cardList { + grid-template-columns: repeat(2, 1fr); + } } diff --git a/src/components/common/Input/Input.module.scss b/src/components/common/Input/Input.module.scss index 171e870..21cbd84 100644 --- a/src/components/common/Input/Input.module.scss +++ b/src/components/common/Input/Input.module.scss @@ -17,7 +17,7 @@ .input { width: 100%; - border: 1px solid $gray-400; + border: 1px solid $gray-500; padding: 1.6rem 2rem; margin-top: 0.8rem; diff --git a/src/components/common/Input/Input.tsx b/src/components/common/Input/Input.tsx index f5a85bb..cc1084f 100644 --- a/src/components/common/Input/Input.tsx +++ b/src/components/common/Input/Input.tsx @@ -32,7 +32,7 @@ export default function Input({ 1: styles.singleCharacterUnit, 2: styles.doubleCharacterUnit, }; - const handleChange = (event: React.ChangeEvent) => { + const handleChange = (event: React.ChangeEvent) => { onChange(event.target.value); }; const handleFocusOut = () => { @@ -53,18 +53,22 @@ export default function Input({ {label}
- + {type === 'textArea' ? ( +