Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion __tests__/sanity.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { render, screen } from "@testing-library/react";
import DashboardPage from "@/app/dashboard/page";
import DashboardPage from "@/app/(authenticated)/dashboard/page";

describe("jest setup", () => {
it("runs React + Testing Library", async () => {
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions app/(authenticated)/finance/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function FinancePage() {
return (
<main className="flex min-h-screen flex-col p-8">
<h1 className="text-3xl font-bold">Finance</h1>
</main>
);
}
33 changes: 33 additions & 0 deletions app/(authenticated)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { redirect } from "next/navigation";
import { createClient } from "@/utils/supabase/server";
import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar";
import { TooltipProvider } from "@/components/ui/tooltip";
import { AppSidebar } from "@/components/app-sidebar";

export default async function AuthenticatedLayout({
children,
}: {
children: React.ReactNode;
}) {
const supabase = await createClient();
const {
data: { user },
} = await supabase.auth.getUser();

if (!user) {
redirect("/login");
}

return (
<TooltipProvider>
<SidebarProvider>
<AppSidebar />
<SidebarInset>
<div className="flex flex-1 flex-col gap-4 p-4">
{children}
</div>
</SidebarInset>
</SidebarProvider>
</TooltipProvider>
);
}
7 changes: 7 additions & 0 deletions app/(authenticated)/memberships/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function MembershipsPage() {
return (
<main className="flex min-h-screen flex-col p-8">
<h1 className="text-3xl font-bold">Memberships</h1>
</main>
)
}
21 changes: 9 additions & 12 deletions app/page.tsx → app/(authenticated)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { createClient } from "@/utils/supabase/server";
import { signout } from "./login/actions";
import { signout } from "@/app/login/actions";
import { getSubscriptionDetails } from "@/lib/stripe";
import { hasUserPurchased } from "@/lib/purchases";
import {
Card,
CardContent,
Expand All @@ -23,17 +22,15 @@ export default async function Page() {

if (!user) return null;

const [subscription, ownsProduct] = await Promise.all([
getSubscriptionDetails(user.id),
hasUserPurchased(user.id, PRODUCT_PRICE_ID),
]);
const [subscription] = await Promise.all([getSubscriptionDetails(user.id)]);
const ownsProduct = false;

return (
<main className="flex min-h-screen items-center justify-center p-4">
<div className="w-full max-w-md space-y-4">
<Card>
<main className="min-h-screen p-4 w-full">
<div className="flex flex-row gap-4 w-full">
<Card className="flex-1">
<CardHeader>
<CardTitle className="text-2xl">Welcome</CardTitle>
<CardTitle className="text-2xl">Welcome t</CardTitle>
<CardDescription>You are signed in as</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
Expand All @@ -46,7 +43,7 @@ export default async function Page() {
</CardContent>
</Card>

<Card>
<Card className="flex-1">
<CardHeader>
<CardTitle>Subscription</CardTitle>
<CardDescription>
Expand Down Expand Up @@ -107,7 +104,7 @@ export default async function Page() {
</CardContent>
</Card>

<Card>
<Card className="flex-1">
<CardHeader>
<CardTitle>Product</CardTitle>
<CardDescription>
Expand Down
7 changes: 7 additions & 0 deletions app/(authenticated)/services/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function ServicesPage() {
return (
<main className="flex min-h-screen flex-col p-8">
<h1 className="text-3xl font-bold">Services</h1>
</main>
)
}
7 changes: 7 additions & 0 deletions app/(authenticated)/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function SettingsPage() {
return (
<main className="flex min-h-screen flex-col p-8">
<h1 className="text-3xl font-bold">Settings</h1>
</main>
);
}
7 changes: 7 additions & 0 deletions app/(authenticated)/users/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function UsersPage() {
return (
<main className="flex min-h-screen flex-col p-8">
<h1 className="text-3xl font-bold">Users</h1>
</main>
)
}
198 changes: 133 additions & 65 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--font-sans: "Helvetica", "Arial", sans-serif;
--font-mono: ui-monospace, monospace;
--font-sans: Poppins, ui-sans-serif, sans-serif, system-ui;
--font-mono: JetBrains Mono, monospace;
--font-heading: "Helvetica", "Arial", sans-serif;
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
Expand Down Expand Up @@ -46,75 +46,142 @@
--radius-2xl: calc(var(--radius) * 1.8);
--radius-3xl: calc(var(--radius) * 2.2);
--radius-4xl: calc(var(--radius) * 2.6);
--font-serif: Source Serif 4, serif;
--radius: 0.375rem;
--tracking-tighter: calc(var(--tracking-normal) - 0.05em);
--tracking-tight: calc(var(--tracking-normal) - 0.025em);
--tracking-wide: calc(var(--tracking-normal) + 0.025em);
--tracking-wider: calc(var(--tracking-normal) + 0.05em);
--tracking-widest: calc(var(--tracking-normal) + 0.1em);
--tracking-normal: var(--tracking-normal);
--shadow-2xl: var(--shadow-2xl);
--shadow-xl: var(--shadow-xl);
--shadow-lg: var(--shadow-lg);
--shadow-md: var(--shadow-md);
--shadow: var(--shadow);
--shadow-sm: var(--shadow-sm);
--shadow-xs: var(--shadow-xs);
--shadow-2xs: var(--shadow-2xs);
--spacing: var(--spacing);
--letter-spacing: var(--letter-spacing);
--shadow-offset-y: var(--shadow-offset-y);
--shadow-offset-x: var(--shadow-offset-x);
--shadow-spread: var(--shadow-spread);
--shadow-blur: var(--shadow-blur);
--shadow-opacity: var(--shadow-opacity);
--color-shadow-color: var(--shadow-color);
--color-destructive-foreground: var(--destructive-foreground);
}

:root {
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.87 0 0);
--chart-2: oklch(0.556 0 0);
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
--radius: 0.625rem;
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
--background: oklch(0.9825 0.0098 87.4700);
--foreground: oklch(0.3211 0 0);
--card: oklch(1.0000 0 0);
--card-foreground: oklch(0.3211 0 0);
--popover: oklch(1.0000 0 0);
--popover-foreground: oklch(0.3211 0 0);
--primary: oklch(0.8426 0.0646 251.4359);
--primary-foreground: oklch(0 0 0);
--secondary: oklch(0.9125 0.1380 99.6725);
--secondary-foreground: oklch(0.3092 0 0);
--muted: oklch(0.9846 0.0017 247.8389);
--muted-foreground: oklch(0.5510 0.0234 264.3637);
--accent: oklch(0.9514 0.0250 236.8242);
--accent-foreground: oklch(0.3791 0.1378 265.5222);
--destructive: oklch(0.6368 0.2078 25.3313);
--border: oklch(0.9276 0.0058 264.5313);
--input: oklch(0.9276 0.0058 264.5313);
--ring: oklch(0.6231 0.1880 259.8145);
--chart-1: oklch(0.6231 0.1880 259.8145);
--chart-2: oklch(0.5461 0.2152 262.8809);
--chart-3: oklch(0.4882 0.2172 264.3763);
--chart-4: oklch(0.4244 0.1809 265.6377);
--chart-5: oklch(0.3791 0.1378 265.5222);
--radius: 0.375rem;
--sidebar: oklch(0.8426 0.0646 251.4359);
--sidebar-foreground: oklch(0 0 0);
--sidebar-primary: oklch(0.6231 0.1880 259.8145);
--sidebar-primary-foreground: oklch(1.0000 0 0);
--sidebar-accent: oklch(0.9514 0.0250 236.8242);
--sidebar-accent-foreground: oklch(0.3791 0.1378 265.5222);
--sidebar-border: oklch(0.9276 0.0058 264.5313);
--sidebar-ring: oklch(0.6231 0.1880 259.8145);
--destructive-foreground: oklch(1.0000 0 0);
--font-sans: Poppins, ui-sans-serif, sans-serif, system-ui;
--font-serif: Source Serif 4, serif;
--font-mono: JetBrains Mono, monospace;
--shadow-color: oklch(0 0 0);
--shadow-opacity: 0.1;
--shadow-blur: 3px;
--shadow-spread: 0px;
--shadow-offset-x: 0;
--shadow-offset-y: 1px;
--letter-spacing: 0em;
--spacing: 0.29rem;
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 2px 4px -1px hsl(0 0% 0% / 0.10);
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 4px 6px -1px hsl(0 0% 0% / 0.10);
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 8px 10px -1px hsl(0 0% 0% / 0.10);
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
--tracking-normal: 0em;
}

.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.205 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.87 0 0);
--chart-2: oklch(0.556 0 0);
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.556 0 0);
--background: oklch(0.2046 0 0);
--foreground: oklch(0.9219 0 0);
--card: oklch(0.2686 0 0);
--card-foreground: oklch(0.9219 0 0);
--popover: oklch(0.2686 0 0);
--popover-foreground: oklch(0.9219 0 0);
--primary: oklch(0.6231 0.1880 259.8145);
--primary-foreground: oklch(1.0000 0 0);
--secondary: oklch(0.2686 0 0);
--secondary-foreground: oklch(0.9219 0 0);
--muted: oklch(0.2393 0 0);
--muted-foreground: oklch(0.7155 0 0);
--accent: oklch(0.3791 0.1378 265.5222);
--accent-foreground: oklch(0.8823 0.0571 254.1284);
--destructive: oklch(0.6368 0.2078 25.3313);
--border: oklch(0.3715 0 0);
--input: oklch(0.3715 0 0);
--ring: oklch(0.6231 0.1880 259.8145);
--chart-1: oklch(0.7137 0.1434 254.6240);
--chart-2: oklch(0.6231 0.1880 259.8145);
--chart-3: oklch(0.5461 0.2152 262.8809);
--chart-4: oklch(0.4882 0.2172 264.3763);
--chart-5: oklch(0.4244 0.1809 265.6377);
--sidebar: oklch(0.2046 0 0);
--sidebar-foreground: oklch(0.9219 0 0);
--sidebar-primary: oklch(0.6231 0.1880 259.8145);
--sidebar-primary-foreground: oklch(1.0000 0 0);
--sidebar-accent: oklch(0.3791 0.1378 265.5222);
--sidebar-accent-foreground: oklch(0.8823 0.0571 254.1284);
--sidebar-border: oklch(0.3715 0 0);
--sidebar-ring: oklch(0.6231 0.1880 259.8145);
--destructive-foreground: oklch(1.0000 0 0);
--radius: 0.375rem;
--font-sans: Poppins, ui-sans-serif, sans-serif, system-ui;
--font-serif: Source Serif 4, serif;
--font-mono: JetBrains Mono, monospace;
--shadow-color: oklch(0 0 0);
--shadow-opacity: 0.1;
--shadow-blur: 3px;
--shadow-spread: 0px;
--shadow-offset-x: 0;
--shadow-offset-y: 1px;
--letter-spacing: 0em;
--spacing: 0.29rem;
--shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
--shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05);
--shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
--shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
--shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 2px 4px -1px hsl(0 0% 0% / 0.10);
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 4px 6px -1px hsl(0 0% 0% / 0.10);
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 8px 10px -1px hsl(0 0% 0% / 0.10);
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
}

@layer base {
Expand All @@ -123,6 +190,7 @@
}
body {
@apply bg-background text-foreground;
letter-spacing: var(--tracking-normal);
}
html {
@apply font-sans;
Expand Down
Loading
Loading