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 = () => { />