File tree Expand file tree Collapse file tree 3 files changed +68
-1
lines changed
Expand file tree Collapse file tree 3 files changed +68
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ interface OverlayProps {
44 className ?: string ;
55}
66
7- const Overlay = ( { onClick, opacity = 40 , className } : OverlayProps ) => {
7+ const Overlay = ( { onClick, opacity = 30 , className } : OverlayProps ) => {
88 return (
99 < div
1010 onClick = { onClick }
Original file line number Diff line number Diff line change 1+ import { useState } from 'react' ;
2+ import { cn } from '@/shared/lib' ;
3+
4+ interface PopupProps {
5+ text : string ;
6+ onClose ?: ( ) => void ;
7+ }
8+
9+ export default function Popup ( { text, onClose } : PopupProps ) {
10+ const [ visible , setVisible ] = useState ( true ) ;
11+ const handleClose = ( ) => {
12+ setVisible ( false ) ;
13+ onClose ?.( ) ;
14+ } ;
15+
16+ if ( ! visible ) return null ;
17+
18+ return (
19+ < div
20+ className = { cn (
21+ 'px-[1.6rem] py-[1.5rem] w-[26.2rem] h-[12rem]' ,
22+ 'bg-white border border-gray-200 rounded-[0.8rem]' ,
23+ 'flex flex-col items-center justify-center gap-[1.4rem]' ,
24+ ) }
25+ >
26+ < p className = 'text-title-sm text-gray-500' > { text } </ p >
27+ < button className = 'text-title-md text-blue-400' onClick = { handleClose } >
28+ 확인
29+ </ button >
30+ </ div >
31+ ) ;
32+ }
Original file line number Diff line number Diff line change 1+ import { useState } from 'react' ;
2+ import { cn } from '@/shared/lib' ;
3+ import Popup from '@/shared/common/Popup' ;
4+ import Overlay from '@/shared/common/Overlay' ;
5+
6+ interface PopupSetProps {
7+ text : string ;
8+ onClose ?: ( ) => void ;
9+ }
10+
11+ export default function PopupSet ( { text, onClose } : PopupSetProps ) {
12+ const [ isOpen , setIsOpen ] = useState ( true ) ;
13+
14+ const handleClose = ( ) => {
15+ setIsOpen ( false ) ;
16+ onClose ?.( ) ;
17+ } ;
18+
19+ if ( ! isOpen ) return null ;
20+
21+ return (
22+ < >
23+ < Overlay />
24+ { /* 중앙 고정 */ }
25+ < div
26+ className = { cn (
27+ 'fixed inset-0 z-[50]' ,
28+ 'flex items-center justify-center' ,
29+ ) }
30+ >
31+ < Popup text = { text } onClose = { handleClose } />
32+ </ div >
33+ </ >
34+ ) ;
35+ }
You can’t perform that action at this time.
0 commit comments