fix document layout and remove WaitUntilOnPage wrapper for related content

This commit is contained in:
Sean Yesmunt 2020-08-12 11:44:28 -04:00
parent 918e08cb9b
commit 2db2b870ff
3 changed files with 12 additions and 16 deletions

View file

@ -1,6 +1,6 @@
// @flow // @flow
import { remote } from 'electron'; import { remote } from 'electron';
import React, { Suspense } from 'react'; import React from 'react';
import classnames from 'classnames'; import classnames from 'classnames';
import * as RENDER_MODES from 'constants/file_render_modes'; import * as RENDER_MODES from 'constants/file_render_modes';
import VideoViewer from 'component/viewers/videoViewer'; import VideoViewer from 'component/viewers/videoViewer';
@ -152,7 +152,7 @@ class FileRender extends React.PureComponent<Props> {
'file-render--embed': embedded, 'file-render--embed': embedded,
})} })}
> >
<Suspense fallback={<div />}>{this.renderViewer()}</Suspense> {this.renderViewer()}
</div> </div>
); );
} }

View file

@ -4,7 +4,6 @@ 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,
@ -26,7 +25,6 @@ export default class RecommendedContent extends React.PureComponent<Props> {
super(); super();
this.didSearch = undefined; this.didSearch = undefined;
this.lastReset = undefined;
} }
componentDidMount() { componentDidMount() {
@ -38,7 +36,6 @@ export default class RecommendedContent extends React.PureComponent<Props> {
if (uri !== prevProps.uri) { if (uri !== prevProps.uri) {
this.didSearch = false; this.didSearch = false;
this.lastReset = Date.now();
} }
if (claim && !this.didSearch) { if (claim && !this.didSearch) {
@ -63,7 +60,6 @@ export default class RecommendedContent extends React.PureComponent<Props> {
} }
didSearch: ?boolean; didSearch: ?boolean;
lastReset: ?any;
render() { render() {
const { recommendedContent, isSearching, isAuthenticated } = this.props; const { recommendedContent, isSearching, isAuthenticated } = this.props;
@ -75,16 +71,14 @@ export default class RecommendedContent extends React.PureComponent<Props> {
className="file-page__recommended" className="file-page__recommended"
title={__('Related')} title={__('Related')}
body={ body={
<WaitUntilOnPage lastUpdateDate={this.lastReset}> <ClaimList
<ClaimList isCardBody
isCardBody type="small"
type="small" loading={isSearching}
loading={isSearching} uris={recommendedContent}
uris={recommendedContent} injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && <Ads type="video" small />}
injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && <Ads type="video" small />} empty={__('No related content found')}
empty={__('No related content found')} />
/>
</WaitUntilOnPage>
} }
/> />
); );

View file

@ -52,8 +52,10 @@
} }
.file-render--document { .file-render--document {
height: auto;
max-height: none; max-height: none;
overflow: auto; overflow: auto;
margin-bottom: var(--spacing-l);
.markdown-preview { .markdown-preview {
height: 100%; height: 100%;