Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import styled from 'styled-components';
- const ModalContent = styled('div')`
- z-index: 10000;
- max-width: 400px;
- margin: auto auto;
- padding: 14px;
- border-radius: 8px;
- background-color: #fff;
- `;
- const ShadedBackground = styled('div')`
- z-index: 500;
- position: fixed;
- display: flex;
- justify-content: center;
- top: 0;
- left: 0;
- background-color: rgba(30, 30, 30, .9);
- width: 100vw;
- height: 100vh;
- `;
- export const Modal = ({children, hideModal}) => {
- return (
- <ShadedBackground onClick={hideModal}>
- <ModalContent>
- {children}
- </ModalContent>
- </ShadedBackground>
- )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement