Skip to content
Open
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
7 changes: 5 additions & 2 deletions app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { useState } from "react";
import { Sidebar, SidebarBody, SidebarLink } from "@/components/ui/sidebar";
import { IconArrowLeft, IconBrandTabler, IconSettings, IconUserBolt } from "@tabler/icons-react";
import { cn } from "@/lib/utils";
import { useUser } from "@clerk/nextjs";
import { User } from "@clerk/nextjs/server";

const links = [
{
Expand Down Expand Up @@ -42,11 +44,12 @@ export default function DashboardLayout({
children: React.ReactNode;
}>) {
const [open, setOpen] = useState(true);
const { user } = useUser();

return (
<div className="flex h-screen">
<Sidebar open={open} setOpen={setOpen}>
<SidebarBody className="justify-between gap-10 bg-[#18191a]">
<SidebarBody className="justify-between gap-10 bg-[#0a0a0a]">
<div className="flex flex-1 flex-col overflow-x-hidden overflow-y-auto">
{open ? <Logo /> : <LogoIcon />}
<div className="mt-8 flex flex-col gap-2">
Expand All @@ -58,7 +61,7 @@ export default function DashboardLayout({
<div>
<SidebarLink
link={{
label: "User Name",
label: user?.fullName || user?.firstName || "User",
href: "#",
icon: (
<img
Expand Down
8 changes: 7 additions & 1 deletion app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@
0% {
background-position: 0%;}
100% {
background-position: 200%;}}}
background-position: 200%;}}
--animate-pulse: pulse var(--duration) ease-out infinite;
@keyframes pulse {
0%, 100% {
boxShadow: 0 0 0 0 var(--pulse-color);}
50% {
boxShadow: 0 0 0 8px var(--pulse-color);}}}

:root {
--radius: 0.625rem;
Expand Down
29 changes: 20 additions & 9 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import { Analytics } from "@vercel/analytics/next";
import {
ClerkProvider,
SignInButton,
SignUpButton,
SignedIn,
SignedOut,
UserButton,
} from '@clerk/nextjs'

const geistSans = Geist({
variable: "--font-geist-sans",
Expand All @@ -22,14 +30,17 @@ export default function RootLayout({
children: React.ReactNode;
}>) {
return (
<html lang="en">
<head>
<link rel="icon" href="/magnified.png" />
</head>
<body className={` bg-[#0a0a0a] ${geistSans.variable} ${geistMono.variable} antialiased`}>
<Analytics/>
{children}
</body>
</html>
<ClerkProvider afterSignInUrl="/dashboard" afterSignUpUrl="/dashboard">
<html lang="en">
<head>
<link rel="icon" href="/magnified.png" />
</head>
<body className={` bg-[#0a0a0a] ${geistSans.variable} ${geistMono.variable} antialiased`}>
<Analytics/>
{children}
</body>
</html>
</ClerkProvider>

);
}
12 changes: 8 additions & 4 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { AuroraTextDemo } from "@/components/magicui/aurora";
import { InputDemo } from "@/components/ui/waitlist";
import { AnimatedGradientTextDemo } from "@/components/magicui/Animatedintro";
import { Poppins } from "next/font/google";
import { Auth } from "@/components/ui/onboarding";
import { SignedOut } from '@clerk/nextjs';

const poppins = Poppins({
subsets: ["latin"],
Expand Down Expand Up @@ -40,10 +42,12 @@ export default function Home() {
</span>.
</p>

{/* Waitlist / Input */}
<div className="w-full max-w-md">
<InputDemo />
</div>
<br/>
<div>
<SignedOut>
<Auth/>
</SignedOut>
</div>
</div>
</SpotlightNewDemo>
);
Expand Down
3 changes: 3 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"registries": {
"@magicui": "https://magicui.design/r/{name}.json"
}
}
11 changes: 11 additions & 0 deletions components/ui/onboarding.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"use client"
import { Button, buttonVariants } from "./button"
import { SignInButton } from '@clerk/nextjs'

export function Auth() {
return (
<SignInButton mode="modal">
<Button>Get Started</Button>
</SignInButton>
)
}
4 changes: 4 additions & 0 deletions components/ui/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { cn } from "@/lib/utils";
import React, { useState, createContext, useContext } from "react";
import { AnimatePresence, motion } from "motion/react";
import { IconMenu2, IconX } from "@tabler/icons-react";
import { useUser } from "@clerk/nextjs";

interface Links {
label: string;
Expand Down Expand Up @@ -56,6 +57,7 @@ export const Sidebar = ({
open,
setOpen,
animate,

}: {
children: React.ReactNode;
open?: boolean;
Expand Down Expand Up @@ -84,6 +86,7 @@ export const DesktopSidebar = ({
...props
}: React.ComponentProps<typeof motion.div>) => {
const { open, setOpen, animate } = useSidebar();
const { user } = useUser();
return (
<>
<motion.div
Expand All @@ -110,6 +113,7 @@ export const MobileSidebar = ({
...props
}: React.ComponentProps<"div">) => {
const { open, setOpen } = useSidebar();
const { user } = useUser();
return (
<>
<div
Expand Down
16 changes: 16 additions & 0 deletions middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server';

const isPublicRoute = createRouteMatcher(['/', '/dashboard']);

export default clerkMiddleware((auth, request) => {
if (!isPublicRoute(request)) auth.protect();
});

export const config = {
matcher: [
// Skip Next.js internals and all static files, unless found in search params
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
// Always run for API routes
'/(api|trpc)(.*)',
],
};
Loading