fix repost list empty

This commit is contained in:
zeppi 2021-10-16 01:26:40 -04:00 committed by jessopb
parent 9306971620
commit 390bb6dfa6
3 changed files with 30 additions and 13 deletions

View file

@ -2184,5 +2184,7 @@
"From comments": "From comments", "From comments": "From comments",
"From search": "From search", "From search": "From search",
"Manage tags": "Manage tags", "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--" "--end--": "--end--"
} }

View file

@ -44,6 +44,7 @@ type Props = {
collectionId?: string, collectionId?: string,
showNoSourceClaims?: boolean, showNoSourceClaims?: boolean,
onClick?: (e: any, claim?: ?Claim, index?: number) => void, onClick?: (e: any, claim?: ?Claim, index?: number) => void,
noEmpty: boolean,
}; };
export default function ClaimList(props: Props) { export default function ClaimList(props: Props) {
@ -74,8 +75,11 @@ export default function ClaimList(props: Props) {
collectionId, collectionId,
showNoSourceClaims, showNoSourceClaims,
onClick, onClick,
noEmpty,
} = props; } = props;
console.log('noempty', noEmpty);
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW); const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
// Exclude prefix uris in these results variables. We don't want to show // 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} 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>} {timedOut && timedOutMessage && <div className="empty main--empty">{timedOutMessage}</div>}
</section> </section>
) : ( ) : (
@ -208,7 +214,9 @@ export default function ClaimList(props: Props) {
</ul> </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>} {!loading && timedOut && timedOutMessage && <div className="empty empty--centered">{timedOutMessage}</div>}
</section> </section>
); );

View file

@ -65,9 +65,10 @@ function FileListPublished(props: Props) {
<Page> <Page>
<div className="card-stack"> <div className="card-stack">
<WebUploadList /> <WebUploadList />
{!!(urls && urls.length) && ( {!!urls && (
<> <>
<ClaimList <ClaimList
noEmpty
header={ header={
<span> <span>
<Button <Button
@ -129,9 +130,14 @@ function FileListPublished(props: Props) {
{!fetching ? ( {!fetching ? (
<section className="main--empty"> <section className="main--empty">
<Yrbl <Yrbl
title={__('No uploads')} title={filterBy === FILTER_REPOSTS ? __('No Reposts') : __('No uploads')}
subtitle={__("You haven't uploaded anything yet. This is where you can find them when you do!")} 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={ actions={
filterBy !== FILTER_REPOSTS && (
<div className="section__actions"> <div className="section__actions">
<Button <Button
button="primary" button="primary"
@ -140,6 +146,7 @@ function FileListPublished(props: Props) {
onClick={() => clearPublish()} onClick={() => clearPublish()}
/> />
</div> </div>
)
} }
/> />
</section> </section>