index.tsx 493 B

12345678910111213141516171819202122232425262728
  1. import React from 'react';
  2. import Portal from '../Portal';
  3. import { Container, Blanket, Content } from './styled';
  4. type Props = {
  5. children: React.ReactNode;
  6. hideBackdrop?: boolean;
  7. };
  8. const Modal: React.FunctionComponent<Props> = ({
  9. children,
  10. hideBackdrop = false,
  11. }) => {
  12. return (
  13. <Portal>
  14. <Container>
  15. {hideBackdrop ? null : <Blanket />}
  16. <Content>
  17. {children}
  18. </Content>
  19. </Container>
  20. </Portal>
  21. );
  22. };
  23. export default Modal;