-
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
Showing
20 changed files
with
172 additions
and
80 deletions.
There are no files selected for viewing
This file was deleted.
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
File renamed without changes.
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,51 @@ | ||
import React from 'react' | ||
import tw from 'tailwind-styled-components'; | ||
import PropTypes from 'prop-types'; | ||
import { IModalProps } from './Modal'; | ||
import styled from 'styled-components'; | ||
import { ITheme } from 'interfaces/theme.interface'; | ||
import React from "react"; | ||
import PropTypes from "prop-types"; | ||
import { IModalProps } from "./Modal"; | ||
import styled from "styled-components"; | ||
import { ITheme } from "interfaces/theme.interface"; | ||
|
||
const propTypes = { | ||
children: PropTypes.oneOfType([ | ||
PropTypes.arrayOf(PropTypes.element), | ||
PropTypes.element | ||
PropTypes.element, | ||
]), | ||
show: PropTypes.bool.isRequired, | ||
onHide: PropTypes.func.isRequired, | ||
} | ||
}; | ||
|
||
const defaultProps = { | ||
show: false, | ||
onHide: () => { | ||
console.log("Hide modal") | ||
console.log("Hide modal"); | ||
}, | ||
} | ||
}; | ||
|
||
const ModalDialog: React.FC<IModalProps> = ({ children, show, onHide, ...props }) => { | ||
const ModalDialog: React.FC<IModalProps> = ({ | ||
children, | ||
show, | ||
onHide, | ||
...props | ||
}) => { | ||
return ( | ||
<Dialog> | ||
<DialogContent className='box-shadow'> | ||
{children} | ||
</DialogContent> | ||
<DialogContent className='box-shadow'>{children}</DialogContent> | ||
</Dialog> | ||
) | ||
} | ||
); | ||
}; | ||
|
||
ModalDialog.displayName = 'ModalDialog'; | ||
ModalDialog.displayName = "ModalDialog"; | ||
ModalDialog.propTypes = propTypes; | ||
ModalDialog.defaultProps = defaultProps; | ||
|
||
const Dialog = tw.div`flex-center w-full my-8`; | ||
const DialogContent = styled.div` | ||
const Dialog = styled.div` | ||
max-width: 480px; | ||
width: 100%; | ||
background: ${({ theme }: ITheme ) => theme.backgroundPrimary}; | ||
`; | ||
|
||
const DialogContent = styled.div` | ||
background: ${({ theme }: ITheme) => theme.backgroundPrimary}; | ||
color: white; | ||
border-radius: 8px; | ||
`; | ||
|
||
export default ModalDialog | ||
export default ModalDialog; |
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
Oops, something went wrong.