RecommendedContent: Move WaitUntilOnPage to within the component instead.

This allows `RecommendedContent` to render the Card but with an empty list, so that the area isn't totally blank while waiting for `WaitUntilOnPage` to debounce.
This commit is contained in:
infiinte-persistence 2020-07-25 15:20:31 +08:00 committed by Sean Yesmunt
parent 1383b19817
commit c1dbb752d8
2 changed files with 12 additions and 11 deletions

View file

@ -3,6 +3,7 @@ import React from 'react';
import ClaimList from 'component/claimList'; import ClaimList from 'component/claimList';
import Ads from 'web/component/ads'; import Ads from 'web/component/ads';
import Card from 'component/common/card'; import Card from 'component/common/card';
import WaitUntilOnPage from 'component/common/wait-until-on-page';
type Options = { type Options = {
related_to: string, related_to: string,
@ -68,14 +69,16 @@ export default class RecommendedContent extends React.PureComponent<Props> {
isBodyList isBodyList
title={__('Related')} title={__('Related')}
body={ body={
<ClaimList <WaitUntilOnPage>
isCardBody <ClaimList
type="small" isCardBody
loading={isSearching} type="small"
uris={recommendedContent} loading={isSearching}
injectedItem={!isAuthenticated && IS_WEB && <Ads type="video" small />} uris={recommendedContent}
empty={__('No related content found')} injectedItem={!isAuthenticated && IS_WEB && <Ads type="video" small />}
/> empty={__('No related content found')}
/>
</WaitUntilOnPage>
} }
/> />
); );

View file

@ -165,9 +165,7 @@ class FilePage extends React.Component<Props> {
} }
/> />
</div> </div>
<WaitUntilOnPage> <RecommendedContent uri={uri} />
<RecommendedContent uri={uri} />
</WaitUntilOnPage>
</div> </div>
</Page> </Page>
); );