/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import React, { useState } from 'react'; import { BrowserRouter as Router, Redirect, Route, Switch, } from 'react-router-dom'; import { Container } from '@material-ui/core'; import CssBaseline from '@material-ui/core/CssBaseline'; import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles'; import NavBar from './components/NavBar'; import Sources from './screens/Sources'; import Extensions from './screens/Extensions'; import SourceMangas from './screens/SourceMangas'; import Manga from './screens/Manga'; import Reader from './screens/Reader'; import Search from './screens/SearchSingle'; import NavbarContext from './context/NavbarContext'; import DarkTheme from './context/DarkTheme'; import Library from './screens/Library'; import Settings from './screens/Settings'; import Categories from './screens/settings/Categories'; import useLocalStorage from './util/useLocalStorage'; export default function App() { const [title, setTitle] = useState('Tachidesk'); const [action, setAction] = useState(
); const [darkTheme, setDarkTheme] = useLocalStorage('darkTheme', true); const navBarContext = { title, setTitle, action, setAction, }; const darkThemeContext = { darkTheme, setDarkTheme }; const theme = React.useMemo( () => createMuiTheme({ palette: { type: darkTheme ? 'dark' : 'light', }, overrides: { MuiCssBaseline: { '@global': { '*::-webkit-scrollbar': { width: '10px', background: darkTheme ? '#222' : '#e1e1e1', }, '*::-webkit-scrollbar-thumb': { background: darkTheme ? '#111' : '#aaa', borderRadius: '5px', }, }, }, }, }), [darkTheme], ); return ( ( )} /> ); }