-
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.
Origin/feature/out going meal check function/#90
- Loading branch information
Showing
31 changed files
with
1,254 additions
and
294 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -11,5 +11,6 @@ | |
</head> | ||
<body> | ||
<div id="root"></div> | ||
<div id="modal"></div> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,83 @@ | ||
import { ModalProps } from "./type" | ||
import styled, { CSSObject } from "styled-components"; | ||
|
||
import { Portal } from "../modalPortal"; | ||
|
||
const Modal = ({width, | ||
height, | ||
zIndex, | ||
isOpen, | ||
close, | ||
children, | ||
customStyle,}:ModalProps)=>{ | ||
return( | ||
<Portal> | ||
{ | ||
isOpen && ( | ||
|
||
<Background onClick={close} customStyle={customStyle}> | ||
{children} | ||
</Background> | ||
|
||
) | ||
} | ||
</Portal> | ||
) | ||
} | ||
|
||
export default Modal; | ||
|
||
|
||
|
||
const Background = styled.div<{ customStyle?: CSSObject }>` | ||
width: 100%; | ||
min-height: 100%; | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
background-color: rgba(0, 0, 0, 0.4); | ||
z-index: 3; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 20px 0; | ||
overflow: auto; | ||
${({ customStyle }) => customStyle} | ||
`; | ||
|
||
const ModalHeaderWrap = styled.div` | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
width: 100%; | ||
height: 53px; | ||
border-bottom: 1px solid rgb(221, 221, 221); | ||
`; | ||
|
||
const Title = styled.h1` | ||
font-size: 17px; | ||
font-weight: bold; | ||
`; | ||
|
||
// export const CloseIcon = styled(CgClose)` | ||
// cursor: pointer; | ||
// padding: 5px; | ||
// border-radius: 5px; | ||
|
||
// transform: scale(1); | ||
// transition: all 0.2s ease-in-out; | ||
|
||
// &:hover { | ||
// background-color: #ddd; | ||
// transform: scale(0.96); | ||
// } | ||
// &:active { | ||
// background-color: #eee; | ||
// } | ||
// `; |
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,11 @@ | ||
import { CSSObject } from "styled-components"; | ||
|
||
export interface ModalProps { | ||
width?: number; | ||
height?: number; | ||
zIndex?: number; | ||
isOpen: boolean; | ||
close: () => void; | ||
children: React.ReactNode; | ||
customStyle?: CSSObject; | ||
} |
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,7 @@ | ||
import { ReactNode } from "react"; | ||
import ReactDom from "react-dom"; | ||
|
||
export const Portal = ({ children }: { children: ReactNode }) => { | ||
const element = document.getElementById("modal") as HTMLElement; | ||
return ReactDom.createPortal(children, element); | ||
}; |
Oops, something went wrong.