From 1524a3bdb06af9f1e71ed1fda51e8ae00d35806b Mon Sep 17 00:00:00 2001 From: chaeseungyun Date: Mon, 29 Apr 2024 23:16:10 +0900 Subject: [PATCH 1/7] =?UTF-8?q?chore:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20scss=20=ED=8C=8C=EC=9D=BC=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AddingEvent/AddingEvent.module.scss | 140 ------------------ 1 file changed, 140 deletions(-) delete mode 100644 src/page/ManageEvent/AddingEvent/AddingEvent.module.scss diff --git a/src/page/ManageEvent/AddingEvent/AddingEvent.module.scss b/src/page/ManageEvent/AddingEvent/AddingEvent.module.scss deleted file mode 100644 index f474f544..00000000 --- a/src/page/ManageEvent/AddingEvent/AddingEvent.module.scss +++ /dev/null @@ -1,140 +0,0 @@ -.container { - width: 100vw; - height: 100vh; - display: flex; - justify-content: center; -} - -.event { - margin-top: 8%; - width: 90%; - display: flex; - flex-direction: column; - gap: 30px; - - &__count { - color: #8e8e8e; - } - - &__images { - display: flex; - align-items: center; - box-sizing: border-box; - padding: 0 10px; - width: 100%; - background-color: #f5f5f5; - border-radius: 5px; - height: 100px; - margin-bottom: 10px; - } - - &__each-image { - width: 30%; - height: 80px; - margin: 0 5px; - position: relative; - - &--delete { - position: absolute; - top: -5px; - right: -5px; - background-color: transparent; - cursor: pointer; - } - } - - &__image { - width: 100%; - height: 100%; - } - - &__upload { - display: flex; - align-items: center; - justify-content: center; - width: 100%; - background-color: #f5f5f5; - border-radius: 5px; - height: 50px; - cursor: pointer; - } - - &__divide { - width: 100%; - display: flex; - justify-content: space-between; - } - - &__paragraph { - font-weight: bold; - margin-bottom: 10px; - } - - &__input { - border: 1px solid #e1e1e1; - border-radius: 5px; - box-sizing: border-box; - width: 100%; - height: 40px; - padding: 5px 10px; - } -} - -.event-day { - width: 100%; - display: flex; - align-items: center; - gap: 3vw; - margin-top: 10px; - - &__paragraph { - border-radius: 20px; - background-color: #f5f5f5; - width: 20%; - height: 40px; - display: flex; - align-items: center; - justify-content: center; - } - - &__input { - width: 20%; - height: 50px; - border: 1px solid #e1e1e1; - border-radius: 4px; - text-align: center; - } -} - -.buttons { - margin-top: 100px; - width: 100%; - display: flex; - justify-content: center; - gap: 20px; -} - -.cancel { - border: none; - background-color: #f5f5f5; - border-radius: 5px; - width: 35%; - height: 50px; -} - -.add { - border: none; - background-color: #175c8e; - color: white; - border-radius: 5px; - width: 55%; - height: 50px; -} - -.error-message { - color: #f7941e; -} - -.error-border { - border: 1px solid #f7941e; -} From 6aed824a86f7b6ee12cd07fd5742222f648e2182 Mon Sep 17 00:00:00 2001 From: chaeseungyun Date: Mon, 29 Apr 2024 23:17:33 +0900 Subject: [PATCH 2/7] =?UTF-8?q?refactor:=20=ED=95=84=EB=93=9C=20=EC=88=98?= =?UTF-8?q?=20=EC=A0=9C=ED=95=9C=EC=97=90=20=EA=B1=B8=EB=A6=AC=EB=A9=B4=20?= =?UTF-8?q?validation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/ManageEvent/AddingEvent/index.tsx | 43 +++++++++++++++++++--- src/page/ManageEvent/index.module.scss | 8 ++++ 2 files changed, 45 insertions(+), 6 deletions(-) diff --git a/src/page/ManageEvent/AddingEvent/index.tsx b/src/page/ManageEvent/AddingEvent/index.tsx index b8251c56..5240242c 100644 --- a/src/page/ManageEvent/AddingEvent/index.tsx +++ b/src/page/ManageEvent/AddingEvent/index.tsx @@ -8,7 +8,7 @@ import axios from 'axios'; import showToast from 'utils/ts/showToast'; import { ReactComponent as Delete } from 'assets/svg/myshop/delete.svg'; import cn from 'utils/ts/className'; -import styles from './AddingEvent.module.scss'; +import styles from 'page/ManageEvent/index.module.scss'; /* eslint-disable no-await-in-loop */ /* eslint-disable jsx-a11y/label-has-associated-control */ @@ -103,10 +103,20 @@ export default function AddingEvent() { setEventInfo({ ...eventInfo, title: e.target.value }); } if (type === 'start') { - setEventInfo({ ...eventInfo, start_date: { ...eventInfo.start_date, [change!]: value } }); + if (change === 'year' && e.target.value.length <= 4) { + setEventInfo({ ...eventInfo, start_date: { ...eventInfo.start_date, [change!]: value } }); + } + if (change !== 'year' && e.target.value.length <= 2) { + setEventInfo({ ...eventInfo, start_date: { ...eventInfo.start_date, [change!]: value } }); + } } if (type === 'end') { - setEventInfo({ ...eventInfo, end_date: { ...eventInfo.end_date, [change!]: value } }); + if (change === 'year' && e.target.value.length <= 4) { + setEventInfo({ ...eventInfo, end_date: { ...eventInfo.end_date, [change!]: value } }); + } + if (change !== 'year' && e.target.value.length <= 2) { + setEventInfo({ ...eventInfo, end_date: { ...eventInfo.end_date, [change!]: value } }); + } } setError({ ...error, title: false }); }; @@ -184,7 +194,13 @@ export default function AddingEvent() {

사진

이벤트/공지와 관련된 사진을 올려보세요. - + {`${eventInfo.thumbnail_image.length} / 3`}
@@ -217,7 +233,15 @@ export default function AddingEvent() { } )} -