Skip to content

Commit

Permalink
add PreviewCMSHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
atsuki-t committed Oct 13, 2023
1 parent 506501a commit 6c89a59
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
4 changes: 4 additions & 0 deletions apps/app/src/components/PageEditor/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { RendererOptions } from '~/interfaces/renderer-options';

import RevisionRenderer from '../Page/RevisionRenderer';

import PreviewCMSHeader from './PreviewCMSHeader';

type Props = {
rendererOptions: RendererOptions,
Expand All @@ -31,6 +32,9 @@ const Preview = React.forwardRef((props: Props, ref: RefObject<HTMLDivElement>):
}
}}
>
{pagePath?.startsWith('/_cms') && (
<PreviewCMSHeader />
) }
{ markdown != null && (
<RevisionRenderer rendererOptions={rendererOptions} markdown={markdown}></RevisionRenderer>
) }
Expand Down
13 changes: 13 additions & 0 deletions apps/app/src/components/PageEditor/PreviewCMSHeader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const PreviewCMSHeader = (): JSX.Element => {
return (
<div className="preview-cms-header container py-5">
<p className="h2 text-info">WESEEK Blog</p>
<p className="mt-3 mb-0">WESEEKのエンジニアブログです</p>
</div>
);

};

PreviewCMSHeader.displayName = 'PreviewCMSHeader';

export default PreviewCMSHeader;
13 changes: 8 additions & 5 deletions apps/app/src/styles/_editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -244,19 +244,22 @@
* CMS styles
*/
.preview-cms {
padding-top: 200px !important;
padding: 0 !important;
background-color: #f9f9f9;
background-image: url('../../public/images/weseek-blog-header.jpg');
background-repeat: no-repeat;
background-size: 100% 170px;
.wiki{
width: 86%;
padding: 32px;
margin: 32px !important;
background-color: #fff;
border: solid 1px #ccc;
}
}

.preview-cms-header {
background-image: url('../../public/images/weseek-blog-header.jpg');
background-position: center;
background-size: cover;
}

// .builtin-editor .tab-pane#edit

&.hackmd {
Expand Down

0 comments on commit 6c89a59

Please sign in to comment.