-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65d35c4
commit 6874372
Showing
11 changed files
with
88 additions
and
25 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import styled, { keyframes } from "styled-components"; | ||
|
||
// 슬라이드 애니메이션 | ||
const slideUp = keyframes` | ||
from { | ||
transform: translate(-50%, 100%); | ||
opacity: 0; | ||
} | ||
to { | ||
transform: translate(-50%, 0); | ||
opacity: 1; | ||
} | ||
`; | ||
|
||
export const ModalBackdrop = styled.div` | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: rgba(0, 0, 0, 0.4); | ||
display: flex; | ||
justify-content: center; | ||
align-items: flex-end; | ||
z-index: 1000; | ||
`; | ||
|
||
export const ModalWrapper = styled.div` | ||
position: fixed; | ||
bottom: 0; | ||
left: 50%; | ||
transform: translateX(-50%); | ||
width: 100%; | ||
max-width: 480px; | ||
padding: 16px; | ||
background-color: white; | ||
border-top-left-radius: 16px; | ||
border-top-right-radius: 16px; | ||
box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.1); | ||
animation: ${slideUp} 0.3s ease-out; | ||
`; |
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,21 @@ | ||
import React, { ReactNode } from "react"; | ||
import * as S from "./CustomModal.styles"; | ||
|
||
interface CustomModalProps { | ||
children: ReactNode; // 모달 내부에 렌더링될 콘텐츠 | ||
onClose: () => void; // 모달 닫기 함수 | ||
} | ||
|
||
export default function CustomModal({ children, onClose }: CustomModalProps) { | ||
const handleBackdropClick = (e: React.MouseEvent<HTMLDivElement>) => { | ||
if (e.target === e.currentTarget) { | ||
onClose(); | ||
} | ||
}; | ||
|
||
return ( | ||
<S.ModalBackdrop onClick={handleBackdropClick}> | ||
<S.ModalWrapper>{children}</S.ModalWrapper> | ||
</S.ModalBackdrop> | ||
); | ||
} |
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 @@ | ||
export { default } from './CustomModal'; |
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