2019-06-28 03:27:55 -04:00
|
|
|
// @flow
|
2020-08-26 12:24:07 -04:00
|
|
|
import React from 'react';
|
2017-12-21 18:08:54 -03:00
|
|
|
import PublishForm from 'component/publishForm';
|
2018-03-26 14:32:43 -07:00
|
|
|
import Page from 'component/page';
|
2020-08-26 13:19:03 -04:00
|
|
|
import YrblWalletEmpty from 'component/yrblWalletEmpty';
|
2016-11-22 14:19:08 -06:00
|
|
|
|
2019-06-28 03:27:55 -04:00
|
|
|
type Props = {
|
|
|
|
balance: number,
|
|
|
|
totalRewardValue: number,
|
|
|
|
};
|
|
|
|
|
|
|
|
function PublishPage(props: Props) {
|
2019-11-13 13:14:19 -05:00
|
|
|
const { balance } = props;
|
2019-06-28 03:27:55 -04:00
|
|
|
|
|
|
|
function scrollToTop() {
|
2019-04-03 00:17:00 -04:00
|
|
|
const mainContent = document.querySelector('main');
|
2018-03-26 14:32:43 -07:00
|
|
|
if (mainContent) {
|
|
|
|
mainContent.scrollTop = 0; // It would be nice to animate this
|
|
|
|
}
|
|
|
|
}
|
2019-06-28 03:27:55 -04:00
|
|
|
|
|
|
|
return (
|
2020-09-16 15:36:01 -04:00
|
|
|
<Page
|
|
|
|
noFooter
|
|
|
|
noSideNavigation
|
|
|
|
backout={{
|
|
|
|
title: __('Upload'),
|
|
|
|
backLabel: __('Back'),
|
|
|
|
}}
|
|
|
|
>
|
2020-08-26 13:19:03 -04:00
|
|
|
{balance === 0 && <YrblWalletEmpty />}
|
2020-08-26 12:24:07 -04:00
|
|
|
<PublishForm scrollToTop={scrollToTop} disabled={balance === 0} />
|
2019-06-28 03:27:55 -04:00
|
|
|
</Page>
|
|
|
|
);
|
2018-03-26 14:32:43 -07:00
|
|
|
}
|
2017-06-18 00:59:18 +07:00
|
|
|
|
2016-11-22 14:19:08 -06:00
|
|
|
export default PublishPage;
|