only use new post styling for markdown

This commit is contained in:
Sean Yesmunt 2021-03-12 11:18:09 -05:00
parent 49532920a6
commit 7dccba5813
5 changed files with 27 additions and 29 deletions

View file

@ -27,7 +27,7 @@ type Props = {
noSideNavigation: boolean,
fullWidthPage: boolean,
videoTheaterMode: boolean,
isText?: boolean,
isMarkdown?: boolean,
backout: {
backLabel?: string,
backNavDefault?: string,
@ -48,7 +48,7 @@ function Page(props: Props) {
noSideNavigation = false,
backout,
videoTheaterMode,
isText = false,
isMarkdown = false,
} = props;
const {
@ -107,7 +107,7 @@ function Page(props: Props) {
'main--auth-page': authPage,
'main--file-page': filePage,
'main--theater-mode': isOnFilePage && videoTheaterMode,
'main--text': isText,
'main--markdown': isMarkdown,
})}
>
{children}

View file

@ -48,7 +48,7 @@ function FilePage(props: Props) {
} = props;
const cost = costInfo ? costInfo.cost : null;
const hasFileInfo = fileInfo !== undefined;
const isText = RENDER_MODES.TEXT_MODES.includes(renderMode);
const isMarkdown = renderMode === RENDER_MODES.MARKDOWN;
React.useEffect(() => {
// always refresh file info when entering file page to see if we have the file
@ -90,10 +90,20 @@ function FilePage(props: Props) {
);
}
if (RENDER_MODES.TEXT_MODES.includes(renderMode)) {
if (isMarkdown) {
return <PostViewer uri={uri} />;
}
if (RENDER_MODES.TEXT_MODES.includes(renderMode)) {
return (
<React.Fragment>
<FileTitleSection uri={uri} />
<FileRenderInitiator uri={uri} />
<FileRenderInline uri={uri} />
</React.Fragment>
);
}
return (
<React.Fragment>
<FileRenderInitiator uri={uri} videoTheaterMode={videoTheaterMode} />
@ -112,15 +122,11 @@ function FilePage(props: Props) {
}
return (
<Page className="file-page" filePage isText={isText}>
<div
className={classnames('section card-stack', `file-page__${renderMode}`, {
'file-page__text': isText,
})}
>
<Page className="file-page" filePage isMarkdown={isMarkdown}>
<div className={classnames('section card-stack', `file-page__${renderMode}`)}>
{renderFilePageLayout()}
{!isText && (
{!isMarkdown && (
<div className="file-page__secondary-content">
<div>
{RENDER_MODES.FLOATING_MODES.includes(renderMode) && <FileTitleSection uri={uri} />}
@ -132,8 +138,8 @@ function FilePage(props: Props) {
)}
</div>
{!isText && !videoTheaterMode && <RecommendedContent uri={uri} />}
{isText && (
{!isMarkdown && !videoTheaterMode && <RecommendedContent uri={uri} />}
{isMarkdown && (
<div className="file-page__post-comments">
<CommentsList uri={uri} linkedComment={linkedComment} />
</div>

View file

@ -585,6 +585,7 @@
}
.claim-link {
@include font-sans;
position: relative;
}

View file

@ -12,13 +12,12 @@
margin-top: var(--spacing-l);
}
.file-page__text {
.card {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
.file-page__md {
.file-viewer--document {
margin-top: var(--spacing-l);
&:first-child {
margin-bottom: 0;
@media (min-width: $breakpoint-small) {
margin-top: var(--spacing-xl);
}
}
@ -132,14 +131,6 @@
}
}
.file-viewer--document {
margin-top: var(--spacing-l);
@media (min-width: $breakpoint-small) {
margin-top: var(--spacing-xl);
}
}
.file-render__viewer--three {
position: relative;
overflow: hidden;

View file

@ -192,7 +192,7 @@
}
}
.main--text {
.main--markdown {
flex-direction: column;
}