/* 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, 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 Home from './screens/Home'; import Sources from './screens/Sources'; import Extensions from './screens/Extensions'; import MangaList from './screens/MangaList'; import Manga from './screens/Manga'; import Reader from './screens/Reader'; import Search from './screens/SearchSingle'; import NavBarTitle from './context/NavbarTitle'; import DarkTheme from './context/DarkTheme'; import Library from './screens/Library'; export default function App() { const [title, setTitle] = useState('Tachidesk'); const [darkTheme, setDarkTheme] = useState(true); const navTitleContext = { title, setTitle }; 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 ( ); }