var publishBidAmountInputStyle = { width: '50px', }; var PublishPage = React.createClass({ publish: function() { lbry.publish({ name: this.state.name, file_path: this.state.filePath, bid: parseFloat(this.state.bid), }); }, getInitialState: function() { return { name: '', nameResolved: false, bid: '', claimValue: 0, }; }, handleNameChange: function(event) { var name = event.target.value; if (!name) { this.setState({ name: '', nameResolved: false, }) return; } lbry.resolveName(name, (info) => { if (!info) { this.setState({ name: name, nameResolved: false }); } else { lbry.search(name, (results) => { var claimValue = results[0].value; this.setState({ name: name, nameResolved: true, claimValue: parseFloat(claimValue), }); }); } }); }, handleFileChange: function(event) { var filePath = event.target.value; this.setState({ filePath: (filePath[0] == '/' ? filePath : ('~/Desktop/' + filePath)) }); }, handleBidChange: function(event) { this.setState({ bid: event.target.value }); }, readyToPublish: function() { var bidFloat = parseFloat(this.state.bid.value); return (this.state.name && this.state.filePath && !isNaN(bidFloat) && bidFloat > this.state.claimValue); }, render: function() { return (

Publish Content

LBRY name

What LBRY name would you like to claim for this file?
lbry:// { (!this.state.name ? '' : (this.state.nameResolved ? This name is currently claimed for {lbry.formatCredits(this.state.claimValue)} credits : This name is available)) }

Choose file

Please enter the path of the file you would like to publish on LBRY. (You may also put the file on your desktop and enter just the file name.)

Bid amount

How much would you like to bid for this name? { !this.state.nameResolved ? Since this name is not currently resolved, you may bid as low as you want, but higher bids help prevent others from claiming your name. : You must bid over {lbry.formatCredits(this.state.claimValue)} credits to claim this name. }
Credits:
{ /* Many more options here ... */ }
); } });