Skip to content

Commit 57a1d70

Browse files
author
Alan Shaw
committed
feat: wip add react
1 parent 19f9e73 commit 57a1d70

File tree

4 files changed

+81
-6
lines changed

4 files changed

+81
-6
lines changed

package-lock.json

Lines changed: 58 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
"ipfs": "^0.35.0",
1010
"ipfs-css": "^0.12.0",
1111
"parcel": "^1.12.3",
12+
"react": "^16.8.6",
13+
"react-dom": "^16.8.6",
1214
"tachyons": "^4.11.1"
1315
},
1416
"devDependencies": {
17+
"babel-eslint": "^10.0.1",
1518
"standard": "^12.0.1"
1619
},
1720
"scripts": {
@@ -33,5 +36,8 @@
3336
"license": "MIT",
3437
"browserslist": [
3538
"last 2 Chrome versions"
36-
]
39+
],
40+
"standard": {
41+
"parser": "babel-eslint"
42+
}
3743
}

src/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
</a>
1313
<h1 class="w-50 ma0 tr f3 fw2 montserrat aqua">DAG builder</h1>
1414
</header>
15-
<section class="flex-none pa3 bg-white">
15+
<main></main>
16+
<!--section class="flex-none pa3 bg-white">
1617
<input type="file" id="file" style="visibility:hidden" class="input avenir" />
1718
<select id="chunker">
1819
<option value="size-32">32 byte chunks</option>
@@ -37,7 +38,7 @@ <h1 class="w-50 ma0 tr f3 fw2 montserrat aqua">DAG builder</h1>
3738
<option value="16">16 layer repeats</option>
3839
</select>
3940
</section>
40-
<div class="flex-auto" id="root" style="background: pink;"></div>
41+
<div class="flex-auto" id="root" style="background: pink;"></div-->
4142
<script src="./index.js" ></script>
4243
</body>
4344
</html>

src/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ import IPFS, { Buffer } from 'ipfs'
44
import cytoscape from 'cytoscape'
55
import dagre from 'cytoscape-dagre'
66
import unixfs from 'ipfs-unixfs'
7+
import React, { Component } from 'react'
8+
import ReactDOM from 'react-dom'
9+
10+
class HelloMessage extends Component {
11+
render () {
12+
return <div>Hello {this.props.name}</div>
13+
}
14+
}
15+
16+
ReactDOM.render(<HelloMessage name='Jane' />, document.querySelector('main'))
17+
18+
/*
719
820
cytoscape.use(dagre)
921
@@ -182,3 +194,4 @@ ipfs.on('ready', () => {
182194
fileReader.readAsArrayBuffer(file)
183195
})
184196
})
197+
*/

0 commit comments

Comments
 (0)