diff --git a/packages/web/src/actions.ts b/packages/web/src/actions.ts index ec5a98e2..89d0d58a 100644 --- a/packages/web/src/actions.ts +++ b/packages/web/src/actions.ts @@ -409,7 +409,7 @@ export async function fetchStripeClientSecret(name: string, domain: string) { ], mode: 'subscription', subscription_data: { - trial_period_days: 14 + trial_period_days: 7, }, customer_email: user.email!, payment_method_collection: 'if_required', diff --git a/packages/web/src/app/components/footer.tsx b/packages/web/src/app/components/footer.tsx new file mode 100644 index 00000000..8f084150 --- /dev/null +++ b/packages/web/src/app/components/footer.tsx @@ -0,0 +1,14 @@ +import Link from "next/link"; +import { Separator } from "@/components/ui/separator"; + +export function Footer() { + return ( + + ) +} \ No newline at end of file diff --git a/packages/web/src/app/components/noOrganizationCard.tsx b/packages/web/src/app/components/noOrganizationCard.tsx new file mode 100644 index 00000000..e13288d8 --- /dev/null +++ b/packages/web/src/app/components/noOrganizationCard.tsx @@ -0,0 +1,43 @@ +"use client" + +import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card" +import { Button } from "@/components/ui/button" +import { useRouter } from "next/navigation" +import { Building2 } from "lucide-react" + +export function NoOrganizationCard() { + const router = useRouter() + + const handleOnboard = () => { + router.push("/onboard") + } + + return ( +
+ + +
+ + No Organization +
+ You're not part of any organization yet. +
+ +

+ Please complete the onboarding process to create an organization. Alternatively, ask your teammate to invite + you to their organization. +

+

+ Something seem wrong? Contact us at team@sourcebot.dev +

+
+ + + +
+
+ ) +} + diff --git a/packages/web/src/app/layout.tsx b/packages/web/src/app/layout.tsx index 44beffe9..886aaa7f 100644 --- a/packages/web/src/app/layout.tsx +++ b/packages/web/src/app/layout.tsx @@ -6,17 +6,46 @@ import { PHProvider } from "./posthogProvider"; import { Toaster } from "@/components/ui/toaster"; import { TooltipProvider } from "@/components/ui/tooltip"; import { SessionProvider } from "next-auth/react"; +import { getCurrentUserOrg } from "@/auth"; +import { isServiceError } from "@/lib/utils"; +import { NavigationMenu } from "./components/navigationMenu"; +import { NoOrganizationCard } from "./components/noOrganizationCard"; +import { Footer } from "./components/footer"; +import { headers } from "next/headers"; export const metadata: Metadata = { title: "Sourcebot", description: "Sourcebot", }; -export default function RootLayout({ +export default async function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { + const orgId = await getCurrentUserOrg(); + const byPassOrgCheck = (await headers()).get("x-bypass-org-check")! == "true"; + if (isServiceError(orgId) && !byPassOrgCheck) { + return ( + + +
+ + + +
+ ) + + + ) + } + return ( )} - +