import React, { useContext } from 'react'; import { MemoryRouter, BrowserRouter, Routes, 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 { UseAppStoreType, AppContext, closeAll } from '../contexts/AppContext'; const Router = window.NativeRobosats === undefined ? BrowserRouter : MemoryRouter; const Main = (): JSX.Element => { const { t } = useTranslation(); const { settings, robot, setRobot, baseUrl, order, page, setPage, slideDirection, setOpen, windowSize, navbarHeight, } = useContext(AppContext); return ( setRobot((robot) => { return { ...robot, avatarLoaded: true }; }) } /> setOpen({ ...closeAll, profile: true })} rewards={robot.earnedRewards} setPage={setPage} windowWidth={windowSize.width} /> {settings.network === 'testnet' ? (
{t('Using Testnet Bitcoin')}
) : ( <> )} {['/robot/:refCode?', '/', ''].map((path, index) => { return (
} key={index} /> ); })}
} />
} />
} />
} />
); }; export default Main;