import React, { useContext } from 'react'; import { HashRouter, BrowserRouter, Switch, Route } from 'react-router-dom'; import { Box, Slide, Typography } from '@mui/material'; import RobotPage from './RobotPage'; import MakerPage from './MakerPage'; import BookPage from './BookPage'; import OrderPage from './OrderPage'; import SettingsPage from './SettingsPage'; import NavBar from './NavBar'; import MainDialogs from './MainDialogs'; import RobotAvatar from '../components/RobotAvatar'; import { useTranslation } from 'react-i18next'; import Notifications from '../components/Notifications'; import { AppContextProps, AppContext } from '../contexts/AppContext'; const Main = (): JSX.Element => { const { t } = useTranslation(); const { settings, robot, setRobot, baseUrl, order, page, setPage, slideDirection, closeAll, setOpen, windowSize, navbarHeight, } = useContext(AppContext); const Router = window.NativeRobosats === undefined ? BrowserRouter : HashRouter; const basename = window.NativeRobosats === undefined ? '' : window.location.pathname; return ( setRobot({ ...robot, avatarLoaded: true })} /> setOpen({ ...closeAll, profile: true })} rewards={robot.earnedRewards} setPage={setPage} windowWidth={windowSize.width} /> {settings.network === 'testnet' ? (
{t('Using Testnet Bitcoin')}
) : ( <> )} (
)} />
(
)} />
); }; export default Main;