mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
4466ba436b
## 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
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import PostPreview from "../components/post-preview";
|
|
|
|
export default function MoreStories({ title, posts }) {
|
|
return (
|
|
<section>
|
|
<h2 className="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight">
|
|
{title}
|
|
</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">
|
|
{posts.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>
|
|
);
|
|
}
|
|
|
|
// The data returned here will be send as `props` to the component
|
|
MoreStories.getCustomInitialProps = async function ({
|
|
client,
|
|
item,
|
|
pageInSitemap,
|
|
}) {
|
|
const postToExcludeContentID = pageInSitemap.contentID ?? -1;
|
|
const posts = await client.getPostsForMoreStories({ postToExcludeContentID });
|
|
|
|
return {
|
|
title: item.fields.title,
|
|
posts,
|
|
};
|
|
};
|