import React, { Component , Suspense } from "react"; import ReactDOM from 'react-dom/client'; import HomePage from "./HomePage"; import { CssBaseline, IconButton , Link} from "@mui/material"; import { ThemeProvider, createTheme } from '@mui/material/styles'; import UnsafeAlert from "./UnsafeAlert"; import { LearnDialog } from "./Dialogs"; import { I18nextProvider } from "react-i18next"; import i18n from "./i18n"; //Icons import DarkModeIcon from '@mui/icons-material/DarkMode'; import LightModeIcon from '@mui/icons-material/LightMode'; import SchoolIcon from '@mui/icons-material/School'; import ZoomOutIcon from '@mui/icons-material/ZoomOut'; export default class App extends Component { constructor(props) { super(props); this.state = { dark: window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches, openLearn: false, theme: {typography: { fontSize: 14 }}, } } lightTheme = createTheme ({}); darkTheme = createTheme({ palette: { mode: 'dark', background: { default: "#070707" }, }, }); onZoomOutClick = () => { this.setState(({theme}) => ({ theme: { ...theme, typography: { fontSize: this.state.theme.typography.fontSize - 1, }, } })); } render() { return ( this.setState({openLearn:false})}/> this.setState({openLearn:true})}> this.setState({dark:!this.state.dark})}> {this.state.dark ? :} ); } } const root = ReactDOM.createRoot( document.getElementById("app") ); root.render();