47 lines
1.0 KiB
JavaScript
47 lines
1.0 KiB
JavaScript
import React from 'react';
|
|
import ReactDOM from 'react-dom/client';
|
|
import { MetaMaskProvider } from '@metamask/sdk-react';
|
|
import 'bootswatch/dist/slate/bootstrap.min.css';
|
|
import './App.css';
|
|
import {
|
|
createBrowserRouter,
|
|
RouterProvider,
|
|
} from 'react-router-dom';
|
|
|
|
import WebApp from './WebApp';
|
|
import Widget from './Widget';
|
|
import MainContextProvider from './contexts/MainContextProvider';
|
|
|
|
const router = createBrowserRouter([
|
|
{
|
|
path: '/',
|
|
element: <WebApp />,
|
|
},
|
|
{
|
|
path: 'widget/',
|
|
element: <Widget />,
|
|
},
|
|
]);
|
|
|
|
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
<React.StrictMode>
|
|
<MetaMaskProvider
|
|
debug={false}
|
|
sdkOptions={{
|
|
dappMetadata: {
|
|
name: 'DGF Prototype',
|
|
url: window.location.href,
|
|
},
|
|
enableAnalytics: false,
|
|
readonlyRPCMap: {
|
|
'0x539': 'http://127.0.0.1:8545/',
|
|
},
|
|
}}
|
|
>
|
|
<MainContextProvider>
|
|
<RouterProvider router={router} />
|
|
</MainContextProvider>
|
|
</MetaMaskProvider>
|
|
</React.StrictMode>,
|
|
);
|