diff --git a/src/components/common/draggable/WithDraggable.jsx b/src/components/common/draggable/WithDraggable.jsx index 49552eac..9a51358c 100644 --- a/src/components/common/draggable/WithDraggable.jsx +++ b/src/components/common/draggable/WithDraggable.jsx @@ -2,9 +2,13 @@ import { useState } from 'react' import Draggable from 'react-draggable' +import PopSpinner from '../spinner/PopSpinner' +import { popSpinnerState } from '@/store/popupAtom' +import { useRecoilState } from 'recoil' export default function WithDraggable({ isShow, children, pos = { x: 0, y: 0 }, handle = '', className = '', hasFooter = true, isHidden = false }) { const [position, setPosition] = useState(pos) + const [popSpinnerStore, setPopSpinnerStore] = useRecoilState(popSpinnerState) const handleOnDrag = (e, data) => { e.stopPropagation() @@ -25,6 +29,7 @@ export default function WithDraggable({ isShow, children, pos = { x: 0, y: 0 },
{children} {hasFooter && } + {popSpinnerStore && }
)} diff --git a/src/components/footer/PromisePopup.jsx b/src/components/footer/PromisePopup.jsx new file mode 100644 index 00000000..feb400e1 --- /dev/null +++ b/src/components/footer/PromisePopup.jsx @@ -0,0 +1,71 @@ +import React, { useEffect } from 'react' +import { popSpinnerState, promisePopupState } from '@/store/popupAtom' +import { useRecoilState } from 'recoil' +import WithDraggable from '../common/draggable/WithDraggable' +import { useMessage } from '@/hooks/useMessage' + +export default function PromisePopup() { + const { getMessage } = useMessage() + const [promisePopupStore, setPromisePopupStore] = useRecoilState(promisePopupState) + const [popSpinnerStore, setPopSpinnerStore] = useRecoilState(popSpinnerState) + + const handleSpinner = () => { + setPopSpinnerStore(true) + setTimeout(() => { + setPopSpinnerStore(false) + }, 1000) + } + + return ( + + setPromisePopupStore(false)} /> + + +
+ {getMessage('modal.image.load.size.rotate')} + +
+
+
+
+ + +
+
+
+ + +
+
+ +
+
+
+
+
+ + +
+
+ +
+ +
+
+
+
+
+ +
+
+
+ ) +} diff --git a/src/store/popupAtom.js b/src/store/popupAtom.js index 8cba0bdc..72acaee5 100644 --- a/src/store/popupAtom.js +++ b/src/store/popupAtom.js @@ -27,3 +27,15 @@ export const contextPopupPositionState = atom({ }, dangerouslyAllowMutability: true, }) + +/** 팝업 스피너 상태 */ +export const popSpinnerState = atom({ + key: 'popSpinnerStore', + default: false, +}) + +/** 프로미스 팝업 상태 - 테스트용(삭제 예정) */ +export const promisePopupState = atom({ + key: 'promisePopupStore', + default: false, +})