index.tsx 432 B

123456789101112131415161718192021
  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.FC<Props> = ({ children, hideBackdrop = false }: Props) => (
  9. <Portal>
  10. <Container>
  11. {hideBackdrop ? null : <Blanket />}
  12. <Content>{children}</Content>
  13. </Container>
  14. </Portal>
  15. );
  16. export default Modal;