diff --git a/index.html b/index.html
index bfda3fa0..ec3992ad 100644
--- a/index.html
+++ b/index.html
@@ -1,32 +1,21 @@
-
+
-
+
diff --git a/package.json b/package.json
index 1ed9b696..f3fa37e9 100644
--- a/package.json
+++ b/package.json
@@ -33,7 +33,7 @@
"browserify": "^13.0.0",
"choppa": "^1.0.2",
"concat-stream": "^1.5.1",
- "dat-design": "^1.2.5",
+ "dat-design": "^1.2.6",
"drag-drop": "^2.11.0",
"es2020": "^1.1.7",
"filereader-stream": "^1.0.0",
diff --git a/public/images/dat-data.png b/public/images/dat-data.png
deleted file mode 100644
index 02022bc3..00000000
Binary files a/public/images/dat-data.png and /dev/null differ
diff --git a/public/images/dat-data-blank.png b/public/img/dat-data-blank.png
similarity index 100%
rename from public/images/dat-data-blank.png
rename to public/img/dat-data-blank.png
diff --git a/public/img/dat-data-logo.svg b/public/img/dat-data-logo.svg
new file mode 100644
index 00000000..47b13aeb
--- /dev/null
+++ b/public/img/dat-data-logo.svg
@@ -0,0 +1,30 @@
+
+
diff --git a/public/img/link.svg b/public/img/link.svg
new file mode 100644
index 00000000..29febe43
--- /dev/null
+++ b/public/img/link.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/js/app.js b/src/js/app.js
index cefb2580..8b7e7419 100644
--- a/src/js/app.js
+++ b/src/js/app.js
@@ -17,11 +17,17 @@ var $shareLink = document.getElementById('share-link')
var componentCtors = require('./components')
var components = [
- componentCtors.Help('help'),
+ componentCtors.Header('header', {
+ create: function (event) {
+ initArchive()
+ },
+ download: function (link) {
+ initArchive(link)
+ }
+ }),
componentCtors.HyperdriveSize('hyperdrive-size'),
componentCtors.HyperdriveStats('hyperdrive-stats'),
componentCtors.Peers('peers'),
- componentCtors.ResetButton('new', initArchive),
componentCtors.SpeedDisplay('speed')
]
@@ -41,7 +47,7 @@ main()
function main () {
var keypath = window.location.hash.substr(1).match('([^/]+)(/?.*)')
- var key = keypath ? encoding.decode(keypath[1]) : null
+ var key = keypath ? keypath[1] : null
var file = keypath ? keypath[2] : null
if (file) {
@@ -58,6 +64,7 @@ function main () {
}
function getArchive (key, cb) {
+ if ((typeof key) === 'string') key = encoding.decode(key)
var archive = drive.createArchive(key, {live: true, sparse: true})
var sw = swarm(archive)
sw.on('connection', function (peer) {
@@ -74,6 +81,7 @@ function getArchive (key, cb) {
}
cb(archive)
})
+
archive.on('download', function () {
store.dispatch({type: 'UPDATE_ARCHIVE', archive: archive})
})
@@ -110,7 +118,7 @@ function initArchive (key) {
}
function updateShareLink () {
- $shareLink.value = window.location
+ $shareLink.innerHTML = window.location
}
var clearDrop
diff --git a/src/js/components/header/index.js b/src/js/components/header/index.js
new file mode 100644
index 00000000..353b170c
--- /dev/null
+++ b/src/js/components/header/index.js
@@ -0,0 +1,42 @@
+var yo = require('yo-yo')
+var importButton = require('dat-header/import')
+var help = require('../help')
+var button = require('dat-button')
+
+module.exports = Header
+
+function Header (el, props) {
+ if (!(this instanceof Header)) return new Header(el, props)
+ this.$el = document.getElementById(el)
+ this._props = props
+ this._component = this._render()
+ if (this.$el) this.$el.appendChild(this._component)
+}
+
+Header.prototype.update = function (state) {
+ if (state && state.archiveReducer) {
+ yo.update(this._component, this._render())
+ }
+}
+
+Header.prototype._render = function () {
+ return yo`
+