-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
46 lines (41 loc) · 1.59 KB
/
index.js
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import React from 'react'
import ReactDOM from 'react-dom'
import Playlists from './Playlists'
import Playlist from './Playlist'
import { BrowserRouter as Router, Route } from 'react-router-dom'
import './styles/index.scss'
import IPFS from 'ipfs'
import store from './PlaylistsStore'
class App extends React.Component{
async componentDidMount () {
const ipfs = await IPFS.create({
repo: './ipfs-repo',
EXPERIMENTAL: { pubsub: true },
preload: { "enabled": false },
config: {
Addresses: {
Swarm: ["/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star"]
}
}
})
await store.connect(ipfs)
}
render(){
return(
<div>
<pre> .-``'. 📻 📻 .'''-.</pre>
<pre> .` .` ~ O R B I T W A V E S ~ `. '.</pre>
<pre>_.-' '._ <a href="https://github.com/shamb0t/simple_workshop">github.com/shamb0t/simple_workshop</a> _.' '-._</pre>
<Router>
<Route path="/orbitdb/:hash/:name" component={(props) => <Playlist {...props} store={store}/> }></Route>
<Route exact path="/" component={(props) => <Playlists {...props} store={store}/> }/>
</Router>
</div>
)
}
}
ReactDOM.render(<App />, document.getElementById('root'))
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
// serviceWorker.unregister();