added dark mode icons
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
@@ -9,10 +9,11 @@ import {
|
|||||||
Link as MaterialLink,
|
Link as MaterialLink,
|
||||||
Grid,
|
Grid,
|
||||||
} from '@material-ui/core';
|
} from '@material-ui/core';
|
||||||
import SwitchToogle from './switchToogle'
|
import DarkModeToogle from './darkModeToogle'
|
||||||
import CachedOutlinedIcon from '@material-ui/icons/CachedOutlined';
|
import ArtTrackOutlinedIcon from '@material-ui/icons/ArtTrackOutlined';
|
||||||
import { makeStyles } from '@material-ui/styles';
|
import { makeStyles } from '@material-ui/styles';
|
||||||
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
appBar: {
|
appBar: {
|
||||||
position: 'fixed',
|
position: 'fixed',
|
||||||
@@ -23,9 +24,14 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
textTransform: 'uppercase',
|
textTransform: 'uppercase',
|
||||||
letterSpacing: '.5rem',
|
letterSpacing: '.5rem',
|
||||||
},
|
},
|
||||||
cached: {
|
white: {
|
||||||
color: '#a5d6a7',
|
color: "#fff",
|
||||||
},
|
},
|
||||||
|
black: {
|
||||||
|
color: "#000",
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
}));
|
}));
|
||||||
const handleClick = (event) => {
|
const handleClick = (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -42,6 +48,7 @@ const Header = (props) => {
|
|||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { darkMode, setDarkMode } = props;
|
const { darkMode, setDarkMode } = props;
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<CssBaseline />
|
<CssBaseline />
|
||||||
@@ -69,12 +76,12 @@ const Header = (props) => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid item >
|
<Grid item >
|
||||||
<Grid container alignItems="center">
|
<Grid container alignItems="center">
|
||||||
<SwitchToogle
|
<DarkModeToogle
|
||||||
darkMode={darkMode}
|
darkMode={darkMode}
|
||||||
setDarkMode={setDarkMode}
|
setDarkMode={setDarkMode}
|
||||||
/>
|
/>
|
||||||
<Link to="/projects">
|
<Link to="/projects">
|
||||||
<CachedOutlinedIcon className={classes.cached} />
|
<ArtTrackOutlinedIcon className={darkMode ? classes.white: classes.black} />
|
||||||
</Link>
|
</Link>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { makeStyles } from '@material-ui/styles';
|
||||||
|
import WbSunnyOutlinedIcon from '@material-ui/icons/WbSunnyOutlined';
|
||||||
|
import NightsStayOutlinedIcon from '@material-ui/icons/NightsStayOutlined';
|
||||||
|
|
||||||
|
|
||||||
|
const useStyles = makeStyles((theme) => ({
|
||||||
|
white: {
|
||||||
|
color: "#fff",
|
||||||
|
marginRight:'1rem'
|
||||||
|
},
|
||||||
|
black: {
|
||||||
|
color: "#000",
|
||||||
|
marginRight:'1rem'
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
const DarkModeToogle = (props) => {
|
||||||
|
const classes = useStyles();
|
||||||
|
const { darkMode, setDarkMode } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<span onClick={() => setDarkMode(!darkMode)}>
|
||||||
|
{darkMode ?
|
||||||
|
<WbSunnyOutlinedIcon className={classes.white}/> : <NightsStayOutlinedIcon className={classes.black}/>}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default DarkModeToogle;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export { default } from './DarkModeToogle';
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import { Switch } from '@material-ui/core';
|
|
||||||
import { makeStyles } from '@material-ui/styles';
|
|
||||||
import {Brightness3Icon, WbSunnyIcon} from '@material-ui/icons';
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
|
||||||
root: {
|
|
||||||
width: 80,
|
|
||||||
height: 48,
|
|
||||||
padding: 8,
|
|
||||||
},
|
|
||||||
switchBase: {
|
|
||||||
padding: 11,
|
|
||||||
color: '#ff6a00',
|
|
||||||
},
|
|
||||||
thumb: {
|
|
||||||
width: 26,
|
|
||||||
height: 26,
|
|
||||||
backgroundColor: 'transparent',
|
|
||||||
},
|
|
||||||
track: {
|
|
||||||
background: 'linear-gradient(to right, #ee0979, #ff6a00)',
|
|
||||||
opacity: '1 !important',
|
|
||||||
borderRadius: 20,
|
|
||||||
position: 'relative',
|
|
||||||
'&:before, &:after': {
|
|
||||||
display: 'inline-block',
|
|
||||||
position: 'absolute',
|
|
||||||
top: '50%',
|
|
||||||
width: '50%',
|
|
||||||
transform: 'translateY(-50%)',
|
|
||||||
color: '#fff',
|
|
||||||
textAlign: 'center',
|
|
||||||
},
|
|
||||||
'&:before': {
|
|
||||||
left: 4,
|
|
||||||
opacity: 0,
|
|
||||||
},
|
|
||||||
'&:after': {
|
|
||||||
right: 4,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
checked: {
|
|
||||||
'&$switchBase': {
|
|
||||||
color: '#185a9d',
|
|
||||||
transform: 'translateX(32px)',
|
|
||||||
'&:hover': {
|
|
||||||
backgroundColor: 'rgba(24,90,257,0.08)',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
'& $thumb': {
|
|
||||||
backgroundColor: 'transparent',
|
|
||||||
},
|
|
||||||
'& + $track': {
|
|
||||||
background: 'linear-gradient(to right, #43cea2, #185a9d)',
|
|
||||||
'&:before': {
|
|
||||||
opacity: 1,
|
|
||||||
},
|
|
||||||
'&:after': {
|
|
||||||
opacity: 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
const SwitchToogle = (props) => {
|
|
||||||
const classes = useStyles();
|
|
||||||
const { darkMode, setDarkMode } = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Switch
|
|
||||||
disableRipple
|
|
||||||
checked={darkMode}
|
|
||||||
onChange={() => setDarkMode(!darkMode)}
|
|
||||||
classes={{
|
|
||||||
root: classes.root,
|
|
||||||
switchBase: classes.switchBase,
|
|
||||||
thumb: classes.thumb,
|
|
||||||
track: classes.track,
|
|
||||||
checked: classes.checked,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default SwitchToogle;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export { default } from './SwitchToogle';
|
|
||||||
@@ -65,8 +65,6 @@ const About = () => {
|
|||||||
|
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<Typography align="right" inline="true" variant="h6">
|
<Typography align="right" inline="true" variant="h6">
|
||||||
A passionate software developer with affinity for React and AWS.
|
|
||||||
<br />
|
|
||||||
Characterized by the desire of understanding and implementing
|
Characterized by the desire of understanding and implementing
|
||||||
technological innovations.
|
technological innovations.
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
Reference in New Issue
Block a user