From d0d04752aaad6e356c7c3d4fb6cd603868228834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?sanguu516=28=EB=B0=95=EC=83=81=ED=98=84=29?= Date: Mon, 16 Oct 2023 15:09:11 +0900 Subject: [PATCH] =?UTF-8?q?Laanc=20Modal=20=ED=8C=8C=EC=9D=BC=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/laanc/LaancModal.js | 44 ++++++++++++++++++++++++++++++ src/views/laanc/LaancStep1.js | 31 +++++++++++++++------ 2 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 src/components/laanc/LaancModal.js diff --git a/src/components/laanc/LaancModal.js b/src/components/laanc/LaancModal.js new file mode 100644 index 0000000..03d6811 --- /dev/null +++ b/src/components/laanc/LaancModal.js @@ -0,0 +1,44 @@ +import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; + +export const LaancModal = props => { + return ( +
+ + props.setModal({ ...props.modal, isOpen: !props.modal.isOpen }) + } + modalClassName='modal-danger' + className='modal-dialog-centered' + > + + props.setModal({ ...props.modal, isOpen: !props.modal.isOpen }) + } + > + {props.modal.title} + + {props.modal.desc} + + + + + +
+ ); +}; diff --git a/src/views/laanc/LaancStep1.js b/src/views/laanc/LaancStep1.js index 399d011..6954a12 100644 --- a/src/views/laanc/LaancStep1.js +++ b/src/views/laanc/LaancStep1.js @@ -16,6 +16,8 @@ import { Info } from 'react-feather'; import { ErrorModal } from '../../components/modal/ErrorModal'; +import { InfoModal } from '../../components/modal/InfoModal'; +import { LaancModal } from '../../components/laanc/LaancModal'; import moment from 'moment'; import { Row, @@ -65,12 +67,22 @@ export default function LaancStep1({ const [popoverSchFltStDt, setPopoverSchFltStDt] = useState(false); const [popoverSchFltEndDt, setPopoverSchFltEndDt] = useState(false); - const [modal2, setModal2] = useState({ + const [isErrorModal, setIsErrorModal] = useState({ isOpen: false, title: '', desc: '' }); - + const [isInfoModal, setIsInfoModal] = useState({ + isOpen: false, + title: '', + desc: '' + }); + const [isLaancModal, setIsLaancModal] = useState({ + isOpen: false, + title: '', + desc: '', + type: '' + }); useEffect(() => { // URL 쿼리 파라미터 중 'map' 값을 가져옵니다. if (!currentParm) setCenteredModal(mapParam != 'true' ? false : true); @@ -123,7 +135,7 @@ export default function LaancStep1({ // 날짜 선택 핸들러 const handleOpenFlatpickr = () => { if (data.areaList[0].coordList[0].lat === 0) { - setModal2({ + setIsInfoModal({ isOpen: true, title: '비행 구역 설정', desc: '비행 구역 설정을 먼저 설정 해 주세요' @@ -138,7 +150,7 @@ export default function LaancStep1({ switch (type) { case 'fltElev': if (parseInt(value.replace('/^0+/', 'm', ''), 10) <= 150) { - setModal2({ + setIsErrorModal({ isOpen: true, title: '고도 알림', desc: ( @@ -155,7 +167,7 @@ export default function LaancStep1({ name: 'fltElev', value: 0 }); - setModal2({ + setIsErrorModal({ isOpen: true, title: '고도 재설정 알림', desc: ( @@ -176,7 +188,7 @@ export default function LaancStep1({ name: 'fltMethod', value: '' }); - setModal2({ + setIsLaancModal({ isOpen: true, title: '군집 비행 목적', desc: ( @@ -184,7 +196,8 @@ export default function LaancStep1({ 군집 비행의 경우 담당자와 협의가 필요합니다.
아래 링크를 통해 담당자와 협의 부탁드립니다. - ) + ), + type: 'fltMethod' }); } } @@ -717,7 +730,9 @@ export default function LaancStep1({ 다음 - + + + ); }