Skip to content

Commit

Permalink
chore: remove unused memo
Browse files Browse the repository at this point in the history
  • Loading branch information
kane50613 committed May 22, 2024
1 parent 677819a commit c89b11f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
27 changes: 12 additions & 15 deletions src/components/comment.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
import { Author } from "@/components/author";
import { MDX } from "@/components/mdx";
import { memo } from "react";
import { type ListIssueComments } from "@/actions/list-issue-comments";

export const Comment = memo(
({ comment }: { comment: ListIssueComments[number] }) => (
<div className="flex flex-col gap-2">
<div className="flex justify-between items-center">
{comment.user && (
<Author user={comment.user} date={comment.updated_at} />
)}
</div>
<div className="prose dark:prose-invert">
{comment.body && <MDX>{comment.body}</MDX>}
</div>
export const Comment = ({
comment,
}: {
comment: ListIssueComments[number];
}) => (
<div className="flex flex-col gap-2">
<div className="flex justify-between items-center">
{comment.user && <Author user={comment.user} date={comment.updated_at} />}
</div>
),
<div className="prose dark:prose-invert">
{comment.body && <MDX>{comment.body}</MDX>}
</div>
</div>
);

Comment.displayName = "Comment";
9 changes: 3 additions & 6 deletions src/components/post-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import { AuthorContent } from "@/components/author";
import { Stats } from "@/components/stats";
import { Heart, MessageCircle } from "lucide-react";
import Link from "next/link";
import { memo } from "react";
import removeMarkdown from "remove-markdown";

// Rendering mdx content in overview is not necessary and could break the LightHouse score, so we remove it.
export const PostOverview = memo(({ post }: { post: Post }) => (
// Rendering mdx content in overview is not necessary and could break the LightHouse score, so only render plain text.
export const PostOverview = ({ post }: { post: Post }) => (
<Link
href={`/posts/${post.number}`}
className="!no-underline"
Expand All @@ -34,6 +33,4 @@ export const PostOverview = memo(({ post }: { post: Post }) => (
</div>
</article>
</Link>
));

PostOverview.displayName = "PostOverview";
);

0 comments on commit c89b11f

Please sign in to comment.