From c060f5a398a126fd93b6ef5fea2de2761c31ba19 Mon Sep 17 00:00:00 2001 From: William Tran Date: Mon, 28 Jun 2021 15:31:09 -0400 Subject: [PATCH] Add scrolling --- components/OrganizedContent.module.css | 19 ++++++++++++------- components/OrganizedContent.tsx | 8 +++++++- pages/playground.mdx | 12 ------------ 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/components/OrganizedContent.module.css b/components/OrganizedContent.module.css index cc597ed2..e5a3f29c 100644 --- a/components/OrganizedContent.module.css +++ b/components/OrganizedContent.module.css @@ -107,17 +107,12 @@ width: 1rem; } -@media only screen and (max-width: calc(768rem / 16)) { - .organizedContent > .nav { - display: none; - } -} .burger { position: absolute; top: 5%; left: 2rem; - display: flex; + display: none; flex-direction: column; justify-content: space-around; width: 2rem; @@ -175,7 +170,7 @@ flex-direction: column; justify-content: center; background: var(--light-blue-1); - width: 90%; + width: 80%; height: 100vh; text-align: left; padding: 2rem; @@ -202,3 +197,13 @@ transition: color 0.3s linear; } + +@media only screen and (max-width: calc(768rem / 16)) { + .burger { + display: flex; + } + .organizedContent > .nav { + display: none; + } + +} \ No newline at end of file diff --git a/components/OrganizedContent.tsx b/components/OrganizedContent.tsx index 243323c0..1d7ff46e 100644 --- a/components/OrganizedContent.tsx +++ b/components/OrganizedContent.tsx @@ -3,7 +3,7 @@ import React, { ComponentType, useState, //useRef, - //useEffect, + useEffect, } from "react"; import styles from "./OrganizedContent.module.css"; @@ -83,6 +83,12 @@ export const OrganizedContent = ({ childProps: childProps, }; + useEffect(() => { + open + ? (document.body.style.overflow = "hidden") + : (document.body.style.overflow = "visible"); + }, [open]); + return (