refactor(starter): upgrade to new version of gatsby

This commit is contained in:
Alexander Shelepenok
2022-01-09 20:12:31 +00:00
parent 84bdc5899d
commit 67ebabbaac
397 changed files with 26665 additions and 34984 deletions

View 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;