Skip to content

Commit

Permalink
feat(appLogo): add app logo
Browse files Browse the repository at this point in the history
  • Loading branch information
Clm-Roig committed May 5, 2022
1 parent 1ff9f7e commit 9cfa91a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions src/app/AppBar.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
import MenuIcon from '@mui/icons-material/Menu';
import { Box, IconButton, AppBar as MuiAppBar, Toolbar, Typography } from '@mui/material';
import { Box, IconButton, AppBar as MuiAppBar, Toolbar } from '@mui/material';
import { FC } from 'react';
import { Link } from 'react-router-dom';

import { APP_NAME } from '../config/Constants';
import AppLogo from '../assets/images/app-logo.png';
import ThemeMode from '../models/ThemeMode';
import { selectThemeMode } from '../store/theme/theme.selectors';
import { useAppSelector } from './hooks';

// Filter generated using https://codepen.io/sosuke/pen/Pjoqqp
const filterToLightBlueColor =
'invert(62%) sepia(49%) saturate(295%) hue-rotate(177deg) brightness(84%) contrast(84%)';

interface Props {
toggleDrawerMenu: () => void;
}

const AppBar: FC<Props> = ({ toggleDrawerMenu }) => {
const themeMode = useAppSelector(selectThemeMode);

return (
<Box
sx={{
Expand All @@ -25,14 +34,16 @@ const AppBar: FC<Props> = ({ toggleDrawerMenu }) => {
onClick={toggleDrawerMenu}>
<MenuIcon />
</IconButton>
<Typography
component={Link}
to="/"
color="#eee"
variant="h6"
sx={{ flexGrow: 1, textDecoration: 'none' }}>
{APP_NAME}
</Typography>
<Link to="/">
<img
style={{
filter: themeMode === ThemeMode.DARK ? filterToLightBlueColor : 'invert(1)'
}}
height="40px"
src={AppLogo}
alt="App logo"
/>
</Link>
</Toolbar>
</MuiAppBar>
</Box>
Expand Down
Binary file added src/assets/images/app-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9cfa91a

Please sign in to comment.