mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-08-11 11:42:11 +02:00
Upgrade to Gatsby v2
This commit is contained in:
15
src/cms/preview-templates/page-preview.js
Normal file
15
src/cms/preview-templates/page-preview.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
import { Page } from '../../components/Page';
|
||||
|
||||
const PagePreview = ({ entry, widgetFor }) => {
|
||||
const body = widgetFor(['body']);
|
||||
const title = entry.getIn(['data', 'title']);
|
||||
|
||||
return (
|
||||
<Page title={title}>
|
||||
<div dangerouslySetInnerHTML={{ __html: body }} />
|
||||
</Page>
|
||||
);
|
||||
};
|
||||
|
||||
export default PagePreview;
|
13
src/cms/preview-templates/post-preview.js
Normal file
13
src/cms/preview-templates/post-preview.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
import { Content } from '../../components/Post/Content';
|
||||
|
||||
const PostPreview = ({ entry, widgetFor }) => {
|
||||
const body = widgetFor(['body']);
|
||||
const title = entry.getIn(['data', 'title']);
|
||||
|
||||
return (
|
||||
<Content body={body} title={title} />
|
||||
);
|
||||
};
|
||||
|
||||
export default PostPreview;
|
Reference in New Issue
Block a user