-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add constructMetadata() and update layouts
- Loading branch information
Showing
10 changed files
with
161 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
import { allPosts } from "contentlayer/generated" | ||
import { compareDesc } from "date-fns" | ||
import { allPosts } from "contentlayer/generated"; | ||
import { compareDesc } from "date-fns"; | ||
|
||
import { BlogPosts } from "@/components/blog-posts" | ||
import { BlogPosts } from "@/components/blog-posts"; | ||
import { constructMetadata } from "@/lib/utils"; | ||
|
||
export const metadata = { | ||
title: "Blog", | ||
} | ||
export const metadata = constructMetadata({ | ||
title: "Blog – SaaS Starter", | ||
description: "Manage billing and your subscription plan.", | ||
}); | ||
|
||
export default async function BlogPage() { | ||
const posts = allPosts | ||
.filter((post) => post.published) | ||
.sort((a, b) => { | ||
return compareDesc(new Date(a.date), new Date(b.date)) | ||
}) | ||
return compareDesc(new Date(a.date), new Date(b.date)); | ||
}); | ||
|
||
return ( | ||
<main> | ||
<BlogPosts posts={posts} /> | ||
</main> | ||
) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
import { PricingCards } from "@/components/pricing-cards"; | ||
import { PricingFaq } from "@/components/pricing-faq"; | ||
import { getCurrentUser } from "@/lib/session"; | ||
import { getUserSubscriptionPlan } from "@/lib/subscription"; | ||
import { constructMetadata } from "@/lib/utils"; | ||
|
||
import { PricingCards } from '@/components/pricing-cards'; | ||
import { PricingFaq } from '@/components/pricing-faq'; | ||
import { Skeleton } from '@/components/ui/skeleton'; | ||
import { getCurrentUser } from '@/lib/session'; | ||
import { getUserSubscriptionPlan } from '@/lib/subscription'; | ||
|
||
export const metadata = { | ||
title: "Pricing", | ||
} | ||
export const metadata = constructMetadata({ | ||
title: "Pricing – SaaS Starter", | ||
description: "Explore our subscription plans.", | ||
}); | ||
|
||
export default async function PricingPage() { | ||
const user = await getCurrentUser() | ||
const user = await getCurrentUser(); | ||
let subscriptionPlan; | ||
|
||
if (user) { | ||
subscriptionPlan = await getUserSubscriptionPlan(user.id) | ||
subscriptionPlan = await getUserSubscriptionPlan(user.id); | ||
} | ||
|
||
return ( | ||
<div className="flex w-full flex-col gap-16 py-8 md:py-8"> | ||
<PricingCards userId={user?.id} subscriptionPlan={subscriptionPlan} /> | ||
<hr className='container' /> | ||
<hr className="container" /> | ||
<PricingFaq /> | ||
</div> | ||
) | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.