|
1 | | -import React from "react"; |
| 1 | +import React, { useState } from "react"; |
2 | 2 | import { Button } from "@repo/ui"; |
3 | 3 | import Portal from "../common/modal/Portal"; |
| 4 | +import { AnimatePresence, motion } from "framer-motion"; |
4 | 5 |
|
5 | 6 | interface PropsType { |
6 | 7 | open: () => void; |
7 | 8 | close: () => void; |
8 | 9 | } |
9 | 10 |
|
10 | 11 | const ConfirmModal = ({ open, close }: PropsType) => { |
| 12 | + // const [isVisible, setIsVisible] = useState(true); |
| 13 | + |
| 14 | + // const handleClose = () => { |
| 15 | + // setIsVisible(false); |
| 16 | + // }; |
| 17 | + |
| 18 | + |
| 19 | + // const handleExitComplete = () => { |
| 20 | + // if (!isVisible) close(); |
| 21 | + // }; |
| 22 | + |
11 | 23 | return ( |
12 | 24 | <Portal> |
13 | | - <div |
14 | | - onClick={close} |
15 | | - className="fixed inset-0 z-50 bg-black/30" |
16 | | - > |
17 | | - <div className="absolute left-1/2 bottom-8 -translate-x-1/2 w-[calc(100%-20px)] max-w-[430px] bg-white rounded-[20px] px-5 pt-9"> |
18 | | - <h1 className="text-headline-22-bold mb-2">이체 완료 하셨나요?</h1> |
19 | | - <h2 className="text-16-regular text-black-70 mb-12"> |
20 | | - 아직 이체하지 않으셨다면 주문이 |
21 | | - <br /> 정상적으로 접수되지 않을 수 있어요. |
22 | | - <br /> |
23 | | - 계좌로 송금을 마치셨다면 버튼을 눌러주세요. |
24 | | - </h2> |
25 | | - <Button fullWidth={true} textColor="#ffffff" onClick={open}> |
26 | | - 이체했어요 |
27 | | - </Button> |
28 | | - <Button |
29 | | - fullWidth={true} |
30 | | - backgroundColor="transparent" |
31 | | - textColor="#888888" |
| 25 | + <AnimatePresence onExitComplete={close}> |
| 26 | + {/* {isVisible && ( */} |
| 27 | + <motion.div |
| 28 | + initial={{ opacity: 0 }} |
| 29 | + animate={{ opacity: 1 }} |
| 30 | + exit={{ opacity: 0 }} |
32 | 31 | onClick={close} |
| 32 | + className="fixed inset-0 z-50 bg-black/30" |
33 | 33 | > |
34 | | - 아직 안했어요 |
35 | | - </Button> |
36 | | - </div> |
37 | | - </div> |
| 34 | + <motion.div |
| 35 | + initial={{ y: "100%" }} |
| 36 | + animate={{ y: 0 }} |
| 37 | + exit={{ y: "100%" }} |
| 38 | + transition={{ duration: 0.3, ease: "easeInOut" }} |
| 39 | + className="absolute left-1/2 bottom-8 -translate-x-1/2 w-[calc(100%-20px)] max-w-[430px] bg-white rounded-[20px] px-5 pt-9" |
| 40 | + > |
| 41 | + <h1 className="text-headline-22-bold mb-2"> |
| 42 | + 이체 완료 하셨나요? |
| 43 | + </h1> |
| 44 | + <h2 className="text-16-regular text-black-70 mb-12"> |
| 45 | + 아직 이체하지 않으셨다면 주문이 |
| 46 | + <br /> 정상적으로 접수되지 않을 수 있어요. |
| 47 | + <br /> |
| 48 | + 계좌로 송금을 마치셨다면 버튼을 눌러주세요. |
| 49 | + </h2> |
| 50 | + <Button fullWidth={true} textColor="#ffffff" onClick={open}> |
| 51 | + 이체했어요 |
| 52 | + </Button> |
| 53 | + <Button |
| 54 | + fullWidth={true} |
| 55 | + backgroundColor="transparent" |
| 56 | + textColor="#888888" |
| 57 | + onClick={close} |
| 58 | + > |
| 59 | + 아직 안했어요 |
| 60 | + </Button> |
| 61 | + </motion.div> |
| 62 | + </motion.div> |
| 63 | + {/* )} */} |
| 64 | + </AnimatePresence> |
38 | 65 | </Portal> |
39 | 66 | ); |
40 | 67 | }; |
|
0 commit comments