Skip to content

Commit

Permalink
Fix the code
Browse files Browse the repository at this point in the history
using pnpm `pnpm run code:fixes`
  • Loading branch information
shashankboosi authored and vicb committed Oct 12, 2024
1 parent ea4b649 commit c1578b6
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@ type Props = {
slug: string;
};

export function HeroPost({
title,
coverImage,
date,
excerpt,
author,
slug,
}: Props) {
export function HeroPost({ title, coverImage, date, excerpt, author, slug }: Props) {
return (
<section>
<div className="mb-8 md:mb-16">
Expand Down
4 changes: 1 addition & 3 deletions examples/vercel-blog-starter/src/app/_components/intro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { CMS_NAME } from "@/lib/constants";
export function Intro() {
return (
<section className="flex-col md:flex-row flex items-center md:justify-between mt-16 mb-16 md:mb-12">
<h1 className="text-5xl md:text-8xl font-bold tracking-tighter leading-tight md:pr-8">
Blog.
</h1>
<h1 className="text-5xl md:text-8xl font-bold tracking-tighter leading-tight md:pr-8">Blog.</h1>
<h4 className="text-center md:text-left text-lg mt-5 md:pl-8">
A statically generated blog example using{" "}
<a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ type Props = {
export function MoreStories({ posts }: Props) {
return (
<section>
<h2 className="mb-8 text-5xl md:text-7xl font-bold tracking-tighter leading-tight">
More Stories
</h2>
<h2 className="mb-8 text-5xl 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">
{posts.map((post) => (
<PostPreview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ type Props = {
export function PostBody({ content }: Props) {
return (
<div className="max-w-2xl mx-auto">
<div
className={markdownStyles["markdown"]}
dangerouslySetInnerHTML={{ __html: content }}
/>
<div className={markdownStyles["markdown"]} dangerouslySetInnerHTML={{ __html: content }} />
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@ type Props = {
slug: string;
};

export function PostPreview({
title,
coverImage,
date,
excerpt,
author,
slug,
}: Props) {
export function PostPreview({ title, coverImage, date, excerpt, author, slug }: Props) {
return (
<div>
<div className="mb-5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
}

[data-mode="dark"] .switch {
box-shadow: calc(var(--size) / 4) calc(var(--size) / -4) calc(var(--size) / 8)
inset #fff;
box-shadow: calc(var(--size) / 4) calc(var(--size) / -4) calc(var(--size) / 8) inset #fff;
border: none;
background: transparent;
animation: n linear 0.5s;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ let updateDOM: () => void;
const Switch = () => {
const [mode, setMode] = useState<ColorSchemePreference>(
() =>
((typeof localStorage !== "undefined" &&
localStorage.getItem(STORAGE_KEY)) ??
"system") as ColorSchemePreference,
((typeof localStorage !== "undefined" && localStorage.getItem(STORAGE_KEY)) ??
"system") as ColorSchemePreference
);

useEffect(() => {
Expand All @@ -83,13 +82,7 @@ const Switch = () => {
const index = modes.indexOf(mode);
setMode(modes[(index + 1) % modes.length]);
};
return (
<button
suppressHydrationWarning
className={styles.switch}
onClick={handleModeSwitch}
/>
);
return <button suppressHydrationWarning className={styles.switch} onClick={handleModeSwitch} />;
};

const Script = memo(() => (
Expand Down
35 changes: 6 additions & 29 deletions examples/vercel-blog-starter/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,18 @@ export default function RootLayout({
return (
<html lang="en">
<head>
<link
rel="apple-touch-icon"
sizes="180x180"
href="/favicon/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/favicon/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/favicon/favicon-16x16.png"
/>
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png" />
<link rel="manifest" href="/favicon/site.webmanifest" />
<link
rel="mask-icon"
href="/favicon/safari-pinned-tab.svg"
color="#000000"
/>
<link rel="mask-icon" href="/favicon/safari-pinned-tab.svg" color="#000000" />
<link rel="shortcut icon" href="/favicon/favicon.ico" />
<meta name="msapplication-TileColor" content="#000000" />
<meta
name="msapplication-config"
content="/favicon/browserconfig.xml"
/>
<meta name="msapplication-config" content="/favicon/browserconfig.xml" />
<meta name="theme-color" content="#000" />
<link rel="alternate" type="application/rss+xml" href="/feed.xml" />
</head>
<body
className={cn(inter.className, "dark:bg-slate-900 dark:text-slate-400")}
>
<body className={cn(inter.className, "dark:bg-slate-900 dark:text-slate-400")}>
<ThemeSwitcher />
<div className="min-h-screen">{children}</div>
<Footer />
Expand Down
7 changes: 1 addition & 6 deletions examples/vercel-blog-starter/src/app/posts/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ export default async function Post({ params }: Params) {
<Container>
<Header />
<article className="mb-32">
<PostHeader
title={post.title}
coverImage={post.coverImage}
date={post.date}
author={post.author}
/>
<PostHeader title={post.title} coverImage={post.coverImage} date={post.date} author={post.author} />
<PostBody content={content} />
</article>
</Container>
Expand Down
3 changes: 1 addition & 2 deletions examples/vercel-blog-starter/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ const config: Config = {
extend: {
backgroundImage: {
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
"gradient-conic":
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
"gradient-conic": "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
},
colors: {
"accent-1": "#FAFAFA",
Expand Down

0 comments on commit c1578b6

Please sign in to comment.