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

View file

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

View file

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