diff --git a/web/app/(pages)/layout.tsx b/web/app/(pages)/layout.tsx index 47c7fa0d..c4d3ec97 100644 --- a/web/app/(pages)/layout.tsx +++ b/web/app/(pages)/layout.tsx @@ -1,6 +1,5 @@ import { SignedInClient } from "@/components/custom/clerk/signed-in-client" import { Sidebar } from "@/components/custom/sidebar/sidebar" -import { PublicHomeRoute } from "@/components/routes/public/PublicHomeRoute" import { JazzClerkAuth, JazzProvider } from "@/lib/providers/jazz-provider" import { currentUser } from "@clerk/nextjs/server" import { CommandPalette } from "@/components/custom/command-palette/command-palette" @@ -9,7 +8,7 @@ export default async function PageLayout({ children }: { children: React.ReactNo const user = await currentUser() if (!user) { - return + return children } return ( diff --git a/web/app/(pages)/page.tsx b/web/app/(pages)/links/page.tsx similarity index 69% rename from web/app/(pages)/page.tsx rename to web/app/(pages)/links/page.tsx index daa5ee79..682f9c0a 100644 --- a/web/app/(pages)/page.tsx +++ b/web/app/(pages)/links/page.tsx @@ -1,5 +1,5 @@ import { LinkRoute } from "@/components/routes/link/LinkRoute" -export default function HomePage() { +export default function LinksPage() { return } diff --git a/web/app/(public)/layout.tsx b/web/app/(public)/layout.tsx new file mode 100644 index 00000000..95c7ee6d --- /dev/null +++ b/web/app/(public)/layout.tsx @@ -0,0 +1,7 @@ +export default function PublicLayout({ + children +}: Readonly<{ + children: React.ReactNode +}>) { + return
{children}
+} diff --git a/web/app/page.tsx b/web/app/page.tsx new file mode 100644 index 00000000..5cb37316 --- /dev/null +++ b/web/app/page.tsx @@ -0,0 +1,5 @@ +import { PublicHomeRoute } from "@/components/routes/public/PublicHomeRoute" + +export default function HomePage() { + return +} diff --git a/web/components/custom/sidebar/partial/link-section.tsx b/web/components/custom/sidebar/partial/link-section.tsx index 72eeb615..1d143b82 100644 --- a/web/components/custom/sidebar/partial/link-section.tsx +++ b/web/components/custom/sidebar/partial/link-section.tsx @@ -14,7 +14,7 @@ export const LinkSection: React.FC<{ pathname: string }> = ({ pathname }) => { }) const linkCount = me?.root.personalLinks?.length || 0 - const isActive = pathname === "/" + const isActive = pathname === "/links" if (!me) return null @@ -39,7 +39,7 @@ const LinkSectionHeader: React.FC = ({ linkCount, isActi )} > = ({ label, href, count, isActive }) => { return (
-
+ {/*
= ({ label, href, count, isActive }) => {count > 0 && ( {count} )} -
+
*/}
) } diff --git a/web/components/custom/sidebar/sidebar.tsx b/web/components/custom/sidebar/sidebar.tsx index f05afe08..ec947915 100644 --- a/web/components/custom/sidebar/sidebar.tsx +++ b/web/components/custom/sidebar/sidebar.tsx @@ -78,7 +78,7 @@ const LogoAndSearch: React.FC = React.memo(() => { return (
- +
diff --git a/web/components/routes/public/PublicHomeRoute.tsx b/web/components/routes/public/PublicHomeRoute.tsx index ea1f7ab1..ab4a14a5 100644 --- a/web/components/routes/public/PublicHomeRoute.tsx +++ b/web/components/routes/public/PublicHomeRoute.tsx @@ -5,6 +5,7 @@ import dynamic from "next/dynamic" import { motion } from "framer-motion" import { Autocomplete } from "./Autocomplete" import { useRouter } from "next/navigation" +import { useAccount } from "@/lib/providers/jazz-provider" let graph_data_promise = import("./graph-data.json").then(a => a.default) @@ -20,6 +21,7 @@ export function PublicHomeRoute() { const router = useRouter() const raw_graph_data = React.use(graph_data_promise) as GraphNode[] const [filterQuery, setFilterQuery] = React.useState("") + const { me } = useAccount() const handleTopicSelect = (topicName: string) => { router.push(`/${topicName}`) @@ -30,35 +32,37 @@ export function PublicHomeRoute() { } return ( -
- handleTopicSelect(val)} - filter_query={filterQuery} - /> - - - - I want to learn - - handleTopicSelect(topic.name)} - onInputChange={handleInputChange} + <> +
+ handleTopicSelect(val)} + filter_query={filterQuery} /> - -
+ + + + I want to learn + + handleTopicSelect(topic.name)} + onInputChange={handleInputChange} + /> + +
+ ) } diff --git a/web/middleware.ts b/web/middleware.ts index 9a3894dd..3059c4a8 100644 --- a/web/middleware.ts +++ b/web/middleware.ts @@ -1,6 +1,7 @@ import { clerkMiddleware, createRouteMatcher } from "@clerk/nextjs/server" -const isPublicRoute = createRouteMatcher(["/sign-in(.*)", "/sign-up(.*)", "/"]) +const publicRoutes = ["/", "/sign-in(.*)", "/sign-up(.*)"] +const isPublicRoute = createRouteMatcher(publicRoutes) export default clerkMiddleware((auth, request) => { if (!isPublicRoute(request)) {