fixes Reader navbar colors when in light mode (#43)

* fixed the navbar color when in lightmode

* Used the grey options available in the Theme object
- Added the package-lock.json

* removed package-lock.json

* Changed the colors in the navabr to the closest available color in the Theme object in Material UI

* Made the sidebar close button available even the staticNavbar setting is set to true

* reverted the changes to the .gitignore
This commit is contained in:
abhijeetChawla
2021-10-17 16:18:30 +05:30
committed by GitHub
parent 7053273b61
commit 2049c329d7

View File

@@ -29,7 +29,7 @@ import Collapse from '@mui/material/Collapse';
import Button from '@mui/material/Button'; import Button from '@mui/material/Button';
import NavBarContext from '../../context/NavbarContext'; import NavBarContext from '../../context/NavbarContext';
const useStyles = (settings: IReaderSettings) => makeStyles({ const useStyles = (settings: IReaderSettings) => makeStyles((theme) => ({
// main container and root div need to change classes... // main container and root div need to change classes...
AppMainContainer: { AppMainContainer: {
display: 'none', display: 'none',
@@ -46,10 +46,11 @@ const useStyles = (settings: IReaderSettings) => makeStyles({
minWidth: '300px', minWidth: '300px',
height: '100vh', height: '100vh',
overflowY: 'auto', overflowY: 'auto',
backgroundColor: '#0a0b0b', backgroundColor: theme.palette.background.default,
'& header': { '& header': {
backgroundColor: '#363b3d', backgroundColor:
theme.palette.mode === 'dark' ? theme.palette.grey[800] : theme.palette.grey[100],
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
minHeight: '64px', minHeight: '64px',
@@ -80,7 +81,7 @@ const useStyles = (settings: IReaderSettings) => makeStyles({
margin: '0 16px', margin: '0 16px',
height: '1px', height: '1px',
border: '0', border: '0',
backgroundColor: 'rgb(38, 41, 43)', backgroundColor: theme.palette.mode === 'dark' ? theme.palette.grey[800] : theme.palette.grey[100],
}, },
}, },
@@ -128,13 +129,13 @@ const useStyles = (settings: IReaderSettings) => makeStyles({
height: '40px', height: '40px',
width: '40px', width: '40px',
borderRadius: 5, borderRadius: 5,
backgroundColor: 'black', backgroundColor: theme.palette.mode === 'dark' ? 'black' : 'white',
'&:hover': { '&:hover': {
backgroundColor: 'black', backgroundColor: theme.palette.mode === 'dark' ? theme.palette.grey[900] : theme.palette.grey[100],
}, },
}, },
}); }));
export const defaultReaderSettings = () => ({ export const defaultReaderSettings = () => ({
staticNav: false, staticNav: false,
@@ -208,8 +209,6 @@ export default function ReaderNavBar(props: IProps) {
> >
<div className={classes.root}> <div className={classes.root}>
<header> <header>
{!settings.staticNav
&& (
<IconButton <IconButton
edge="start" edge="start"
color="inherit" color="inherit"
@@ -220,7 +219,6 @@ export default function ReaderNavBar(props: IProps) {
> >
<KeyboardArrowLeftIcon /> <KeyboardArrowLeftIcon />
</IconButton> </IconButton>
) }
<Typography variant="h1"> <Typography variant="h1">
{/* {title} */} {/* {title} */}
{chapter.name} {chapter.name}