Skip to content

Commit

Permalink
Merge pull request #2 from zhumeisongsong/feature/delete-author-logic
Browse files Browse the repository at this point in the history
🔥 Author logic
  • Loading branch information
zhumeisongsong authored Sep 3, 2024
2 parents 583963c + 9a52ea2 commit c9e2617
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 22 deletions.
4 changes: 0 additions & 4 deletions src/app/_components/hero-post.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Avatar from "@/app/_components/avatar";
import CoverImage from "@/app/_components/cover-image";
import { type Author } from "@/interfaces/author";
import Link from "next/link";
import DateFormatter from "./date-formatter";

Expand All @@ -9,7 +7,6 @@ type Props = {
coverImage: string;
date: string;
excerpt: string;
author: Author;
slug: string;
};

Expand All @@ -18,7 +15,6 @@ export function HeroPost({
coverImage,
date,
excerpt,
author,
slug,
}: Props) {
return (
Expand Down
1 change: 0 additions & 1 deletion src/app/_components/more-stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export function MoreStories({ posts }: Props) {
title={post.title}
coverImage={post.coverImage}
date={post.date}
author={post.author}
slug={post.slug}
excerpt={post.excerpt}
/>
Expand Down
5 changes: 1 addition & 4 deletions src/app/_components/post-header.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import Avatar from "./avatar";
import CoverImage from "./cover-image";
import DateFormatter from "./date-formatter";
import { PostTitle } from "@/app/_components/post-title";
import { type Author } from "@/interfaces/author";

type Props = {
title: string;
coverImage: string;
date: string;
author: Author;
};

export function PostHeader({ title, coverImage, date, author }: Props) {
export function PostHeader({ title, coverImage, date }: Props) {
return (
<>
<PostTitle>{title}</PostTitle>
Expand Down
4 changes: 0 additions & 4 deletions src/app/_components/post-preview.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { type Author } from "@/interfaces/author";
import Link from "next/link";
import Avatar from "./avatar";
import CoverImage from "./cover-image";
import DateFormatter from "./date-formatter";

Expand All @@ -9,7 +7,6 @@ type Props = {
coverImage: string;
date: string;
excerpt: string;
author: Author;
slug: string;
};

Expand All @@ -18,7 +15,6 @@ export function PostPreview({
coverImage,
date,
excerpt,
author,
slug,
}: Props) {
return (
Expand Down
1 change: 0 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default function Index() {
title={heroPost.title}
coverImage={heroPost.coverImage}
date={heroPost.date}
author={heroPost.author}
slug={heroPost.slug}
excerpt={heroPost.excerpt}
/>
Expand Down
1 change: 0 additions & 1 deletion src/app/posts/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export default async function Post({ params }: Params) {
title={post.title}
coverImage={post.coverImage}
date={post.date}
author={post.author}
/>
<PostBody content={content} />
</article>
Expand Down
4 changes: 0 additions & 4 deletions src/interfaces/author.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/interfaces/post.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { type Author } from "./author";

export type Post = {
slug: string;
title: string;
date: string;
coverImage: string;
author: Author;
excerpt: string;
ogImage: {
url: string;
Expand Down

0 comments on commit c9e2617

Please sign in to comment.