diff --git a/src/App.jsx b/src/App.jsx index a0d5e38..6f3e7a3 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,16 +1,16 @@ import './styles/App.scss' import {Outlet} from "react-router-dom"; -import {Box} from "@mui/joy"; +import {Sheet} from "@mui/joy"; import Header from "./components/Header.jsx"; function App() { return ( <> -
- - - +
+ + + ) } diff --git a/src/assets/logo NeuraChatAi 100x100 white.png b/src/assets/logo NeuraChatAi 100x100 white.png new file mode 100644 index 0000000..f63a8d9 Binary files /dev/null and b/src/assets/logo NeuraChatAi 100x100 white.png differ diff --git a/src/assets/logo NeuraChatAi white.png b/src/assets/logo NeuraChatAi white.png new file mode 100644 index 0000000..5a24e1c Binary files /dev/null and b/src/assets/logo NeuraChatAi white.png differ diff --git a/src/components/Chat.jsx b/src/components/Chat.jsx index 10c20d0..045f105 100644 --- a/src/components/Chat.jsx +++ b/src/components/Chat.jsx @@ -60,7 +60,7 @@ function Chat() { flex: 1, minHeight: 0, overflowY: 'scroll', - backgroundColor: 'primary.50', + backgroundColor: 'background.level1', pl: {xs: 1, md: 2} }}> {messages.map((el, index) => { diff --git a/src/components/Header.jsx b/src/components/Header.jsx index 3e62f21..827dd2f 100644 --- a/src/components/Header.jsx +++ b/src/components/Header.jsx @@ -1,8 +1,19 @@ -import {Box, GlobalStyles, Sheet, Stack} from "@mui/joy"; +import {Box, GlobalStyles, Sheet, Stack, Typography} from "@mui/joy"; import {Link as RouterLink} from "react-router-dom"; import logoNeuraChatAi from "../assets/logo NeuraChatAi.png" +import logoNeuraChatAiWhite from "../assets/logo NeuraChatAi white.png" +import ModeToggle from "./ModeToggle.jsx"; +import {useEffect, useState} from "react"; +import { useColorScheme } from '@mui/joy/styles'; function Header() { + const {mode} = useColorScheme(); + const [logoHeader, setLogoHeader] = useState(mode) + + useEffect(() => { + mode === 'light' ? setLogoHeader(logoNeuraChatAi) : setLogoHeader(logoNeuraChatAiWhite) + },[mode]) + return ( - - Homepage - About + Homepage + About + ) } diff --git a/src/components/ModeToggle.jsx b/src/components/ModeToggle.jsx new file mode 100644 index 0000000..0efe02b --- /dev/null +++ b/src/components/ModeToggle.jsx @@ -0,0 +1,30 @@ +import {useEffect, useState} from 'react' +import {Button, useColorScheme} from '@mui/joy'; + + +function ModeToggle() { + const { mode, setMode } = useColorScheme(); + const [mounted, setMounted] = useState(false); + + // necessary for server-side rendering + // because mode is undefined on the server + useEffect(() => { + setMounted(true); + }, []); + if (!mounted) { + return null; + } + + return ( + + ); +} + +export default ModeToggle \ No newline at end of file