2019-04-03 06:17:00 +02:00
|
|
|
import React, { Fragment } from 'react';
|
2017-12-21 22:08:54 +01:00
|
|
|
import PublishForm from 'component/publishForm';
|
2018-03-26 23:32:43 +02:00
|
|
|
import Page from 'component/page';
|
2019-04-03 06:17:00 +02:00
|
|
|
import Yrbl from 'component/yrbl';
|
|
|
|
import LbcSymbol from 'component/common/lbc-symbol';
|
|
|
|
import CreditAmount from 'component/common/credit-amount';
|
|
|
|
import Button from 'component/button';
|
2016-11-22 21:19:08 +01:00
|
|
|
|
2018-03-26 23:32:43 +02:00
|
|
|
class PublishPage extends React.PureComponent {
|
|
|
|
scrollToTop = () => {
|
2019-04-03 06:17:00 +02:00
|
|
|
const mainContent = document.querySelector('main');
|
2018-03-26 23:32:43 +02:00
|
|
|
if (mainContent) {
|
|
|
|
mainContent.scrollTop = 0; // It would be nice to animate this
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
2019-04-03 06:17:00 +02:00
|
|
|
const { balance, totalRewardValue } = this.props;
|
|
|
|
const totalRewardRounded = Math.floor(totalRewardValue / 10) * 10;
|
|
|
|
|
2018-03-26 23:32:43 +02:00
|
|
|
return (
|
|
|
|
<Page>
|
2019-04-03 06:17:00 +02:00
|
|
|
{balance === 0 && (
|
|
|
|
<Fragment>
|
|
|
|
<Yrbl
|
|
|
|
title={__("You can't publish things quite yet")}
|
|
|
|
subtitle={
|
|
|
|
<Fragment>
|
|
|
|
<p>
|
|
|
|
{__(
|
|
|
|
'LBRY uses a blockchain, which is a fancy way of saying that users (you) are in control of your data.'
|
|
|
|
)}
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
{__('Because of the blockchain, some actions require LBRY credits')} (
|
|
|
|
<LbcSymbol />
|
|
|
|
).
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<LbcSymbol />{' '}
|
|
|
|
{__(
|
|
|
|
'allows you to do some neat things, like paying your favorite creators for their content. And no company can stop you.'
|
|
|
|
)}
|
|
|
|
</p>
|
|
|
|
</Fragment>
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
<section className="card card--section">
|
|
|
|
<header className="card__header">
|
|
|
|
<h1 className="card__title">{__('LBRY Credits Required')}</h1>
|
|
|
|
</header>
|
|
|
|
<p className="card__subtitle">
|
|
|
|
{__(' There are a variety of ways to get credits, including more than')}{' '}
|
|
|
|
<CreditAmount inheritStyle amount={totalRewardRounded} />{' '}
|
|
|
|
{__('in free rewards for participating in the LBRY beta.')}
|
|
|
|
</p>
|
|
|
|
<div className="card__actions">
|
|
|
|
<Button button="link" navigate="/$/rewards" label={__('Checkout the rewards')} />
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</Fragment>
|
|
|
|
)}
|
2018-03-26 23:32:43 +02:00
|
|
|
<PublishForm {...this.props} scrollToTop={this.scrollToTop} />
|
|
|
|
</Page>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2017-06-17 19:59:18 +02:00
|
|
|
|
2016-11-22 21:19:08 +01:00
|
|
|
export default PublishPage;
|