mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-09-10 18:26:15 +02:00
refactor(starter): upgrade to new version of gatsby
This commit is contained in:
47
src/components/Post/Post.tsx
Normal file
47
src/components/Post/Post.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import React from "react";
|
||||
|
||||
import { Link } from "gatsby";
|
||||
|
||||
import type { Node } from "@/types";
|
||||
|
||||
import { Author } from "./Author";
|
||||
import { Comments } from "./Comments";
|
||||
import { Content } from "./Content";
|
||||
import { Meta } from "./Meta";
|
||||
import { Tags } from "./Tags";
|
||||
|
||||
import styles from "./Post.module.scss";
|
||||
|
||||
interface Props {
|
||||
post: Node;
|
||||
}
|
||||
|
||||
const Post: React.FC<Props> = ({ post }: Props) => {
|
||||
const { html } = post;
|
||||
const { tagSlugs, slug } = post.fields;
|
||||
const { tags, title, date } = post.frontmatter;
|
||||
|
||||
return (
|
||||
<div className={styles.post}>
|
||||
<Link className={styles["post__home-button"]} to="/">
|
||||
All Articles
|
||||
</Link>
|
||||
|
||||
<div className={styles.post__content}>
|
||||
<Content body={html} title={title} />
|
||||
</div>
|
||||
|
||||
<div className={styles.post__footer}>
|
||||
<Meta date={date} />
|
||||
{tags && tagSlugs && <Tags tags={tags} tagSlugs={tagSlugs} />}
|
||||
<Author />
|
||||
</div>
|
||||
|
||||
<div className={styles.post__comments}>
|
||||
<Comments postSlug={slug} postTitle={post.frontmatter.title} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Post;
|
Reference in New Issue
Block a user