Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import styled from 'styled-components';
  2.  
  3. const ModalContent = styled('div')`
  4.   z-index: 10000;
  5.   max-width: 400px;
  6.   margin: auto auto;
  7.   padding: 14px;
  8.   border-radius: 8px;
  9.   background-color: #fff;
  10. `;
  11. const ShadedBackground = styled('div')`
  12.   z-index: 500;
  13.   position: fixed;
  14.   display: flex;
  15.   justify-content: center;
  16.   top: 0;
  17.   left: 0;
  18.   background-color: rgba(30, 30, 30, .9);
  19.   width: 100vw;
  20.   height: 100vh;
  21. `;
  22.  
  23. export const Modal = ({children, hideModal}) => {
  24.     return (
  25.         <ShadedBackground onClick={hideModal}>
  26.             <ModalContent>
  27.                 {children}
  28.             </ModalContent>
  29.         </ShadedBackground>
  30.     )
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement