diff --git a/client/components/useAsModal.jsx b/client/components/useAsModal.jsx index 5dbeb82a..4e124435 100644 --- a/client/components/useAsModal.jsx +++ b/client/components/useAsModal.jsx @@ -1,11 +1,24 @@ import React from 'react'; +import styled from 'styled-components'; import { useModalBehavior } from '../utils/custom-hooks'; +const BackgroundOverlay = styled.div` + position: absolute; + z-index: 2; + width: 100% !important; + height: 100% !important; + + background: black; + opacity: 0.3; +`; -export default (component) => { - const [visible, trigger, setRef] = useModalBehavior(); +export default (component, hasOverlay = false) => { + const [visible, toggle, setRef] = useModalBehavior(); - const wrapper = () =>
{visible && component}
; // eslint-disable-line + const wrapper = () => (
+ {hasOverlay && visible && } +
{visible && component}
+
); // eslint-disable-line - return [trigger, wrapper]; + return [toggle, wrapper]; }; diff --git a/client/modules/IDE/pages/MobileIDEView.jsx b/client/modules/IDE/pages/MobileIDEView.jsx index 3d48f7f9..a008c079 100644 --- a/client/modules/IDE/pages/MobileIDEView.jsx +++ b/client/modules/IDE/pages/MobileIDEView.jsx @@ -99,7 +99,7 @@ const MobileIDEView = (props) => { const [toggleExplorer, Explorer] = useAsModal( {}} - />); + />, true); // toggle sidebar starting opened useEffect(toggleExplorer, []);