From e0fd7582b8a03aafebe5530716bad836712e65bc Mon Sep 17 00:00:00 2001 From: Sergio Betanzos Date: Fri, 26 Mar 2021 10:30:37 +0100 Subject: [PATCH] M #~: Fix logo in dark mode (#1031) --- .../src/client/components/Sidebar/index.js | 5 +--- .../src/client/components/Sidebar/styles.js | 9 ++----- src/fireedge/src/client/icons/logo.js | 26 +++++++++++-------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/fireedge/src/client/components/Sidebar/index.js b/src/fireedge/src/client/components/Sidebar/index.js index 05087a3d40..92f459347a 100644 --- a/src/fireedge/src/client/components/Sidebar/index.js +++ b/src/fireedge/src/client/components/Sidebar/index.js @@ -73,10 +73,7 @@ const Sidebar = memo(({ endpoints }) => { withText className={classes.svg} /> - + {isUpLg ? : } diff --git a/src/fireedge/src/client/components/Sidebar/styles.js b/src/fireedge/src/client/components/Sidebar/styles.js index c8e82ae477..dafd3a3827 100644 --- a/src/fireedge/src/client/components/Sidebar/styles.js +++ b/src/fireedge/src/client/components/Sidebar/styles.js @@ -70,12 +70,10 @@ export default makeStyles(theme => ({ // ------------------------------- header: { userSelect: 'none', - backgroundColor: theme.palette.type === 'dark' - ? theme.palette.background.paper - : theme.palette.primary.main, - color: theme.palette.primary.contrastText, + backgroundColor: theme.palette.background.paper, display: 'flex', alignItems: 'center', + justifyContent: 'space-between', padding: '1rem', overflow: 'hidden', height: toolbar.regular, @@ -132,8 +130,5 @@ export default makeStyles(theme => ({ color: theme.palette.text.primary, backgroundColor: theme.palette.primary.light, '&:hover': { backgroundColor: theme.palette.primary.light } - }, - hamburger: { - color: theme.palette.primary.contrastText } })) diff --git a/src/fireedge/src/client/icons/logo.js b/src/fireedge/src/client/icons/logo.js index 47381fbfe6..064cafe7b5 100644 --- a/src/fireedge/src/client/icons/logo.js +++ b/src/fireedge/src/client/icons/logo.js @@ -1,18 +1,22 @@ import React, { memo } from 'react' import { number, string, bool, oneOfType } from 'prop-types' +import { useTheme } from '@material-ui/core' const Logo = memo(({ width, height, spinner, withText, viewBox, ...props }) => { + const { palette: { type } } = useTheme() + const isDarkMode = type === 'dark' + const cloudColor = { - child1: { from: '#0098c3', to: '#ffffff' }, - child2: { from: '#0098c3', to: '#ffffff' }, - child3: { from: '#40b3d9', to: '#ffffff' }, - child4: { from: '#80cde6', to: '#ffffff' }, - child5: { from: '#bfe6f2', to: '#ffffff' } + child1: { from: '#bfe6f2', to: '#ffffff', static: isDarkMode ? '#ffffff' : '#bfe6f2' }, + child2: { from: '#80cde6', to: '#ffffff', static: isDarkMode ? '#ffffff' : '#80cde6' }, + child3: { from: '#40b3d9', to: '#ffffff', static: isDarkMode ? '#ffffff' : '#40b3d9' }, + child4: { from: '#0098c3', to: '#ffffff', static: isDarkMode ? '#ffffff' : '#0098c3' }, + child5: { from: '#0098c3', to: '#ffffff', static: isDarkMode ? '#ffffff' : '#0098c3' } } const textColor = { top: 'currentColor', - bottom: '#0098c3' + bottom: isDarkMode ? 'currentColor' : '#0098c3' } return ( @@ -40,23 +44,23 @@ const Logo = memo(({ width, height, spinner, withText, viewBox, ...props }) => { )} {/* --------------- CLOUD ------------------ */}