Linted the whole project with eslint

This commit was merged in pull request #3.
This commit is contained in:
2023-08-31 19:42:15 +02:00
parent cbc4d839d0
commit 7be98e1793
29 changed files with 2931 additions and 1686 deletions

View File

@@ -6,36 +6,36 @@ import { InferGetStaticPropsType } from "next";
// Use the props returned by get static props
export default function BlogPostPage(
props: InferGetStaticPropsType<typeof getStaticProps>
props: InferGetStaticPropsType<typeof getStaticProps>
) {
const { data } = useTina({
query: props.query,
variables: props.variables,
data: props.data,
});
if (data && data.post) {
const { data } = useTina({
query: props.query,
variables: props.variables,
data: props.data
});
if (data && data.post) {
return (
<Layout rawData={ data } data={ data.global }>
<Post { ...data.post } />
</Layout>
);
}
return (
<Layout rawData={data} data={data.global}>
<Post {...data.post} />
</Layout>
<Layout>
<div>No data</div>;
</Layout>
);
}
return (
<Layout>
<div>No data</div>;
</Layout>
);
}
export const getStaticProps = async ({ params }) => {
const tinaProps = await client.queries.blogPostQuery({
relativePath: `${params.filename}.mdx`,
});
return {
props: {
...tinaProps,
},
};
const tinaProps = await client.queries.blogPostQuery({
relativePath: `${ params.filename }.mdx`
});
return {
props: {
...tinaProps
}
};
};
/**
@@ -46,13 +46,13 @@ export const getStaticProps = async ({ params }) => {
* be viewable at http://localhost:3000/posts/hello
*/
export const getStaticPaths = async () => {
const postsListData = await client.queries.postConnection();
return {
paths: postsListData.data.postConnection.edges.map((post) => ({
params: { filename: post.node._sys.filename },
})),
fallback: "blocking",
};
const postsListData = await client.queries.postConnection();
return {
paths: postsListData.data.postConnection.edges.map((post) => ({
params: { filename: post.node._sys.filename }
})),
fallback: "blocking"
};
};
export type PostType = InferGetStaticPropsType<