Basic skeleton of Publish page

This commit is contained in:
Alex Liebowitz 2016-05-23 11:14:21 -04:00
parent d9c6787fac
commit 2ec8a5c7fc
3 changed files with 47 additions and 1 deletions

1
dist/index.html vendored
View file

@ -33,6 +33,7 @@
<script src="./js/page/watch.js"></script>
<script src="./js/page/report.js"></script>
<script src="./js/page/my_files.js"></script>
<script src="./js/page/publish.js"></script>
<script src="./js/page/start.js"></script>
<script src="./js/page/claim_code.js"></script>
<script src="./js/page/wallet.js"></script>

View file

@ -4,7 +4,7 @@ var App = React.createClass({
var match, param, val;
[match, param, val] = window.location.search.match(/\??([^=]*)(?:=(.*))?/);
if (['settings', 'help', 'start', 'watch', 'report', 'files', 'claim', 'show', 'wallet'].indexOf(param) != -1) {
if (['settings', 'help', 'start', 'watch', 'report', 'files', 'claim', 'show', 'wallet', 'publish'].indexOf(param) != -1) {
var viewingPage = param;
} else {
var viewingPage = 'home';
@ -69,6 +69,8 @@ var App = React.createClass({
return <DetailPage name={this.state.pageArgs}/>;
} else if (this.state.viewingPage == 'wallet') {
return <WalletPage />;
} else if (this.state.viewingPage == 'publish') {
return <PublishPage />;
}
}
});

43
js/page/publish.js Normal file
View file

@ -0,0 +1,43 @@
var PublishPage = React.createClass({
publish: function() {
lbry.publish({
name: this.refs.name,
file_path: this.refs.filePath,
bid: parseFloat(this.refs.bid),
});
},
render: function() {
return (
<main className="page">
<SubPageLogo />
<h1>Publish</h1>
<section>
<h4>LBRY name</h4>
<div className="help">What LBRY name would you like to claim for this file?</div>
lbry://<input type="text" ref="name" />
</section>
<section>
<h4>Choose file</h4>
<div className="help">Please choose the file you would like to upload to LBRY.</div>
<div><input type="file" ref="filePath" /></div>
</section>
<section>
<h4>Bid amount</h4>
<div className="help">How much would you like to bid for this name? You must bid at least <strong>0.0</strong> to claim this name.</div>
<input type="text" ref="bidAmount" /> LBC
</section>
{ /* Many more options here ... */ }
<section>
<Link button="primary" label="Publish" onClick={this.publish} />
</section>
<section>
<Link href="/" label="<< Return"/>
</section>
</main>
);
}
});