From 2b12dd497d1550d1294f8fad587d3122c093936b Mon Sep 17 00:00:00 2001 From: Chia-liang Kao Date: Wed, 3 Aug 2016 11:45:06 +0800 Subject: [PATCH 1/9] first cut of header migration --- client/scss/site-header.scss | 4 ++++ server/components/header/index.js | 22 +++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/client/scss/site-header.scss b/client/scss/site-header.scss index cf46a9ad..ad4cdbdc 100644 --- a/client/scss/site-header.scss +++ b/client/scss/site-header.scss @@ -20,6 +20,10 @@ $site-header-height: 4rem; .dat-logo { float: left; + + img { + width: 40px; + } } // dat-button diff --git a/server/components/header/index.js b/server/components/header/index.js index 30381eec..d891b09f 100644 --- a/server/components/header/index.js +++ b/server/components/header/index.js @@ -1,7 +1,27 @@ const html = require('choo/html') +var button = require('dat-button') +var importButton = () => 'import button' +var help = () => 'help' const header = (state, prev) => { - return html`
TODO: migrate header +
+ +
+
+ ${button({ + text: 'Create new Dat' + })} +
+ ${importButton({ + download: 'zzz' + })} + ${help()} +
+
+ ` } module.exports = header From b697c055e77881c87a82eab8730543604d221d9f Mon Sep 17 00:00:00 2001 From: Chia-liang Kao Date: Wed, 3 Aug 2016 12:05:22 +0800 Subject: [PATCH 2/9] attempt to link the send() actions --- client/js/models/archive.js | 7 +++++++ server/components/header/index.js | 5 +++-- server/pages/archive/index.js | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/client/js/models/archive.js b/client/js/models/archive.js index 68bd9cac..0b941ceb 100644 --- a/client/js/models/archive.js +++ b/client/js/models/archive.js @@ -12,5 +12,12 @@ module.exports = { file: null } } + }, + effects: { + newArchive: function (data, state, send, done) { + console.log('whack new archive') + window.alert('this should create a new archive') + setTimeout(() => done(), 1000) + } } } diff --git a/server/components/header/index.js b/server/components/header/index.js index d891b09f..2dd3acde 100644 --- a/server/components/header/index.js +++ b/server/components/header/index.js @@ -3,7 +3,7 @@ var button = require('dat-button') var importButton = () => 'import button' var help = () => 'help' -const header = (state, prev) => { +const header = (state, prev, send) => { return html`