diff --git a/src/components/App.jsx b/src/components/App.jsx index 038cde4b..5b00d801 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -1,7 +1,7 @@ -import React, { useState, useEffect, useCallback, useMemo } from 'react' +import React, { useCallback } from 'react' import { Route, Routes, Navigate } from 'react-router-dom' import * as rb from 'react-bootstrap' -import { Trans, useTranslation } from 'react-i18next' +import { useTranslation } from 'react-i18next' import Wallets from './Wallets' import CreateWallet from './CreateWallet' import Jam from './Jam' @@ -10,34 +10,23 @@ import Earn from './Earn' import Receive from './Receive' import MainWalletView from './MainWalletView' import Settings from './Settings' -import Navbar from './Navbar' import Layout from './Layout' -import Sprite from './Sprite' -import { useSettings, useSettingsDispatch } from '../context/SettingsContext' -import { useWebsocketState } from '../context/WebsocketContext' +import Navbar from './Navbar' +import Footer from './Footer' +import Onboarding from './Onboarding' +import { useSettings } from '../context/SettingsContext' import { useCurrentWallet, useSetCurrentWallet } from '../context/WalletContext' import { useSessionConnectionError } from '../context/ServiceInfoContext' import { setSession, clearSession } from '../session' -import Onboarding from './Onboarding' -import Cheatsheet from './Cheatsheet' import { routes } from '../constants/routes' -import packageInfo from '../../package.json' export default function App() { const { t } = useTranslation() const settings = useSettings() - const settingsDispatch = useSettingsDispatch() - const websocketState = useWebsocketState() const currentWallet = useCurrentWallet() const setCurrentWallet = useSetCurrentWallet() const sessionConnectionError = useSessionConnectionError() - const [websocketConnected, setWebsocketConnected] = useState() - const [showBetaWarning, setShowBetaWarning] = useState(false) - const [showCheatsheet, setShowCheatsheet] = useState(false) - - const cheatsheetEnabled = useMemo(() => !!currentWallet, [currentWallet]) - const startWallet = useCallback( (name, token) => { setSession({ name, token }) @@ -51,24 +40,6 @@ export default function App() { setCurrentWallet(null) }, [setCurrentWallet]) - // update the connection indicator based on the websocket connection state - useEffect(() => { - setWebsocketConnected(websocketState === WebSocket.OPEN) - }, [websocketState]) - - useEffect(() => { - let timer - // show the cheatsheet once after the first wallet has been created - if (cheatsheetEnabled && settings.showCheatsheet) { - timer = setTimeout(() => { - setShowCheatsheet(true) - settingsDispatch({ showCheatsheet: false }) - }, 1_000) - } - - return () => clearTimeout(timer) - }, [cheatsheetEnabled, settings, settingsDispatch]) - if (settings.showOnboarding === true) { return ( @@ -83,21 +54,6 @@ export default function App() { return ( <> - {showBetaWarning && ( -
- - - {t('footer.warning_alert_title')} -

{t('footer.warning_alert_text')}

-
- setShowBetaWarning(false)}> - {t('footer.warning_alert_button_ok')} - -
-
-
-
- )} {sessionConnectionError && ( @@ -142,94 +98,7 @@ export default function App() { )} - - - -
-
- - This is pre-alpha software. - setShowBetaWarning(true)} - > - Read this before using. - - -
-
-
- {cheatsheetEnabled && ( -
- setShowCheatsheet(false)} /> - - setShowCheatsheet(true)} - > -
- -
{t('footer.cheatsheet')}
-
-
-
-
- )} -
-
- - -
|
-
- ( - - {websocketConnected ? t('footer.connected') : t('footer.disconnected')} - - )} - > - - - - -
-
-
-
+