fix show yrbl empty
This commit is contained in:
parent
eea3497845
commit
57dfaab1ea
1 changed files with 22 additions and 6 deletions
|
@ -1,7 +1,8 @@
|
||||||
// @flow
|
// @flow
|
||||||
import { DOMAIN } from 'config';
|
import { DOMAIN } from 'config';
|
||||||
|
import * as PAGES from 'constants/pages';
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { Redirect } from 'react-router-dom';
|
import { Redirect, useHistory } from 'react-router-dom';
|
||||||
import Spinner from 'component/spinner';
|
import Spinner from 'component/spinner';
|
||||||
import ChannelPage from 'page/channel';
|
import ChannelPage from 'page/channel';
|
||||||
import FilePage from 'page/file';
|
import FilePage from 'page/file';
|
||||||
|
@ -52,7 +53,9 @@ function ShowPage(props: Props) {
|
||||||
const claimExists = claim !== null && claim !== undefined;
|
const claimExists = claim !== null && claim !== undefined;
|
||||||
const haventFetchedYet = claim === undefined;
|
const haventFetchedYet = claim === undefined;
|
||||||
const isMine = claim && claim.is_my_output;
|
const isMine = claim && claim.is_my_output;
|
||||||
const { contentName } = parseURI(uri);
|
const { channelName, contentName } = parseURI(uri);
|
||||||
|
const { push } = useHistory();
|
||||||
|
const isContentNameChannel = channelName && !contentName;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// @if TARGET='web'
|
// @if TARGET='web'
|
||||||
|
@ -95,11 +98,24 @@ function ShowPage(props: Props) {
|
||||||
{!isResolvingUri && !isSubscribed && (
|
{!isResolvingUri && !isSubscribed && (
|
||||||
<div className="main--empty">
|
<div className="main--empty">
|
||||||
<Yrbl
|
<Yrbl
|
||||||
title={__('No Content Found')}
|
title={isContentNameChannel ? __('Channel Not Found') : __('No Content Found')}
|
||||||
subtitle={
|
subtitle={
|
||||||
<div className="section__actions">
|
isContentNameChannel ? (
|
||||||
<Button button="primary" label={__('Publish Something')} onClick={() => beginPublish(contentName)} />
|
__(`Probably because you didn't make it.`)
|
||||||
</div>
|
) : (
|
||||||
|
<div className="section__actions">
|
||||||
|
<Button
|
||||||
|
button="primary"
|
||||||
|
label={__('Publish Something')}
|
||||||
|
onClick={() => beginPublish(contentName)}
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
button="secondary"
|
||||||
|
onClick={() => push(`/$/${PAGES.REPOST_NEW}?to=${contentName}`)}
|
||||||
|
label={__('Repost Something')}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue