fix repost list empty
This commit is contained in:
parent
9306971620
commit
390bb6dfa6
3 changed files with 30 additions and 13 deletions
|
@ -2184,5 +2184,7 @@
|
|||
"From comments": "From comments",
|
||||
"From search": "From search",
|
||||
"Manage tags": "Manage tags",
|
||||
"No Reposts": "No Reposts",
|
||||
"You haven't reposted anything yet. Do it.": "You haven't reposted anything yet. Do it.",
|
||||
"--end--": "--end--"
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ type Props = {
|
|||
collectionId?: string,
|
||||
showNoSourceClaims?: boolean,
|
||||
onClick?: (e: any, claim?: ?Claim, index?: number) => void,
|
||||
noEmpty: boolean,
|
||||
};
|
||||
|
||||
export default function ClaimList(props: Props) {
|
||||
|
@ -74,8 +75,11 @@ export default function ClaimList(props: Props) {
|
|||
collectionId,
|
||||
showNoSourceClaims,
|
||||
onClick,
|
||||
noEmpty,
|
||||
} = props;
|
||||
|
||||
console.log('noempty', noEmpty);
|
||||
|
||||
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
|
||||
|
||||
// Exclude prefix uris in these results variables. We don't want to show
|
||||
|
@ -134,7 +138,9 @@ export default function ClaimList(props: Props) {
|
|||
showNoSourceClaims={showNoSourceClaims}
|
||||
/>
|
||||
))}
|
||||
{!timedOut && urisLength === 0 && !loading && <div className="empty main--empty">{empty || noResultMsg}</div>}
|
||||
{!timedOut && urisLength === 0 && !loading && !noEmpty && (
|
||||
<div className="empty main--empty">{empty || noResultMsg}</div>
|
||||
)}
|
||||
{timedOut && timedOutMessage && <div className="empty main--empty">{timedOutMessage}</div>}
|
||||
</section>
|
||||
) : (
|
||||
|
@ -208,7 +214,9 @@ export default function ClaimList(props: Props) {
|
|||
</ul>
|
||||
)}
|
||||
|
||||
{!timedOut && urisLength === 0 && !loading && <div className="empty empty--centered">{empty || noResultMsg}</div>}
|
||||
{!timedOut && urisLength === 0 && !loading && !noEmpty && (
|
||||
<div className="empty empty--centered">{empty || noResultMsg}</div>
|
||||
)}
|
||||
{!loading && timedOut && timedOutMessage && <div className="empty empty--centered">{timedOutMessage}</div>}
|
||||
</section>
|
||||
);
|
||||
|
|
|
@ -65,9 +65,10 @@ function FileListPublished(props: Props) {
|
|||
<Page>
|
||||
<div className="card-stack">
|
||||
<WebUploadList />
|
||||
{!!(urls && urls.length) && (
|
||||
{!!urls && (
|
||||
<>
|
||||
<ClaimList
|
||||
noEmpty
|
||||
header={
|
||||
<span>
|
||||
<Button
|
||||
|
@ -129,17 +130,23 @@ function FileListPublished(props: Props) {
|
|||
{!fetching ? (
|
||||
<section className="main--empty">
|
||||
<Yrbl
|
||||
title={__('No uploads')}
|
||||
subtitle={__("You haven't uploaded anything yet. This is where you can find them when you do!")}
|
||||
title={filterBy === FILTER_REPOSTS ? __('No Reposts') : __('No uploads')}
|
||||
subtitle={
|
||||
filterBy === FILTER_REPOSTS
|
||||
? __("You haven't reposted anything yet. Do it.")
|
||||
: __("You haven't uploaded anything yet. This is where you can find them when you do!")
|
||||
}
|
||||
actions={
|
||||
<div className="section__actions">
|
||||
<Button
|
||||
button="primary"
|
||||
navigate={`/$/${PAGES.UPLOAD}`}
|
||||
label={__('Upload Something New')}
|
||||
onClick={() => clearPublish()}
|
||||
/>
|
||||
</div>
|
||||
filterBy !== FILTER_REPOSTS && (
|
||||
<div className="section__actions">
|
||||
<Button
|
||||
button="primary"
|
||||
navigate={`/$/${PAGES.UPLOAD}`}
|
||||
label={__('Upload Something New')}
|
||||
onClick={() => clearPublish()}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
/>
|
||||
</section>
|
||||
|
|
Loading…
Reference in a new issue