From 68e5948c3f18bc0baca92c8a76657622eb769a77 Mon Sep 17 00:00:00 2001 From: hwinkr Date: Thu, 28 Dec 2023 20:39:09 +0900 Subject: [PATCH] =?UTF-8?q?chore(change=20modal=20code):=20=EA=B1=B4?= =?UTF-8?q?=EC=9D=98=EC=82=AC=ED=95=AD=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EC=82=AC=EC=9A=A9=ED=95=98=EB=8A=94=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=EC=9D=84=20=ED=95=A9=EC=84=B1=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 건의사항을 보낼 때 한번 더 내용을 확인하는 로직 추가 --- src/pages/Suggestion/index.tsx | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/pages/Suggestion/index.tsx b/src/pages/Suggestion/index.tsx index 9c80b82e..80f68d59 100644 --- a/src/pages/Suggestion/index.tsx +++ b/src/pages/Suggestion/index.tsx @@ -1,16 +1,17 @@ import postSuggestion from '@apis/suggestion/post-suggestion'; import Button from '@components/Common/Button'; +import Modal from '@components/Common/Modal'; import InformUpperLayout from '@components/InformUpperLayout'; import { MODAL_BUTTON_MESSAGE, MODAL_MESSAGE } from '@constants/modal-messages'; import PLCACEHOLDER_MESSAGES from '@constants/placeholder-message'; import { css } from '@emotion/react'; import styled from '@emotion/styled'; -import useModals, { modals } from '@hooks/useModals'; +import useModals from '@hooks/useModals'; import { THEME } from '@styles/ThemeProvider/theme'; import React, { useRef, useState } from 'react'; const SuggestionPage = () => { - const { openModal, closeModal } = useModals(); + const { openModal } = useModals(); const areaRef = useRef(null); const [isInValidInput, setIsInValidInput] = useState(true); @@ -24,11 +25,26 @@ const SuggestionPage = () => { const onButtonClick = () => { postSuggestion(areaRef.current?.value); - openModal(modals.alert, { - message: MODAL_MESSAGE.SUCCEED.POST_SUGGESTION, - buttonMessage: MODAL_BUTTON_MESSAGE.CONFIRM, - onClose: () => closeModal(modals.alert), - }); + openModal( + + + + , + ); + areaRef.current ? (areaRef.current.value = '') : null; + }; + + const handlePostSuggestion = () => { + openModal( + + + + + , + ); }; return ( @@ -46,7 +62,7 @@ const SuggestionPage = () => { />