import variables from 'modules/variables'; import { PureComponent, createRef } from 'react'; import { MdRefresh, MdSettings } from 'react-icons/md'; import Notes from './Notes'; import Todo from './Todo'; import Maximise from '../background/Maximise'; import Tooltip from 'components/helpers/tooltip/Tooltip'; import EventBus from 'modules/helpers/eventbus'; import './scss/index.scss'; export default class Navbar extends PureComponent { constructor() { super(); this.navbarContainer = createRef(); this.refreshEnabled = localStorage.getItem('refresh'); this.refreshValue = localStorage.getItem('refreshOption'); this.state = { classList: localStorage.getItem('widgetStyle') === 'legacy' ? 'navbar old' : 'navbar new', }; } setZoom() { const zoomNavbar = Number((localStorage.getItem('zoomNavbar') || 100) / 100); this.navbarContainer.current.style.fontSize = `${zoomNavbar}em`; } componentDidMount() { EventBus.on('refresh', (data) => { if (data === 'navbar' || data === 'background') { this.refreshEnabled = localStorage.getItem('refresh'); this.refreshValue = localStorage.getItem('refreshOption'); this.forceUpdate(); this.setZoom(); } }); this.setZoom(); } refresh() { switch (this.refreshValue) { case 'background': EventBus.dispatch('refresh', 'backgroundrefresh'); break; case 'quote': EventBus.dispatch('refresh', 'quoterefresh'); break; case 'quotebackground': EventBus.dispatch('refresh', 'quoterefresh'); EventBus.dispatch('refresh', 'backgroundrefresh'); break; default: window.location.reload(); } } render() { const backgroundEnabled = localStorage.getItem('background') === 'true'; const navbar = (
{localStorage.getItem('view') === 'true' && backgroundEnabled ? : null} {localStorage.getItem('notesEnabled') === 'true' ? : null} {localStorage.getItem('todo') === 'true' ? : null} {this.refreshEnabled !== 'false' ? ( ) : null} {/* */}
{/*
New Update The newest update includes a lot of cheese plus urmm donate to david ralph on github.
*/}
); return localStorage.getItem('navbarHover') === 'true' ? (
{navbar}
) : ( navbar ); } }