From 9d01a83f17b4586d0b110f9db73fced42ec81f5c Mon Sep 17 00:00:00 2001 From: Spectralitree <72747870+Spectralitree@users.noreply.github.com> Date: Sat, 26 Jun 2021 20:12:56 +0200 Subject: [PATCH] move settings to own file --- src/App.js | 95 ++------------------------------------ src/Pages/Settings.js | 104 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 92 deletions(-) create mode 100644 src/Pages/Settings.js diff --git a/src/App.js b/src/App.js index 5e76b2b4..a6b0e694 100644 --- a/src/App.js +++ b/src/App.js @@ -7,13 +7,14 @@ import useDarkMode from 'use-dark-mode'; import './App.scss'; import 'bootstrap/dist/css/bootstrap.min.css'; import "react-toggle/style.css" -import { FaCog, FaSun, FaMoon } from "react-icons/fa"; +import { FaSun, FaMoon } from "react-icons/fa"; import Dash from './Pages/Dash.js' import history from "./History.js"; import Footer from './Components/Footer.js' import Public from './Pages/Public.js' import Home from './Pages/Home.js' +import Settings from './Pages/Settings.js' export default function App() { const [isLoading, setIsLoading] = useState(false); @@ -68,97 +69,7 @@ export default function App() { - - - Settings - - -

Change how you view and use pk-webs here, changes will be saved after refreshing. You will have to apply them again in different browsers and on different devices.

-
- - - { localStorage.getItem('opendyslexic') ? - { - localStorage.removeItem('opendyslexic'); - forceUpdate()}} /> : - { - localStorage.setItem('opendyslexic', 'true') - forceUpdate()}} /> } - Use opendyslexic? - - - { localStorage.getItem('twemoji') ? - { - localStorage.removeItem('twemoji'); - forceUpdate()}} /> : - { - localStorage.setItem('twemoji', 'true') - forceUpdate()}} /> } - Use twemoji? - - - { localStorage.getItem('pagesonly') ? - { - localStorage.removeItem('pagesonly'); - forceUpdate()}} /> : - { - localStorage.setItem('pagesonly', 'true') - forceUpdate()}} /> } - Use only member pages? - - - { localStorage.getItem('colorbg') ? - { - localStorage.removeItem('colorbg'); - forceUpdate()}} /> : - { - localStorage.setItem('colorbg', 'false') - forceUpdate()}} /> } - Hide colored backgrounds? - - - { localStorage.getItem('expandcards') ? - { - localStorage.removeItem('expandcards'); - forceUpdate()}} /> : - { - localStorage.setItem('expandcards', 'true') - forceUpdate()}} /> } - Expand member cards on default? - - -
-
+
diff --git a/src/Pages/Settings.js b/src/Pages/Settings.js new file mode 100644 index 00000000..28f48619 --- /dev/null +++ b/src/Pages/Settings.js @@ -0,0 +1,104 @@ +import React from 'react'; + +import * as BS from "react-bootstrap"; +import { FaCog } from "react-icons/fa"; +import Toggle from 'react-toggle' + +const Settings = ({forceUpdate}) => { + + return ( + + + Settings + + +

Change how you view and use pk-webs here, changes will be saved after refreshing. You will have to apply them again in different browsers and on different devices.

+
+ + + { localStorage.getItem('opendyslexic') ? + { + localStorage.removeItem('opendyslexic'); + forceUpdate()}} /> : + { + localStorage.setItem('opendyslexic', 'true') + forceUpdate()}} /> } + Use opendyslexic? + + + { localStorage.getItem('twemoji') ? + { + localStorage.removeItem('twemoji'); + forceUpdate()}} /> : + { + localStorage.setItem('twemoji', 'true') + forceUpdate()}} /> } + Use twemoji? + + + { localStorage.getItem('pagesonly') ? + { + localStorage.removeItem('pagesonly'); + forceUpdate()}} /> : + { + localStorage.setItem('pagesonly', 'true') + forceUpdate()}} /> } + Use only member pages? + + + { localStorage.getItem('colorbg') ? + { + localStorage.removeItem('colorbg'); + forceUpdate()}} /> : + { + localStorage.setItem('colorbg', 'false') + forceUpdate()}} /> } + Hide colored backgrounds? + + + { localStorage.getItem('expandcards') ? + { + localStorage.removeItem('expandcards'); + forceUpdate()}} /> : + { + localStorage.setItem('expandcards', 'true') + forceUpdate()}} /> } + Expand member cards on default? + + +
+
+ ); +}; + +export default Settings; \ No newline at end of file