This repository has been archived by the owner on Dec 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #182 from datproject/migrate-header
[WIP] Migrate header
- Loading branch information
Showing
12 changed files
with
122 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
const choo = require('choo') | ||
const app = choo() | ||
// TODO: client-side choo logger | ||
|
||
// define models: | ||
app.model(require('./models/archive')) | ||
|
||
// define routes: | ||
app.router((route) => [ | ||
route('/:archiveId', require('./components/archive')) | ||
route('/', require('./pages/landing')), | ||
route('/:archiveKey', require('./pages/archive')) | ||
]) | ||
|
||
// start app: | ||
app.start('#archive-list') | ||
if (module.parent) { | ||
module.exports = app | ||
} else { | ||
app.start('#app-root') | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const html = require('choo/html') | ||
const button = require('dat-button') | ||
const importButton = require('dat-header/import') | ||
|
||
const help = () => { | ||
const intro = () => window.alert('not yet') | ||
return html`<div class="dat-button">${button({text: '?', click: intro})}</div>` | ||
} | ||
|
||
const header = (state, prev, send) => { | ||
return html`<header class="site-header"> | ||
<div class="container"> | ||
<a href="http://dat-data.com" class="dat-logo"> | ||
<img src="./public/img/dat-data-logo.svg" /> | ||
</a> | ||
<div class="site-header__actions"> | ||
<div class="dat-button dat-button--new-dat"> | ||
${button({ | ||
text: 'Create new Dat', | ||
click: () => send('archive:new') | ||
})} | ||
</div> | ||
${importButton({ | ||
download: (link) => send('archive:load', link) | ||
})} | ||
${help()} | ||
</div> | ||
</div> | ||
</header>` | ||
} | ||
|
||
module.exports = header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const html = require('choo/html') | ||
const header = require('./../../components/header') | ||
|
||
const homePage = (state, prev) => { | ||
return html`<html> | ||
<head> | ||
<link rel="icon" type="image/png" href="public/img/dat-data-blank.png" /> | ||
<link rel="stylesheet" type="text/css" href="public/css/main.css"/> | ||
</head> | ||
<body> | ||
${header(state, prev)} | ||
<div class="tmp-home-view"> | ||
<div class="landing-header"> | ||
Dat is a dataset sharing system. | ||
<br> | ||
Give it a try: | ||
</div> | ||
<div class="landing-main container"> | ||
<div class="landing-create-new-dat"> | ||
<h3>Create New Dat</h3> | ||
<p> | ||
Drag and drop files to upload and start sharing your data | ||
</p> | ||
</div> | ||
<div class="landing-import-dat"> | ||
<h3>Or Open An Existing Dat</h3> | ||
<input /> | ||
</div> | ||
</div> | ||
</div> | ||
</body></html>` | ||
} | ||
|
||
module.exports = homePage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,10 @@ $site-header-height: 4rem; | |
|
||
.dat-logo { | ||
float: left; | ||
|
||
img { | ||
width: 40px; | ||
} | ||
} | ||
|
||
// dat-button | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
function page (contents) { | ||
return `<html> | ||
<head> | ||
<link rel="icon" type="image/png" href="public/img/dat-data-blank.png" /> | ||
<link rel="stylesheet" type="text/css" href="public/css/main.css"/> | ||
</head> | ||
<body id="app-root">${contents}</body> | ||
<script type="text/javascript" src="public/js/app.js"></script> | ||
</html>` | ||
} | ||
|
||
module.exports = page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters