nimbus-gui/src/App.tsx

88 lines
2.7 KiB
TypeScript
Raw Normal View History

import { TamaguiProvider, Theme } from 'tamagui'
import { createBrowserRouter, RouterProvider } from 'react-router-dom'
2023-08-07 08:24:37 +00:00
import { Provider as StatusProvider } from '@status-im/components'
import { Web3OnboardProvider, init } from '@web3-onboard/react'
import injectedModule from '@web3-onboard/injected-wallets'
import walletConnectModule from '@web3-onboard/walletconnect'
import { useSelector } from 'react-redux'
import config from '../tamagui.config'
import LandingPage from './pages/LandingPage/LandingPage'
2023-08-11 10:04:02 +00:00
import DeviceHealthCheck from './pages/DeviceHealthCheck/DeviceHealthCheck'
import ConnectDevicePage from './pages/ConnectDevicePage/ConnectDevicePage'
import { RootState } from './redux/store'
2023-08-15 10:27:18 +00:00
import DeviceSyncStatus from './pages/DeviceSyncStatus/DeviceSyncStatus'
import PairDevice from './pages/PairDevice/PairDevice'
2023-08-18 11:58:26 +00:00
import PinnedNotification from './components/General/PinnedNottification'
import CreateLocalNodePage from './pages/CreateLocalNodePage/CreateLocalNodePage'
2023-08-23 07:10:52 +00:00
import ValidatorOnboarding from './pages/ValidatorOnboarding/ValidatorOnboarding'
import { ethereumRopsten, wcV2InitOptions, apiKey } from './constants'
2023-09-11 09:14:07 +00:00
import Dashboard from './pages/Dashboard/Dashboard'
2023-09-22 11:21:43 +00:00
import ConnectExistingInstance from './pages/ConnectExistingInstance/ConnectExistingInstance'
2023-10-10 18:20:19 +00:00
import './App.css'
2023-10-12 14:44:17 +00:00
const injected = injectedModule()
const walletConnect = walletConnectModule(wcV2InitOptions)
const chains = [ethereumRopsten]
const wallets = [injected, walletConnect]
const web3Onboard = init({
apiKey,
wallets,
chains,
appMetadata: {
name: 'Web3-Onboard Demo',
icon: '<svg>App Icon</svg>',
description: 'A demo of Web3-Onboard.',
},
})
2023-08-07 08:24:37 +00:00
const router = createBrowserRouter([
{
path: '/',
element: <LandingPage />,
},
2023-08-11 10:04:02 +00:00
{
path: '/device-health-check',
element: <DeviceHealthCheck />,
},
2023-08-15 06:43:36 +00:00
{
path: '/connect-device',
element: <ConnectDevicePage />,
2023-08-16 06:12:32 +00:00
},
{
2023-08-15 06:52:16 +00:00
path: '/device-sync-status',
element: <DeviceSyncStatus />,
2023-08-16 07:44:33 +00:00
},
{
path: '/pair-device',
element: <PairDevice />,
2023-08-16 07:44:33 +00:00
},
2023-09-22 11:21:43 +00:00
{
path: '/pair-existing-instance',
element: <ConnectExistingInstance />,
},
{ path: '/create-local-node', element: <CreateLocalNodePage /> },
2023-08-23 07:10:52 +00:00
{ path: '/validator-onboarding', element: <ValidatorOnboarding /> },
2023-09-11 09:14:07 +00:00
{ path: '/dashboard', element: <Dashboard /> },
])
function App() {
2023-08-23 10:26:55 +00:00
const theme = useSelector((state: RootState) => state.theme)
2023-08-03 06:20:54 +00:00
return (
2023-08-23 10:26:55 +00:00
<TamaguiProvider config={config}>
<Web3OnboardProvider web3Onboard={web3Onboard}>
<StatusProvider>
<Theme name={theme}>
<PinnedNotification />
<RouterProvider router={router} />
</Theme>
</StatusProvider>
</Web3OnboardProvider>
2023-08-23 10:26:55 +00:00
</TamaguiProvider>
2023-08-03 06:20:54 +00:00
)
}
export default App