diff --git a/webui/package.json b/webui/package.json index dff5dd1..2244e3f 100644 --- a/webui/package.json +++ b/webui/package.json @@ -17,6 +17,7 @@ "@types/react-relay": "^13.0.1", "@types/relay-runtime": "^13.0.2", "axios": "^0.26.0", + "hamburger-react": "^2.4.1", "i18next": "^21.6.13", "i18next-browser-languagedetector": "^6.1.3", "i18next-http-backend": "^1.3.2", diff --git a/webui/src/components/panel/dashboard/Dashboard.module.scss b/webui/src/components/panel/dashboard/Dashboard.module.scss index c421180..84e174c 100644 --- a/webui/src/components/panel/dashboard/Dashboard.module.scss +++ b/webui/src/components/panel/dashboard/Dashboard.module.scss @@ -3,15 +3,15 @@ .dashboardGrid { height: 90%; display: grid; - - grid-template-columns: 1fr 1fr 1fr; - grid-template-rows: 1fr; gap: var(--veles-layout-padding); - @media (max-width: 1300px) { + /*grid-template-columns: 1fr 1fr 1fr; + grid-template-rows: 1fr; + + @media (max-width: 1300px) {*/ grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; - } + //} @media (max-width: 950px) { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr 1fr; diff --git a/webui/src/layouts/PanelLayout.module.scss b/webui/src/layouts/PanelLayout.module.scss index e0c1a9b..0e4b506 100644 --- a/webui/src/layouts/PanelLayout.module.scss +++ b/webui/src/layouts/PanelLayout.module.scss @@ -1,5 +1,7 @@ @import "../globals"; +$navBreakpoint: 1000px; + .skipToContent { opacity: 0; pointer-events: none; @@ -62,6 +64,21 @@ border-bottom: thin solid var(--veles-color-border); height: 66px; + .hamburger { + padding: 8px 0 8px 10px; + display: none; + } + + @media(max-width: 600px) { + .hamburger { + display: block; + } + + >*>span { + display: none; + } + } + a, button { @include panelTopBarLink; } @@ -85,6 +102,27 @@ flex-shrink: 0; } + .navUnderlay { + display: none; + position: absolute; + width: 100%; + z-index: 900; + background-color: rgba(0, 0, 0, .75); + height: 100%; + opacity: 0; + pointer-events: none; + transition: opacity .25s; + + @media(max-width: $navBreakpoint) { + display: block; + opacity: 0; + &.show { + opacity: 1; + pointer-events: auto; + } + } + } + > nav { display: flex; flex-direction: column; @@ -92,6 +130,23 @@ overflow-x: auto; height: calc(100vh - 66px); width: 250px; + background-color: var(--veles-color-background); + transition: left .25s; + + @media (max-width: $navBreakpoint) { + left: -250px; + position: absolute; + z-index: 1000; + + &.expanded { + left: 0; + } + } + + @media (max-width: 400px) { + left: -100%; + width: 100%; + } >* { flex-shrink: 0; diff --git a/webui/src/layouts/PanelLayout.tsx b/webui/src/layouts/PanelLayout.tsx index 33b42aa..df9d1ad 100644 --- a/webui/src/layouts/PanelLayout.tsx +++ b/webui/src/layouts/PanelLayout.tsx @@ -1,18 +1,21 @@ import React, {useState} from "react"; import {Link, NavLink, useOutlet} from "react-router-dom"; -import {Home, List, ClipboardList, ExternalLink, ChevronRight, MessageSquare, LogOut} from "lucide-react"; +import {Home, List, ClipboardList, BookOpen, ChevronRight, MessageSquare, LogOut} from "lucide-react"; +import { Squash as Hamburger } from 'hamburger-react'; import {ReactComponent as Logo} from "../logo.svg"; import styles from "./PanelLayout.module.scss"; -import {Trans} from "react-i18next"; +import {Trans, useTranslation} from "react-i18next"; import {useAppDispatch} from "../app/hooks"; import {logOut} from "../features/auth/authSlice"; const PanelLayout = () => { + const {t} = useTranslation() const outlet = useOutlet(); const [hashingExpanded, setHashingExpanded] = useState(false) + const [sideNavExpanded, setSideNavExpanded] = useState(true) const dispatch = useAppDispatch() @@ -20,20 +23,24 @@ const PanelLayout = () => { Jump to Content Jump to Navigation
+
+ +
Matrix-Veles - Documentation - + Documentation +
-