diff --git a/client/index.js b/client/index.js index 6b09d493e2..6e1b2c1620 100644 --- a/client/index.js +++ b/client/index.js @@ -5,6 +5,7 @@ import { store } from './src/store'; import { ThemeProvider } from './src/hooks/ThemeContext'; import App from './src/App'; import './src/style.css'; +import './src/mobile.css' const container = document.getElementById('root'); const root = createRoot(container); diff --git a/client/src/App.jsx b/client/src/App.jsx index f0d9dd62c6..9bab1f5939 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import Messages from './components/Messages'; import Landing from './components/Main/Landing'; import TextChat from './components/Main/TextChat'; @@ -10,14 +10,16 @@ import { useSelector } from 'react-redux'; const App = () => { const { messages } = useSelector((state) => state.messages); const { title } = useSelector((state) => state.convo); + const { conversationId } = useSelector((state) => state.convo); + const [ navVisible, setNavVisible ]= useState(false) useDocumentTitle(title); return (
-
+ - +
+
+ ); } diff --git a/client/src/mobile.css b/client/src/mobile.css new file mode 100644 index 0000000000..e633ecaea3 --- /dev/null +++ b/client/src/mobile.css @@ -0,0 +1,55 @@ +.nav-mask { + position: fixed; + z-index: 998; + left: 0; + right: 0; + top: 0; + bottom: 0; + background-color: rgba(86, 88, 105, .75); + padding-left: 420px; + padding-top: 12px; + opacity: 0; + transition: all .5s; + pointer-events: none; +} + +.nav { + transition: all .5s; +} + +.nav-close-button { + display: none; +} + +@media (max-width: 767px) { + .nav-close-button { + display: block; + position: absolute; + left: 100%; + top: 12px; + margin-left: 20px; + } + + .nav { + position: fixed; + z-index: 999; + left: calc(-100%);; + top: 0; + bottom: 0; + max-width: 400px; + width: calc(100% - 60px); + opacity: 0; + } + + .nav.active { + left: 0; + opacity: 1; + } + + .nav-mask.active { + opacity: 1; + pointer-events: auto; + } +} + + \ No newline at end of file