mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-23 05:24:18 +00:00
27 lines
648 B
JavaScript
27 lines
648 B
JavaScript
|
import React, {useContext} from "react"
|
||
|
import Style from "./Logo.module.css"
|
||
|
import classNames from "classnames"
|
||
|
import LogoDark from "../media/LogoDark.png"
|
||
|
import LogoLight from "../media/LogoLight.png"
|
||
|
import ContextTheme from "../contexts/ContextTheme"
|
||
|
|
||
|
|
||
|
export default function Logo({ children, className, ...props }) {
|
||
|
const theme = useContext(ContextTheme)
|
||
|
|
||
|
let logo;
|
||
|
if(theme === "ThemeDark") {
|
||
|
logo = LogoDark
|
||
|
}
|
||
|
else if(theme === "ThemeLight") {
|
||
|
logo = LogoLight
|
||
|
}
|
||
|
else {
|
||
|
throw new Error(`Unknown theme: ${theme}`)
|
||
|
}
|
||
|
|
||
|
return (
|
||
|
<img src={logo} alt={"N.E.S.T."}/>
|
||
|
)
|
||
|
}
|