mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
## Description This PR ensures that the default prettier config is used for examples and templates. This config is compatible with `prettier@3` as well (upgrading prettier is bigger change that can be a future PR). ## Changes - Updated `.prettierrc.json` in root with `"trailingComma": "es5"` (will be needed upgrading to prettier@3) - Added `examples/.prettierrc.json` with default config (this will change every example) - Added `packages/create-next-app/templates/.prettierrc.json` with default config (this will change every template) ## Related - Fixes #54402 - Closes #54409
62 lines
1.5 KiB
TypeScript
62 lines
1.5 KiB
TypeScript
import Link from "next/link";
|
|
import Avatar from "./avatar";
|
|
import DateComponent from "./date";
|
|
import CoverImage from "./cover-image";
|
|
|
|
function PostPreview({
|
|
title,
|
|
coverImage,
|
|
date,
|
|
excerpt,
|
|
author,
|
|
slug,
|
|
}: {
|
|
title: string;
|
|
coverImage: any;
|
|
date: string;
|
|
excerpt: string;
|
|
author: any;
|
|
slug: string;
|
|
}) {
|
|
return (
|
|
<div>
|
|
<div className="mb-5">
|
|
<CoverImage title={title} slug={slug} url={coverImage.url} />
|
|
</div>
|
|
<h3 className="text-3xl mb-3 leading-snug">
|
|
<Link href={`/posts/${slug}`} className="hover:underline">
|
|
{title}
|
|
</Link>
|
|
</h3>
|
|
<div className="text-lg mb-4">
|
|
<DateComponent dateString={date} />
|
|
</div>
|
|
<p className="text-lg leading-relaxed mb-4">{excerpt}</p>
|
|
{author && <Avatar name={author.name} picture={author.picture} />}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default function MoreStories({ morePosts }: { morePosts: any[] }) {
|
|
return (
|
|
<section>
|
|
<h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight">
|
|
More Stories
|
|
</h2>
|
|
<div className="grid grid-cols-1 md:grid-cols-2 md:gap-x-16 lg:gap-x-32 gap-y-20 md:gap-y-32 mb-32">
|
|
{morePosts.map((post) => (
|
|
<PostPreview
|
|
key={post.slug}
|
|
title={post.title}
|
|
coverImage={post.coverImage}
|
|
date={post.date}
|
|
author={post.author}
|
|
slug={post.slug}
|
|
excerpt={post.excerpt}
|
|
/>
|
|
))}
|
|
</div>
|
|
</section>
|
|
);
|
|
}
|