diff --git a/src/app/AppLayout/AppLayout.tsx b/src/app/AppLayout/AppLayout.tsx index b2d3e7c6..4c49349b 100644 --- a/src/app/AppLayout/AppLayout.tsx +++ b/src/app/AppLayout/AppLayout.tsx @@ -2,21 +2,32 @@ import * as React from 'react'; import { NavLink, useLocation } from 'react-router-dom'; import { Button, + Icon, Masthead, MastheadBrand, + MastheadContent, MastheadMain, MastheadToggle, - Nav, + Nav, NavExpandable, NavItem, - NavList, - Page, - PageSidebar, + NavList, + Page, + PageSidebar, PageSidebarBody, - SkipToContent + SkipToContent, + Switch, + ToggleGroup, + ToggleGroupItem, + Toolbar, + ToolbarContent, + ToolbarItem, + ToolbarGroup, } from '@patternfly/react-core'; import { IAppRoute, IAppRouteGroup, routes } from '@app/routes'; import { BarsIcon } from '@patternfly/react-icons'; +import MoonIcon from '@patternfly/react-icons/dist/esm/icons/moon-icon'; +import SunIcon from '@patternfly/react-icons/dist/esm/icons/sun-icon'; interface IAppLayout { children: React.ReactNode; @@ -24,6 +35,15 @@ interface IAppLayout { const AppLayout: React.FunctionComponent = ({ children }) => { const [sidebarOpen, setSidebarOpen] = React.useState(true); + const [isDarkTheme, setIsDarkTheme] = React.useState(false); + const [isRTL, setIsRTL] = React.useState(false); + + const toggleDarkTheme = (_evt, selected) => { + const darkThemeToggleClicked = !selected === isDarkTheme; + document.querySelector('html').classList.toggle('pf-v5-theme-dark', darkThemeToggleClicked); + setIsDarkTheme(darkThemeToggleClicked); + }; + const Header = ( @@ -42,7 +62,11 @@ const AppLayout: React.FunctionComponent = ({ children }) => { - + @@ -55,14 +79,64 @@ const AppLayout: React.FunctionComponent = ({ children }) => { - - - + + + + + + + + + + + + + } + isSelected={!isDarkTheme} + onChange={toggleDarkTheme} + /> + + + + } + isSelected={isDarkTheme} + onChange={toggleDarkTheme} + /> + + + + setIsRTL((isRTL) => !isRTL)} + /> + + + + + ); @@ -91,7 +165,7 @@ const AppLayout: React.FunctionComponent = ({ children }) => { @@ -99,29 +173,27 @@ const AppLayout: React.FunctionComponent = ({ children }) => { const Sidebar = ( - - {Navigation} - + {Navigation} ); const pageId = 'primary-app-container'; const PageSkipToContent = ( - { - event.preventDefault(); - const primaryContentContainer = document.getElementById(pageId); - primaryContentContainer && primaryContentContainer.focus(); - }} href={`#${pageId}`}> + { + event.preventDefault(); + const primaryContentContainer = document.getElementById(pageId); + primaryContentContainer && primaryContentContainer.focus(); + }} + href={`#${pageId}`} + > Skip to Content ); + return ( - + {children} ); diff --git a/src/favicon.png b/src/favicon.png index f2e3f564..9dad8a36 100644 Binary files a/src/favicon.png and b/src/favicon.png differ