overlay.js 682 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. const Overlay = props => {
  2. return (
  3. <div id='overlay'>
  4. <main>
  5. {props.children}
  6. <button onClick={props.close}>X</button>
  7. </main>
  8. <style jsx>
  9. {`
  10. #overlay {
  11. position: fixed;
  12. height: 100vh;
  13. width: 100vw;
  14. top: 0;
  15. left: 0;
  16. background: rgba(10,10,10,0.4);
  17. }
  18. main {
  19. position: relative;
  20. max-width: 800px;
  21. margin: auto auto;
  22. background: white;
  23. }
  24. button {
  25. position: absolute;
  26. right: 0;
  27. top: 0;
  28. }
  29. `}
  30. </style>
  31. </div>
  32. )
  33. }
  34. export default Overlay