From e0d2536d6f160413fb0c6d328591c52934268cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Wed, 22 Mar 2023 14:39:02 +0000 Subject: [PATCH] feat: dark mode switch (#3370) https://linear.app/unleash/issue/1-802/replace-the-dark-mode-switch image image **Note**: The second screenshot does not show the dark theme because that's part of https://github.com/Unleash/unleash/pull/3298 Improves the dark mode switch to be a simple IconButton that acts as a flip switch. --- frontend/src/component/menu/Header/Header.tsx | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/frontend/src/component/menu/Header/Header.tsx b/frontend/src/component/menu/Header/Header.tsx index 677d2b5a33..21d20682d9 100644 --- a/frontend/src/component/menu/Header/Header.tsx +++ b/frontend/src/component/menu/Header/Header.tsx @@ -5,10 +5,8 @@ import { Link } from 'react-router-dom'; import { AppBar, Container, - FormControlLabel, IconButton, Tooltip, - Switch, styled, Theme, } from '@mui/material'; @@ -31,7 +29,11 @@ import { adminMenuRoutes, getCondensedRoutes, } from 'component/menu/routes'; -import { KeyboardArrowDown } from '@mui/icons-material'; +import { + DarkModeOutlined, + KeyboardArrowDown, + LightModeOutlined, +} from '@mui/icons-material'; import { filterByConfig } from 'component/common/util'; import { useAuthPermissions } from 'hooks/api/getters/useAuth/useAuthPermissions'; import { useId } from 'hooks/useId'; @@ -239,15 +241,25 @@ const Header: VFC = () => { uiConfig.flags.ENABLE_DARK_MODE_SUPPORT )} show={ - + + arrow + > + + } + elseShow={} + /> + + } />