Skip to content

Commit b2b6c9f

Browse files
committed
added prettier
1 parent 7e230a2 commit b2b6c9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+338
-266
lines changed

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pnpm-lock.yaml
2+
node_modules
3+
.next

app/[domain]/[slug]/opengraph-image.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default async function PostOG({
3838
}
3939

4040
const clashData = await fetch(
41-
new URL("@/styles/CalSans-SemiBold.otf", import.meta.url)
41+
new URL("@/styles/CalSans-SemiBold.otf", import.meta.url),
4242
).then((res) => res.arrayBuffer());
4343

4444
return new ImageResponse(
@@ -77,6 +77,6 @@ export default async function PostOG({
7777
},
7878
],
7979
emoji: "blobmoji",
80-
}
80+
},
8181
);
8282
}

app/[domain]/[slug]/page.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export async function generateMetadata({
1313
const { domain, slug } = params;
1414
const data = await getPostData(domain, slug);
1515
if (!data) {
16-
notFound();
16+
return null;
1717
}
1818
const { title, description } = data;
1919

@@ -47,15 +47,15 @@ export default async function SitePostPage({
4747

4848
return (
4949
<>
50-
<div className="flex flex-col justify-center items-center">
51-
<div className="text-center w-full md:w-7/12 m-auto">
52-
<p className="text-sm md:text-base font-light text-gray-500 w-10/12 m-auto my-5">
50+
<div className="flex flex-col items-center justify-center">
51+
<div className="m-auto w-full text-center md:w-7/12">
52+
<p className="m-auto my-5 w-10/12 text-sm font-light text-gray-500 md:text-base">
5353
{toDateString(data.createdAt)}
5454
</p>
55-
<h1 className="font-bold text-3xl font-title md:text-6xl mb-10 text-gray-800">
55+
<h1 className="mb-10 font-title text-3xl font-bold text-gray-800 md:text-6xl">
5656
{data.title}
5757
</h1>
58-
<p className="text-md md:text-lg text-gray-600 w-10/12 m-auto">
58+
<p className="text-md m-auto w-10/12 text-gray-600 md:text-lg">
5959
{data.description}
6060
</p>
6161
</div>
@@ -70,7 +70,7 @@ export default async function SitePostPage({
7070
target="_blank"
7171
>
7272
<div className="my-8">
73-
<div className="relative w-8 h-8 md:w-12 md:h-12 rounded-full overflow-hidden inline-block align-middle">
73+
<div className="relative inline-block h-8 w-8 overflow-hidden rounded-full align-middle md:h-12 md:w-12">
7474
{data.site?.user?.image ? (
7575
<BlurImage
7676
alt={data.site?.user?.name ?? "User Avatar"}
@@ -79,23 +79,23 @@ export default async function SitePostPage({
7979
width={80}
8080
/>
8181
) : (
82-
<div className="absolute flex items-center justify-center w-full h-full bg-gray-100 text-gray-500 text-4xl select-none">
82+
<div className="absolute flex h-full w-full select-none items-center justify-center bg-gray-100 text-4xl text-gray-500">
8383
?
8484
</div>
8585
)}
8686
</div>
87-
<div className="inline-block text-md md:text-lg align-middle ml-3">
87+
<div className="text-md ml-3 inline-block align-middle md:text-lg">
8888
by <span className="font-semibold">{data.site?.user?.name}</span>
8989
</div>
9090
</div>
9191
</a>
9292
</div>
93-
<div className="relative h-80 md:h-150 w-full max-w-screen-lg lg:w-2/3 md:w-5/6 m-auto mb-10 md:mb-20 md:rounded-2xl overflow-hidden">
93+
<div className="relative m-auto mb-10 h-80 w-full max-w-screen-lg overflow-hidden md:mb-20 md:h-150 md:w-5/6 md:rounded-2xl lg:w-2/3">
9494
<BlurImage
9595
alt={data.title ?? "Post image"}
9696
width={1200}
9797
height={630}
98-
className="w-full h-full object-cover"
98+
className="h-full w-full object-cover"
9999
placeholder="blur"
100100
blurDataURL={data.imageBlurhash ?? placeholderBlurhash}
101101
src={data.image ?? "/placeholder.png"}
@@ -105,22 +105,22 @@ export default async function SitePostPage({
105105
<MDX source={data.mdxSource} />
106106

107107
{data.adjacentPosts.length > 0 && (
108-
<div className="relative mt-10 sm:mt-20 mb-20">
108+
<div className="relative mb-20 mt-10 sm:mt-20">
109109
<div
110110
className="absolute inset-0 flex items-center"
111111
aria-hidden="true"
112112
>
113113
<div className="w-full border-t border-gray-300" />
114114
</div>
115115
<div className="relative flex justify-center">
116-
<span className="px-2 bg-white text-sm text-gray-500">
116+
<span className="bg-white px-2 text-sm text-gray-500">
117117
Continue Reading
118118
</span>
119119
</div>
120120
</div>
121121
)}
122122
{data.adjacentPosts && (
123-
<div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-x-4 gap-y-8 mx-5 lg:mx-12 2xl:mx-auto mb-20 max-w-screen-xl">
123+
<div className="mx-5 mb-20 grid max-w-screen-xl grid-cols-1 gap-x-4 gap-y-8 md:grid-cols-2 lg:mx-12 xl:grid-cols-3 2xl:mx-auto">
124124
{data.adjacentPosts.map((data, index) => (
125125
<BlogCard key={index} data={data} />
126126
))}

app/[domain]/cta.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ export default function CTA() {
77
return (
88
<div
99
className={`${
10-
closeCTA ? "h-14 lg:h-auto" : "lg:h-auto sm:h-40 h-60"
11-
} max-w-screen-xl xl:mx-auto mx-5 rounded-lg px-5 lg:pt-3 pt-0 pb-3 flex flex-col lg:flex-row space-y-3 lg:space-y-0 justify-between items-center sticky bottom-5 bg-white border-t-4 border-black
12-
drop-shadow-lg transition-all ease-in-out duration-150`}
10+
closeCTA ? "h-14 lg:h-auto" : "h-60 sm:h-40 lg:h-auto"
11+
} fixed inset-x-0 bottom-5 mx-5 flex max-w-screen-xl flex-col items-center justify-between space-y-3 rounded-lg border-t-4 border-black bg-white px-5 pb-3 pt-0 drop-shadow-lg transition-all duration-150 ease-in-out
12+
lg:flex-row lg:space-y-0 lg:pt-3 xl:mx-auto`}
1313
>
1414
<button
1515
onClick={() => setCloseCTA(!closeCTA)}
1616
className={`${
1717
closeCTA ? "rotate-180" : "rotate-0"
18-
} lg:hidden absolute top-2 right-3 text-black transition-all ease-in-out duration-150`}
18+
} absolute right-3 top-2 text-black transition-all duration-150 ease-in-out lg:hidden`}
1919
>
2020
<svg
2121
viewBox="0 0 24 24"
@@ -32,18 +32,18 @@ export default function CTA() {
3232
</svg>
3333
</button>
3434
<div className="text-center lg:text-left">
35-
<p className="font-title text-lg sm:text-2xl text-black">
35+
<p className="font-title text-lg text-black sm:text-2xl">
3636
Platforms Starter Kit Demo
3737
</p>
3838
<p
3939
className={`${
40-
closeCTA ? "lg:block hidden" : ""
41-
} text-sm text-gray-700 mt-2 lg:mt-0`}
40+
closeCTA ? "hidden lg:block" : ""
41+
} mt-2 text-sm text-gray-700 lg:mt-0`}
4242
>
4343
This is a demo site showcasing how to build a multi-tenant application
4444
with{" "}
4545
<a
46-
className="text-black font-semibold underline"
46+
className="font-semibold text-black underline"
4747
href="https://platformize.co"
4848
rel="noreferrer"
4949
target="_blank"
@@ -55,19 +55,19 @@ export default function CTA() {
5555
</div>
5656
<div
5757
className={`${
58-
closeCTA ? "lg:flex hidden" : ""
59-
} flex space-y-3 sm:space-y-0 sm:space-x-3 sm:flex-row flex-col lg:w-auto w-full text-center`}
58+
closeCTA ? "hidden lg:flex" : ""
59+
} flex w-full flex-col space-y-3 text-center sm:flex-row sm:space-x-3 sm:space-y-0 lg:w-auto`}
6060
>
6161
<a
62-
className="flex-auto font-title text-lg rounded-md py-1 sm:py-3 px-5 text-black border border-gray-200 hover:border-black transition-all ease-in-out duration-150 whitespace-no-wrap"
62+
className="whitespace-no-wrap flex-auto rounded-md border border-gray-200 px-5 py-1 font-title text-lg text-black transition-all duration-150 ease-in-out hover:border-black sm:py-3"
6363
href="https://app.vercel.pub"
6464
rel="noreferrer"
6565
target="_blank"
6666
>
6767
Create your publication
6868
</a>
6969
<a
70-
className="flex-auto font-title text-lg bg-black text-white border border-black rounded-md py-1 sm:py-3 px-5 hover:text-black hover:bg-white transition-all ease-in-out duration-150 whitespace-no-wrap"
70+
className="whitespace-no-wrap flex-auto rounded-md border border-black bg-black px-5 py-1 font-title text-lg text-white transition-all duration-150 ease-in-out hover:bg-white hover:text-black sm:py-3"
7171
href="https://vercel.com/guides/nextjs-multi-tenant-application"
7272
rel="noreferrer"
7373
target="_blank"

app/[domain]/layout.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,18 @@ export default async function SiteLayout({
104104

105105
return (
106106
<div className={fontMapper[data.font]}>
107-
<div className="top-0 left-0 right-0 h-16 bg-white z-30 transition-all ease duration-150 flex">
108-
<div className="flex justify-center items-center space-x-5 h-full max-w-screen-xl mx-auto px-10 sm:px-20">
109-
<Link href="/" className="flex justify-center items-center">
110-
<div className="h-8 w-8 inline-block rounded-full overflow-hidden align-middle">
107+
<div className="ease left-0 right-0 top-0 z-30 flex h-16 bg-white transition-all duration-150">
108+
<div className="mx-auto flex h-full max-w-screen-xl items-center justify-center space-x-5 px-10 sm:px-20">
109+
<Link href="/" className="flex items-center justify-center">
110+
<div className="inline-block h-8 w-8 overflow-hidden rounded-full align-middle">
111111
<Image
112112
alt={data.name || ""}
113113
height={40}
114114
src={data.logo || ""}
115115
width={40}
116116
/>
117117
</div>
118-
<span className="inline-block font-title ml-3 font-medium truncate">
118+
<span className="ml-3 inline-block truncate font-title font-medium">
119119
{data.name}
120120
</span>
121121
</Link>

app/[domain]/not-found.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import Image from "next/image";
33
export default function NotFound() {
44
console.log("404 on app/[domain]/not-found.tsx");
55
return (
6-
<div className="flex flex-col justify-center items-center">
7-
<h1 className="text-4xl font-cal">404</h1>
6+
<div className="flex flex-col items-center justify-center">
7+
<h1 className="font-cal text-4xl">404</h1>
88
<Image
99
alt="missing site"
1010
src="https://illustrations.popsy.co/gray/timed-out-error.svg"

app/[domain]/page.tsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,74 +22,74 @@ export default async function SiteHomePage({
2222

2323
return (
2424
<>
25-
<div className="w-full mb-20">
25+
<div className="mb-20 w-full">
2626
{posts.length > 0 ? (
27-
<div className="w-full max-w-screen-xl lg:w-5/6 mx-auto md:mb-28">
27+
<div className="mx-auto w-full max-w-screen-xl md:mb-28 lg:w-5/6">
2828
<Link href={`/${posts[0].slug}`}>
29-
<div className="relative group h-80 sm:h-150 w-full mx-auto overflow-hidden lg:rounded-xl">
29+
<div className="group relative mx-auto h-80 w-full overflow-hidden sm:h-150 lg:rounded-xl">
3030
<BlurImage
3131
alt={posts[0].title ?? ""}
3232
blurDataURL={posts[0].imageBlurhash ?? placeholderBlurhash}
33-
className="group-hover:scale-105 group-hover:duration-300 h-full w-full object-cover"
33+
className="h-full w-full object-cover group-hover:scale-105 group-hover:duration-300"
3434
width={1300}
3535
height={630}
3636
placeholder="blur"
3737
src={posts[0].image ?? "/placeholder.png"}
3838
/>
3939
</div>
40-
<div className="mt-10 w-5/6 mx-auto lg:w-full">
41-
<h2 className="font-title text-4xl md:text-6xl my-10">
40+
<div className="mx-auto mt-10 w-5/6 lg:w-full">
41+
<h2 className="my-10 font-title text-4xl md:text-6xl">
4242
{posts[0].title}
4343
</h2>
44-
<p className="text-base md:text-lg w-full lg:w-2/3">
44+
<p className="w-full text-base md:text-lg lg:w-2/3">
4545
{posts[0].description}
4646
</p>
47-
<div className="flex justify-start items-center space-x-4 w-full">
48-
<div className="relative w-8 h-8 flex-none rounded-full overflow-hidden">
47+
<div className="flex w-full items-center justify-start space-x-4">
48+
<div className="relative h-8 w-8 flex-none overflow-hidden rounded-full">
4949
{data.user?.image ? (
5050
<BlurImage
5151
alt={data.user?.name ?? "User Avatar"}
5252
width={100}
5353
height={100}
54-
className="w-full h-full object-cover"
54+
className="h-full w-full object-cover"
5555
src={data.user?.image}
5656
/>
5757
) : (
58-
<div className="absolute flex items-center justify-center w-full h-full bg-gray-100 text-gray-500 text-4xl select-none">
58+
<div className="absolute flex h-full w-full select-none items-center justify-center bg-gray-100 text-4xl text-gray-500">
5959
?
6060
</div>
6161
)}
6262
</div>
63-
<p className="inline-block font-semibold text-sm md:text-base align-middle ml-3 whitespace-nowrap">
63+
<p className="ml-3 inline-block whitespace-nowrap align-middle text-sm font-semibold md:text-base">
6464
{data.user?.name}
6565
</p>
66-
<div className="border-l border-gray-600 h-6" />
67-
<p className="text-sm md:text-base font-light text-gray-500 w-10/12 m-auto my-5">
66+
<div className="h-6 border-l border-gray-600" />
67+
<p className="m-auto my-5 w-10/12 text-sm font-light text-gray-500 md:text-base">
6868
{toDateString(posts[0].createdAt)}
6969
</p>
7070
</div>
7171
</div>
7272
</Link>
7373
</div>
7474
) : (
75-
<div className="flex flex-col justify-center items-center py-20">
75+
<div className="flex flex-col items-center justify-center py-20">
7676
<Image
7777
alt="missing post"
7878
src="https://illustrations.popsy.co/gray/success.svg"
7979
width={400}
8080
height={400}
8181
/>
82-
<p className="text-2xl font-title text-gray-600">No posts yet.</p>
82+
<p className="font-title text-2xl text-gray-600">No posts yet.</p>
8383
</div>
8484
)}
8585
</div>
8686

8787
{posts.length > 1 && (
88-
<div className="mx-5 lg:mx-24 2xl:mx-auto mb-20 max-w-screen-xl">
89-
<h2 className="font-title text-4xl md:text-5xl mb-10">
88+
<div className="mx-5 mb-20 max-w-screen-xl lg:mx-24 2xl:mx-auto">
89+
<h2 className="mb-10 font-title text-4xl md:text-5xl">
9090
More stories
9191
</h2>
92-
<div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-x-4 gap-y-8 w-full">
92+
<div className="grid w-full grid-cols-1 gap-x-4 gap-y-8 md:grid-cols-2 xl:grid-cols-3">
9393
{posts.slice(1).map((metadata, index) => (
9494
<BlogCard key={index} data={metadata} />
9595
))}

app/api/domain/[slug]/verify/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { NextResponse } from "next/server";
88

99
export async function GET(
1010
_req: Request,
11-
{ params }: { params: { slug: string } }
11+
{ params }: { params: { slug: string } },
1212
) {
1313
const domain = params.slug;
1414
let status: DomainVerificationStatusProps = "Valid Configuration";

app/api/upload/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export async function POST(req: Request) {
1010
"Missing BLOB_READ_WRITE_TOKEN. Don't forget to add that to your .env file.",
1111
{
1212
status: 401,
13-
}
13+
},
1414
);
1515
}
1616

app/app/(auth)/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const metadata: Metadata = {
77

88
export default function AuthLayout({ children }: { children: ReactNode }) {
99
return (
10-
<div className="min-h-screen flex flex-col justify-center py-12 sm:px-6 lg:px-8">
10+
<div className="flex min-h-screen flex-col justify-center py-12 sm:px-6 lg:px-8">
1111
{children}
1212
</div>
1313
);

0 commit comments

Comments
 (0)