forked from holepunchto/filesharing-react-app-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
31 lines (29 loc) · 845 Bytes
/
index.js
File metadata and controls
31 lines (29 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { versions, config } from 'pear'
import { html } from 'htm/react'
import { createRoot } from 'react-dom/client'
import { UserProvider } from './src/context/user'
import { PeersProvider } from './src/context/peers'
import App from './src/containers/App'
import { ThemeProvider, createTheme, CssBaseline } from '@mui/material'
const { app } = await versions()
const theme = createTheme({
palette: {
mode: 'dark'
}
})
const root = createRoot(document.querySelector('#root'))
root.render(html`
<${ThemeProvider} theme=${theme}>
<${CssBaseline} />
<${UserProvider} config=${config}>
<${PeersProvider}
name="filesharing-app-example"
topic=${app.key || '57337a386673415371314f315a6d386f504576774259624e32446a7377393752'}
>
<${App}
app={app}
/>
</>
</>
</>
`)