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