Skip to content

Commit c1578b6

Browse files
shashankboosivicb
authored andcommitted
Fix the code
using pnpm `pnpm run code:fixes`
1 parent ea4b649 commit c1578b6

File tree

10 files changed

+17
-75
lines changed

10 files changed

+17
-75
lines changed

examples/vercel-blog-starter/src/app/_components/hero-post.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@ type Props = {
1313
slug: string;
1414
};
1515

16-
export function HeroPost({
17-
title,
18-
coverImage,
19-
date,
20-
excerpt,
21-
author,
22-
slug,
23-
}: Props) {
16+
export function HeroPost({ title, coverImage, date, excerpt, author, slug }: Props) {
2417
return (
2518
<section>
2619
<div className="mb-8 md:mb-16">

examples/vercel-blog-starter/src/app/_components/intro.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import { CMS_NAME } from "@/lib/constants";
33
export function Intro() {
44
return (
55
<section className="flex-col md:flex-row flex items-center md:justify-between mt-16 mb-16 md:mb-12">
6-
<h1 className="text-5xl md:text-8xl font-bold tracking-tighter leading-tight md:pr-8">
7-
Blog.
8-
</h1>
6+
<h1 className="text-5xl md:text-8xl font-bold tracking-tighter leading-tight md:pr-8">Blog.</h1>
97
<h4 className="text-center md:text-left text-lg mt-5 md:pl-8">
108
A statically generated blog example using{" "}
119
<a

examples/vercel-blog-starter/src/app/_components/more-stories.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ type Props = {
88
export function MoreStories({ posts }: Props) {
99
return (
1010
<section>
11-
<h2 className="mb-8 text-5xl md:text-7xl font-bold tracking-tighter leading-tight">
12-
More Stories
13-
</h2>
11+
<h2 className="mb-8 text-5xl md:text-7xl font-bold tracking-tighter leading-tight">More Stories</h2>
1412
<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">
1513
{posts.map((post) => (
1614
<PostPreview

examples/vercel-blog-starter/src/app/_components/post-body.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ type Props = {
77
export function PostBody({ content }: Props) {
88
return (
99
<div className="max-w-2xl mx-auto">
10-
<div
11-
className={markdownStyles["markdown"]}
12-
dangerouslySetInnerHTML={{ __html: content }}
13-
/>
10+
<div className={markdownStyles["markdown"]} dangerouslySetInnerHTML={{ __html: content }} />
1411
</div>
1512
);
1613
}

examples/vercel-blog-starter/src/app/_components/post-preview.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@ type Props = {
1313
slug: string;
1414
};
1515

16-
export function PostPreview({
17-
title,
18-
coverImage,
19-
date,
20-
excerpt,
21-
author,
22-
slug,
23-
}: Props) {
16+
export function PostPreview({ title, coverImage, date, excerpt, author, slug }: Props) {
2417
return (
2518
<div>
2619
<div className="mb-5">

examples/vercel-blog-starter/src/app/_components/switch.module.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
}
3636

3737
[data-mode="dark"] .switch {
38-
box-shadow: calc(var(--size) / 4) calc(var(--size) / -4) calc(var(--size) / 8)
39-
inset #fff;
38+
box-shadow: calc(var(--size) / 4) calc(var(--size) / -4) calc(var(--size) / 8) inset #fff;
4039
border: none;
4140
background: transparent;
4241
animation: n linear 0.5s;

examples/vercel-blog-starter/src/app/_components/theme-switcher.tsx

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ let updateDOM: () => void;
5959
const Switch = () => {
6060
const [mode, setMode] = useState<ColorSchemePreference>(
6161
() =>
62-
((typeof localStorage !== "undefined" &&
63-
localStorage.getItem(STORAGE_KEY)) ??
64-
"system") as ColorSchemePreference,
62+
((typeof localStorage !== "undefined" && localStorage.getItem(STORAGE_KEY)) ??
63+
"system") as ColorSchemePreference
6564
);
6665

6766
useEffect(() => {
@@ -83,13 +82,7 @@ const Switch = () => {
8382
const index = modes.indexOf(mode);
8483
setMode(modes[(index + 1) % modes.length]);
8584
};
86-
return (
87-
<button
88-
suppressHydrationWarning
89-
className={styles.switch}
90-
onClick={handleModeSwitch}
91-
/>
92-
);
85+
return <button suppressHydrationWarning className={styles.switch} onClick={handleModeSwitch} />;
9386
};
9487

9588
const Script = memo(() => (

examples/vercel-blog-starter/src/app/layout.tsx

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,41 +25,18 @@ export default function RootLayout({
2525
return (
2626
<html lang="en">
2727
<head>
28-
<link
29-
rel="apple-touch-icon"
30-
sizes="180x180"
31-
href="/favicon/apple-touch-icon.png"
32-
/>
33-
<link
34-
rel="icon"
35-
type="image/png"
36-
sizes="32x32"
37-
href="/favicon/favicon-32x32.png"
38-
/>
39-
<link
40-
rel="icon"
41-
type="image/png"
42-
sizes="16x16"
43-
href="/favicon/favicon-16x16.png"
44-
/>
28+
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png" />
29+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png" />
30+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png" />
4531
<link rel="manifest" href="/favicon/site.webmanifest" />
46-
<link
47-
rel="mask-icon"
48-
href="/favicon/safari-pinned-tab.svg"
49-
color="#000000"
50-
/>
32+
<link rel="mask-icon" href="/favicon/safari-pinned-tab.svg" color="#000000" />
5133
<link rel="shortcut icon" href="/favicon/favicon.ico" />
5234
<meta name="msapplication-TileColor" content="#000000" />
53-
<meta
54-
name="msapplication-config"
55-
content="/favicon/browserconfig.xml"
56-
/>
35+
<meta name="msapplication-config" content="/favicon/browserconfig.xml" />
5736
<meta name="theme-color" content="#000" />
5837
<link rel="alternate" type="application/rss+xml" href="/feed.xml" />
5938
</head>
60-
<body
61-
className={cn(inter.className, "dark:bg-slate-900 dark:text-slate-400")}
62-
>
39+
<body className={cn(inter.className, "dark:bg-slate-900 dark:text-slate-400")}>
6340
<ThemeSwitcher />
6441
<div className="min-h-screen">{children}</div>
6542
<Footer />

examples/vercel-blog-starter/src/app/posts/[slug]/page.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,7 @@ export default async function Post({ params }: Params) {
2424
<Container>
2525
<Header />
2626
<article className="mb-32">
27-
<PostHeader
28-
title={post.title}
29-
coverImage={post.coverImage}
30-
date={post.date}
31-
author={post.author}
32-
/>
27+
<PostHeader title={post.title} coverImage={post.coverImage} date={post.date} author={post.author} />
3328
<PostBody content={content} />
3429
</article>
3530
</Container>

examples/vercel-blog-starter/tailwind.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ const config: Config = {
1111
extend: {
1212
backgroundImage: {
1313
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
14-
"gradient-conic":
15-
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
14+
"gradient-conic": "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
1615
},
1716
colors: {
1817
"accent-1": "#FAFAFA",

0 commit comments

Comments
 (0)