Merge branch 'main' into nickkao/checkpoint-volume
This commit is contained in:
commit
f22f5eef4e
@ -20,3 +20,14 @@ PLAUSIBLE_DOMAIN=
|
|||||||
|
|
||||||
NEXT_PUBLIC_POSTHOG_KEY="your-api-key"
|
NEXT_PUBLIC_POSTHOG_KEY="your-api-key"
|
||||||
NEXT_PUBLIC_POSTHOG_HOST="your-ph-address"
|
NEXT_PUBLIC_POSTHOG_HOST="your-ph-address"
|
||||||
|
|
||||||
|
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/auth/sign-in
|
||||||
|
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/auth/sign-up
|
||||||
|
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
|
||||||
|
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/
|
||||||
|
|
||||||
|
STRIPE_API_KEY="sk_test_"
|
||||||
|
STRIPE_PR_PRO="price_"
|
||||||
|
STRIPE_PR_ENTERPRISE="price_"
|
||||||
|
STRIPE_PR_API="price_"
|
||||||
|
STRIPE_WEBHOOK_SECRET="whsec_"
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { stripe } from "@/server/stripe";
|
import { stripe } from "@/server/stripe";
|
||||||
import { createCheckout } from "@/server/linkToPricing";
|
|
||||||
import { auth, clerkClient } from "@clerk/nextjs";
|
import { auth, clerkClient } from "@clerk/nextjs";
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { getUrlServerSide } from "@/server/getUrlServerSide";
|
import { getUrlServerSide } from "@/server/getUrlServerSide";
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
import { stripe } from "@/server/stripe";
|
import { stripe } from "@/server/stripe";
|
||||||
import { createCheckout } from "@/server/linkToPricing";
|
import { auth } from "@clerk/nextjs";
|
||||||
import { auth, clerkClient } from "@clerk/nextjs";
|
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { getUrlServerSide } from "@/server/getUrlServerSide";
|
import { getUrlServerSide } from "@/server/getUrlServerSide";
|
||||||
import { db } from "@/db/db";
|
|
||||||
import { and, eq, isNull } from "drizzle-orm";
|
|
||||||
import { subscriptionStatusTable } from "@/db/schema";
|
|
||||||
import { getCurrentPlan } from "@/server/getCurrentPlan";
|
import { getCurrentPlan } from "@/server/getCurrentPlan";
|
||||||
|
|
||||||
export async function GET(req: Request) {
|
export async function GET(req: Request) {
|
||||||
|
9
web/src/app/(app)/auth/sign-in/[[...sign-in]]/page.tsx
Normal file
9
web/src/app/(app)/auth/sign-in/[[...sign-in]]/page.tsx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { SignIn } from "@clerk/nextjs";
|
||||||
|
|
||||||
|
export default function Page() {
|
||||||
|
return (
|
||||||
|
<div className="w-full h-full items-center flex justify-center">
|
||||||
|
<SignIn />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
9
web/src/app/(app)/auth/sign-up/[[...sign-up]]/page.tsx
Normal file
9
web/src/app/(app)/auth/sign-up/[[...sign-up]]/page.tsx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { SignUp } from "@clerk/nextjs";
|
||||||
|
|
||||||
|
export default function Page() {
|
||||||
|
return (
|
||||||
|
<div className="w-full h-full items-center flex justify-center">
|
||||||
|
<SignUp />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@ -8,7 +8,6 @@ import { Check, Info, Minus } from "lucide-react";
|
|||||||
|
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
import { auth } from "@clerk/nextjs";
|
import { auth } from "@clerk/nextjs";
|
||||||
import { subscriptionPlanStatus } from "@/db/schema";
|
|
||||||
import { getCurrentPlan } from "../server/getCurrentPlan";
|
import { getCurrentPlan } from "../server/getCurrentPlan";
|
||||||
|
|
||||||
const tiers = [
|
const tiers = [
|
||||||
@ -38,7 +37,22 @@ const tiers = [
|
|||||||
mostPopular: true,
|
mostPopular: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
const sections = [
|
type TierFeature = {
|
||||||
|
Basic?: string | JSX.Element | boolean;
|
||||||
|
Pro?: string | JSX.Element | boolean;
|
||||||
|
Enterprise?: string | JSX.Element | boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
type Feature = {
|
||||||
|
name: string;
|
||||||
|
tiers: TierFeature;
|
||||||
|
};
|
||||||
|
|
||||||
|
type Section = {
|
||||||
|
name: string;
|
||||||
|
features: Feature[];
|
||||||
|
};
|
||||||
|
const sections: Section[] = [
|
||||||
{
|
{
|
||||||
name: "Features",
|
name: "Features",
|
||||||
features: [
|
features: [
|
||||||
@ -212,7 +226,7 @@ export default async function PricingList() {
|
|||||||
<li key={section.name}>
|
<li key={section.name}>
|
||||||
<ul role="list" className="space-y-4">
|
<ul role="list" className="space-y-4">
|
||||||
{section.features.map((feature) =>
|
{section.features.map((feature) =>
|
||||||
feature.tiers[tier.name] ? (
|
feature.tiers[tier.name as keyof TierFeature] ? (
|
||||||
<li key={feature.name} className="flex gap-x-3">
|
<li key={feature.name} className="flex gap-x-3">
|
||||||
<Check
|
<Check
|
||||||
className="h-6 w-5 flex-none text-indigo-600"
|
className="h-6 w-5 flex-none text-indigo-600"
|
||||||
@ -220,9 +234,17 @@ export default async function PricingList() {
|
|||||||
/>
|
/>
|
||||||
<span>
|
<span>
|
||||||
{feature.name}{" "}
|
{feature.name}{" "}
|
||||||
{typeof feature.tiers[tier.name] === "string" ? (
|
{typeof feature.tiers[
|
||||||
|
tier.name as keyof TierFeature
|
||||||
|
] === "string" ? (
|
||||||
<span className="text-sm leading-6 text-gray-500">
|
<span className="text-sm leading-6 text-gray-500">
|
||||||
({feature.tiers[tier.name]})
|
(
|
||||||
|
{
|
||||||
|
feature.tiers[
|
||||||
|
tier.name as keyof TierFeature
|
||||||
|
]
|
||||||
|
}
|
||||||
|
)
|
||||||
</span>
|
</span>
|
||||||
) : null}
|
) : null}
|
||||||
</span>
|
</span>
|
||||||
@ -338,14 +360,20 @@ export default async function PricingList() {
|
|||||||
</th>
|
</th>
|
||||||
{tiers.map((tier) => (
|
{tiers.map((tier) => (
|
||||||
<td key={tier.id} className="px-6 py-4 xl:px-8">
|
<td key={tier.id} className="px-6 py-4 xl:px-8">
|
||||||
{typeof feature.tiers[tier.name] === "string" ||
|
{typeof feature.tiers[
|
||||||
typeof feature.tiers[tier.name] === "object" ? (
|
tier.name as keyof TierFeature
|
||||||
|
] === "string" ||
|
||||||
|
typeof feature.tiers[
|
||||||
|
tier.name as keyof TierFeature
|
||||||
|
] === "object" ? (
|
||||||
<div className="flex items-center justify-center text-center text-sm leading-6 text-gray-500">
|
<div className="flex items-center justify-center text-center text-sm leading-6 text-gray-500">
|
||||||
{feature.tiers[tier.name]}
|
{feature.tiers[tier.name as keyof TierFeature]}
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
{feature.tiers[tier.name] === true ? (
|
{feature.tiers[
|
||||||
|
tier.name as keyof TierFeature
|
||||||
|
] === true ? (
|
||||||
<Check
|
<Check
|
||||||
className="mx-auto h-5 w-5 text-indigo-600"
|
className="mx-auto h-5 w-5 text-indigo-600"
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
@ -358,7 +386,9 @@ export default async function PricingList() {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<span className="sr-only">
|
<span className="sr-only">
|
||||||
{feature.tiers[tier.name] === true
|
{feature.tiers[
|
||||||
|
tier.name as keyof TierFeature
|
||||||
|
] === true
|
||||||
? "Included"
|
? "Included"
|
||||||
: "Not included"}{" "}
|
: "Not included"}{" "}
|
||||||
in {tier.name}
|
in {tier.name}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user