mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-07-27 12:42:28 +02:00
refactor(starter): upgrade and move to typescript
This commit is contained in:
@@ -18,7 +18,9 @@ describe("PostTemplate", () => {
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
mockedStaticQuery.mockImplementationOnce(({ render }) => render(mocks.siteMetadata));
|
||||
mockedStaticQuery.mockImplementationOnce(({ render }) =>
|
||||
render(mocks.siteMetadata),
|
||||
);
|
||||
mockedUseStaticQuery.mockReturnValue(mocks.siteMetadata);
|
||||
});
|
||||
|
||||
|
@@ -23,7 +23,7 @@ const PostTemplate: React.FC<Props> = ({ data }: Props) => {
|
||||
<Layout
|
||||
title={`${title} - ${siteTitle}`}
|
||||
description={metaDescription}
|
||||
socialImage={socialImage?.publicURL}
|
||||
socialImage={socialImage}
|
||||
>
|
||||
<Post post={data.markdownRemark} />
|
||||
</Layout>
|
||||
@@ -31,7 +31,7 @@ const PostTemplate: React.FC<Props> = ({ data }: Props) => {
|
||||
};
|
||||
|
||||
export const query = graphql`
|
||||
query PostBySlug($slug: String!) {
|
||||
query PostTemplate($slug: String!) {
|
||||
markdownRemark(fields: { slug: { eq: $slug } }) {
|
||||
id
|
||||
html
|
||||
@@ -44,9 +44,7 @@ export const query = graphql`
|
||||
description
|
||||
tags
|
||||
title
|
||||
socialImage {
|
||||
publicURL
|
||||
}
|
||||
socialImage
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,62 +1,39 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`PostTemplate renders correctly 1`] = `
|
||||
<div
|
||||
className="layout"
|
||||
>
|
||||
<div
|
||||
className="post"
|
||||
>
|
||||
<div>
|
||||
<div>
|
||||
<a
|
||||
className="post__home-button"
|
||||
href="/"
|
||||
>
|
||||
All Articles
|
||||
</a>
|
||||
<div
|
||||
className="post__content"
|
||||
>
|
||||
<div
|
||||
className="content"
|
||||
>
|
||||
<h1
|
||||
className="content__title"
|
||||
>
|
||||
<div>
|
||||
<div>
|
||||
<h1>
|
||||
Perfecting the Art of Perfection
|
||||
</h1>
|
||||
<div
|
||||
className="content__body"
|
||||
dangerouslySetInnerHTML={
|
||||
Object {
|
||||
"__html": "",
|
||||
"__html": "<p>An Essay on Typography by Eric Gill takes the reader back to the year 1930. The year when a conflict between two worlds came to its term. The machines of the industrial world finally took over the handicrafts.</p>",
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className="post__footer"
|
||||
>
|
||||
<div
|
||||
className="meta"
|
||||
>
|
||||
<p
|
||||
className="meta__date"
|
||||
>
|
||||
<div>
|
||||
<div>
|
||||
<p>
|
||||
Published
|
||||
|
||||
Sep 1, 2016
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
className="author"
|
||||
>
|
||||
<p
|
||||
className="author__bio"
|
||||
>
|
||||
<div>
|
||||
<p>
|
||||
Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu.
|
||||
<a
|
||||
className="author__bio-twitter"
|
||||
href="https://www.twitter.com/#"
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
@@ -69,9 +46,7 @@ exports[`PostTemplate renders correctly 1`] = `
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className="post__comments"
|
||||
/>
|
||||
<div />
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
@@ -1 +0,0 @@
|
||||
export { default as PostTemplate } from "./PostTemplate";
|
Reference in New Issue
Block a user