index.tsx 468 B

1234567891011121314151617181920212223242526
  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. }: Props) => (
  12. <Portal>
  13. <Container>
  14. {hideBackdrop ? null : <Blanket />}
  15. <Content>
  16. {children}
  17. </Content>
  18. </Container>
  19. </Portal>
  20. );
  21. export default Modal;