-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Feat] Navigation Block 팝업 커스텀 구현
- Loading branch information
Showing
12 changed files
with
104 additions
and
39 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
client/src/components/NavigationConfirmPopup/index.style.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { cva } from "class-variance-authority"; | ||
|
||
export const buttonStyles = cva("flex-1 py-400 rounded-1000 h-body-1-regular transition-all", { | ||
variants: { | ||
variant: { | ||
primary: "bg-s-blue border border-s-blue text-n-white hover:bg-s-hover", | ||
secondary: "bg-n-white border border-s-blue text-s-blue hover:bg-neutral-100", | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { useEffect } from "react"; | ||
import { buttonStyles } from "./index.style"; | ||
|
||
interface NavigationConfirmPopUpProps { | ||
handleConfirm: () => void; | ||
handleClose: () => void; | ||
} | ||
|
||
export default function NavigationConfirmPopUp({ | ||
handleConfirm, | ||
handleClose, | ||
}: NavigationConfirmPopUpProps) { | ||
useEffect(() => { | ||
document.body.style.overflow = "hidden"; | ||
|
||
return () => { | ||
document.body.style.overflow = "unset"; | ||
}; | ||
}, []); | ||
|
||
return ( | ||
<div className="fixed w-full h-full left-0 top-0 z-20"> | ||
<div | ||
className="absolute left-0 top-0 w-[100%] h-[100%] bg-n-black/[.4]" | ||
onClick={handleClose} | ||
/> | ||
<div className="px-[50px] py-1000 bg-n-white rounded-600 absolute left-[50%] top-[50%] translate-y-[-50%] translate-x-[-50%]"> | ||
<p className="h-body-1-regular"> | ||
이 페이지를 떠나면 모든 변경 사항이 저장되지 않습니다. | ||
<br /> | ||
페이지를 떠나시겠습니까? | ||
</p> | ||
|
||
<div className="flex gap-500 mt-800"> | ||
<button className={buttonStyles({ variant: "primary" })} onClick={handleClose}> | ||
아니요 | ||
</button> | ||
<button | ||
className={buttonStyles({ variant: "secondary" })} | ||
onClick={handleConfirm} | ||
> | ||
네 | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters