Files
psychartherapie-v2/pages/posts.tsx
Skydust e583858edb
Some checks failed
A gitea test / Random test (pull_request) Has been cancelled
Cleaned up some code and added a somewhat responsive header burger
2023-09-19 15:13:22 +02:00

36 lines
1009 B
TypeScript

import { Container } from "../components/util/container";
import { Section } from "../components/util/section";
import { Posts } from "../components/posts";
import { client } from "../tina/__generated__/client";
import { Layout } from "../components/layout/layout";
import { InferGetStaticPropsType } from "next";
export default function HomePage(
props: InferGetStaticPropsType<typeof getStaticProps>
) {
const posts = props.data.postConnection.edges;
return (
<Layout>
<Section className="flex-1">
<Container size="large" width="small">
<Posts data={ posts } />
</Container>
</Section>
</Layout>
);
}
export const getStaticProps = async () => {
const tinaProps = await client.queries.pageQuery();
return {
props: {
...tinaProps
}
};
};
export type PostsType = InferGetStaticPropsType<
typeof getStaticProps
>["data"]["postConnection"]["edges"][number];