Empty states for channel tabs
This commit is contained in:
parent
501d1cf5f1
commit
d55ef7e899
3 changed files with 17 additions and 0 deletions
|
@ -33,6 +33,7 @@ type Props = {
|
||||||
viewHiddenChannels: boolean,
|
viewHiddenChannels: boolean,
|
||||||
doResolveUris: (Array<string>, boolean) => void,
|
doResolveUris: (Array<string>, boolean) => void,
|
||||||
claimType: string,
|
claimType: string,
|
||||||
|
empty?: string,
|
||||||
};
|
};
|
||||||
|
|
||||||
function ChannelContent(props: Props) {
|
function ChannelContent(props: Props) {
|
||||||
|
@ -51,6 +52,7 @@ function ChannelContent(props: Props) {
|
||||||
viewHiddenChannels,
|
viewHiddenChannels,
|
||||||
doResolveUris,
|
doResolveUris,
|
||||||
claimType,
|
claimType,
|
||||||
|
empty,
|
||||||
} = props;
|
} = props;
|
||||||
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
|
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
|
||||||
const [searchQuery, setSearchQuery] = React.useState('');
|
const [searchQuery, setSearchQuery] = React.useState('');
|
||||||
|
@ -164,6 +166,7 @@ function ChannelContent(props: Props) {
|
||||||
}
|
}
|
||||||
isChannel
|
isChannel
|
||||||
channelIsMine={channelIsMine}
|
channelIsMine={channelIsMine}
|
||||||
|
empty={empty}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<section className="main--empty">{__("This channel hasn't published anything yet")}</section>
|
<section className="main--empty">{__("This channel hasn't published anything yet")}</section>
|
||||||
|
|
|
@ -74,6 +74,7 @@ type Props = {
|
||||||
hasSource?: boolean,
|
hasSource?: boolean,
|
||||||
isChannel?: boolean,
|
isChannel?: boolean,
|
||||||
channelIsMine?: boolean,
|
channelIsMine?: boolean,
|
||||||
|
empty?: string,
|
||||||
};
|
};
|
||||||
|
|
||||||
function ClaimListDiscover(props: Props) {
|
function ClaimListDiscover(props: Props) {
|
||||||
|
@ -130,6 +131,7 @@ function ClaimListDiscover(props: Props) {
|
||||||
hasSource,
|
hasSource,
|
||||||
isChannel = false,
|
isChannel = false,
|
||||||
channelIsMine = false,
|
channelIsMine = false,
|
||||||
|
empty,
|
||||||
} = props;
|
} = props;
|
||||||
const didNavigateForward = history.action === 'PUSH';
|
const didNavigateForward = history.action === 'PUSH';
|
||||||
const { search } = location;
|
const { search } = location;
|
||||||
|
@ -546,6 +548,7 @@ function ClaimListDiscover(props: Props) {
|
||||||
liveLivestreamsFirst={liveLivestreamsFirst}
|
liveLivestreamsFirst={liveLivestreamsFirst}
|
||||||
livestreamMap={livestreamMap}
|
livestreamMap={livestreamMap}
|
||||||
searchOptions={options}
|
searchOptions={options}
|
||||||
|
empty={empty}
|
||||||
/>
|
/>
|
||||||
{loading &&
|
{loading &&
|
||||||
new Array(dynamicPageSize)
|
new Array(dynamicPageSize)
|
||||||
|
|
|
@ -269,6 +269,7 @@ function ChannelPage(props: Props) {
|
||||||
uri={uri}
|
uri={uri}
|
||||||
channelIsBlackListed={channelIsBlackListed}
|
channelIsBlackListed={channelIsBlackListed}
|
||||||
viewHiddenChannels
|
viewHiddenChannels
|
||||||
|
empty={__('No Content Found')}
|
||||||
/>
|
/>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
|
@ -277,6 +278,16 @@ function ChannelPage(props: Props) {
|
||||||
uri={uri}
|
uri={uri}
|
||||||
channelIsBlackListed={channelIsBlackListed}
|
channelIsBlackListed={channelIsBlackListed}
|
||||||
viewHiddenChannels
|
viewHiddenChannels
|
||||||
|
empty={__('No Lists Found')}
|
||||||
|
/>
|
||||||
|
</TabPanel>
|
||||||
|
<TabPanel>
|
||||||
|
<ChannelContent
|
||||||
|
claimType={'repost'}
|
||||||
|
uri={uri}
|
||||||
|
channelIsBlackListed={channelIsBlackListed}
|
||||||
|
viewHiddenChannels
|
||||||
|
empty={__('No Reposts Found')}
|
||||||
/>
|
/>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
|
|
Loading…
Reference in a new issue