|
|
@ -6,8 +6,10 @@ import NavbarDrawer from "../NavbarDrawer/NavbarDrawer"; |
|
|
|
import clsx from "clsx"; |
|
|
|
import clsx from "clsx"; |
|
|
|
import proxy from "../../redux/proxy"; |
|
|
|
import proxy from "../../redux/proxy"; |
|
|
|
import { makeStyles } from "@mui/styles"; |
|
|
|
import { makeStyles } from "@mui/styles"; |
|
|
|
import Menu from '../Menu/index'; |
|
|
|
import Menu from "../Menu/index"; |
|
|
|
import logoIcon from '../../assets/icons/logo.png'; |
|
|
|
import logoIcon from "../../assets/icons/logo.png"; |
|
|
|
|
|
|
|
import { connect } from "react-redux"; |
|
|
|
|
|
|
|
import _ from "lodash"; |
|
|
|
|
|
|
|
|
|
|
|
const useStyles = makeStyles({ |
|
|
|
const useStyles = makeStyles({ |
|
|
|
list: { |
|
|
|
list: { |
|
|
@ -20,7 +22,7 @@ const useStyles = makeStyles({ |
|
|
|
}, |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
export default function Navbar(props: any) { |
|
|
|
function Navbar(props: any) { |
|
|
|
const status = proxy.status(); |
|
|
|
const status = proxy.status(); |
|
|
|
const classes = useStyles(); |
|
|
|
const classes = useStyles(); |
|
|
|
const [state, setState] = useState({ |
|
|
|
const [state, setState] = useState({ |
|
|
@ -30,7 +32,7 @@ export default function Navbar(props: any) { |
|
|
|
right: false, |
|
|
|
right: false, |
|
|
|
searchFlag: false, |
|
|
|
searchFlag: false, |
|
|
|
}); |
|
|
|
}); |
|
|
|
const { page } = props; |
|
|
|
const { page, theme } = props; |
|
|
|
|
|
|
|
|
|
|
|
const toggleDrawer = (anchor: any, open: any) => (event: any) => { |
|
|
|
const toggleDrawer = (anchor: any, open: any) => (event: any) => { |
|
|
|
console.log("on"); |
|
|
|
console.log("on"); |
|
|
@ -63,11 +65,18 @@ export default function Navbar(props: any) { |
|
|
|
|
|
|
|
|
|
|
|
const userStatus = proxy.status(); |
|
|
|
const userStatus = proxy.status(); |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<nav className="nav align-items-center justify-content-center"> |
|
|
|
<nav |
|
|
|
|
|
|
|
className={_.join([ |
|
|
|
|
|
|
|
"nav align-items-center justify-content-center", |
|
|
|
|
|
|
|
theme === "light" ? "nav__light" : "nav__dark", |
|
|
|
|
|
|
|
], " ")} |
|
|
|
|
|
|
|
> |
|
|
|
<div className="nav__container d-flex align-items-center justify-content-between"> |
|
|
|
<div className="nav__container d-flex align-items-center justify-content-between"> |
|
|
|
<ul className="nav__container--links desktop align-items-center"> |
|
|
|
<ul className="nav__container--links desktop align-items-center"> |
|
|
|
<li className="nav___logo d-flex align-items-center"> |
|
|
|
<li className="nav___logo d-flex align-items-center"> |
|
|
|
<Link to="/"><img src={logoIcon} alt="" /></Link> |
|
|
|
<Link to="/"> |
|
|
|
|
|
|
|
<img src={logoIcon} alt="" /> |
|
|
|
|
|
|
|
</Link> |
|
|
|
<span></span> |
|
|
|
<span></span> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
@ -76,7 +85,7 @@ export default function Navbar(props: any) { |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
<MenuRoundedIcon |
|
|
|
<MenuRoundedIcon |
|
|
|
className="mobile" |
|
|
|
className="mobile" |
|
|
|
style={{ color: "white", fontSize: 40 }} |
|
|
|
style={{ color: theme === "dark" ? "white" : "black", fontSize: 40 }} |
|
|
|
onClick={toggleDrawer("right", true)} |
|
|
|
onClick={toggleDrawer("right", true)} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<ul className="nav__container--buttons d-flex align-items-center"> |
|
|
|
<ul className="nav__container--buttons d-flex align-items-center"> |
|
|
@ -102,6 +111,10 @@ export default function Navbar(props: any) { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default connect((state: any) => ({ |
|
|
|
|
|
|
|
theme: state.publicApi.theme, |
|
|
|
|
|
|
|
}))(Navbar); |
|
|
|
|
|
|
|
|
|
|
|
Navbar.defaultProps = { |
|
|
|
Navbar.defaultProps = { |
|
|
|
grades: [ |
|
|
|
grades: [ |
|
|
|
{ |
|
|
|
{ |
|
|
@ -153,4 +166,4 @@ Navbar.defaultProps = { |
|
|
|
value: 12, |
|
|
|
value: 12, |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
} |
|
|
|
}; |
|
|
|