only use new post styling for markdown
This commit is contained in:
parent
49532920a6
commit
7dccba5813
5 changed files with 27 additions and 29 deletions
|
@ -27,7 +27,7 @@ type Props = {
|
||||||
noSideNavigation: boolean,
|
noSideNavigation: boolean,
|
||||||
fullWidthPage: boolean,
|
fullWidthPage: boolean,
|
||||||
videoTheaterMode: boolean,
|
videoTheaterMode: boolean,
|
||||||
isText?: boolean,
|
isMarkdown?: boolean,
|
||||||
backout: {
|
backout: {
|
||||||
backLabel?: string,
|
backLabel?: string,
|
||||||
backNavDefault?: string,
|
backNavDefault?: string,
|
||||||
|
@ -48,7 +48,7 @@ function Page(props: Props) {
|
||||||
noSideNavigation = false,
|
noSideNavigation = false,
|
||||||
backout,
|
backout,
|
||||||
videoTheaterMode,
|
videoTheaterMode,
|
||||||
isText = false,
|
isMarkdown = false,
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
@ -107,7 +107,7 @@ function Page(props: Props) {
|
||||||
'main--auth-page': authPage,
|
'main--auth-page': authPage,
|
||||||
'main--file-page': filePage,
|
'main--file-page': filePage,
|
||||||
'main--theater-mode': isOnFilePage && videoTheaterMode,
|
'main--theater-mode': isOnFilePage && videoTheaterMode,
|
||||||
'main--text': isText,
|
'main--markdown': isMarkdown,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|
|
@ -48,7 +48,7 @@ function FilePage(props: Props) {
|
||||||
} = props;
|
} = props;
|
||||||
const cost = costInfo ? costInfo.cost : null;
|
const cost = costInfo ? costInfo.cost : null;
|
||||||
const hasFileInfo = fileInfo !== undefined;
|
const hasFileInfo = fileInfo !== undefined;
|
||||||
const isText = RENDER_MODES.TEXT_MODES.includes(renderMode);
|
const isMarkdown = renderMode === RENDER_MODES.MARKDOWN;
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
// always refresh file info when entering file page to see if we have the file
|
// 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} />;
|
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 (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<FileRenderInitiator uri={uri} videoTheaterMode={videoTheaterMode} />
|
<FileRenderInitiator uri={uri} videoTheaterMode={videoTheaterMode} />
|
||||||
|
@ -112,15 +122,11 @@ function FilePage(props: Props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page className="file-page" filePage isText={isText}>
|
<Page className="file-page" filePage isMarkdown={isMarkdown}>
|
||||||
<div
|
<div className={classnames('section card-stack', `file-page__${renderMode}`)}>
|
||||||
className={classnames('section card-stack', `file-page__${renderMode}`, {
|
|
||||||
'file-page__text': isText,
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
{renderFilePageLayout()}
|
{renderFilePageLayout()}
|
||||||
|
|
||||||
{!isText && (
|
{!isMarkdown && (
|
||||||
<div className="file-page__secondary-content">
|
<div className="file-page__secondary-content">
|
||||||
<div>
|
<div>
|
||||||
{RENDER_MODES.FLOATING_MODES.includes(renderMode) && <FileTitleSection uri={uri} />}
|
{RENDER_MODES.FLOATING_MODES.includes(renderMode) && <FileTitleSection uri={uri} />}
|
||||||
|
@ -132,8 +138,8 @@ function FilePage(props: Props) {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{!isText && !videoTheaterMode && <RecommendedContent uri={uri} />}
|
{!isMarkdown && !videoTheaterMode && <RecommendedContent uri={uri} />}
|
||||||
{isText && (
|
{isMarkdown && (
|
||||||
<div className="file-page__post-comments">
|
<div className="file-page__post-comments">
|
||||||
<CommentsList uri={uri} linkedComment={linkedComment} />
|
<CommentsList uri={uri} linkedComment={linkedComment} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -585,6 +585,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.claim-link {
|
.claim-link {
|
||||||
|
@include font-sans;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,12 @@
|
||||||
margin-top: var(--spacing-l);
|
margin-top: var(--spacing-l);
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-page__text {
|
.file-page__md {
|
||||||
.card {
|
.file-viewer--document {
|
||||||
border-bottom-left-radius: 0;
|
margin-top: var(--spacing-l);
|
||||||
border-bottom-right-radius: 0;
|
|
||||||
|
|
||||||
&:first-child {
|
@media (min-width: $breakpoint-small) {
|
||||||
margin-bottom: 0;
|
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 {
|
.file-render__viewer--three {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
@ -192,7 +192,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.main--text {
|
.main--markdown {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue