The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
fix NavLogo
Steven Teye9935e18daf9
diff --git a/apps/web/app/app.dub.co/(dashboard)/layout.tsx b/apps/web/app/app.dub.co/(dashboard)/layout.tsxindex 416f6d9e95..754d179574 100644--- a/apps/web/app/app.dub.co/(dashboard)/layout.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/layout.tsx@@ -23,7 +23,7 @@ export default function Layout({ children }: { children: ReactNode }) {<div className="flex h-16 items-center justify-between"><div className="flex items-center"><Link href="/" className="hidden sm:block">- <NavLogo variant="symbol" />+ <NavLogo variant="symbol" isInApp /></Link><Divider className="hidden h-8 w-8 text-gray-200 sm:ml-3 sm:block" /><WorkspaceSwitcher />diff --git a/packages/ui/package.json b/packages/ui/package.jsonindex eb17700920..60ea4705ff 100644--- a/packages/ui/package.json+++ b/packages/ui/package.json@@ -1,7 +1,7 @@{"name": "@dub/ui","description": "UI components for Dub.co",- "version": "0.1.21",+ "version": "0.1.24","sideEffects": false,"main": "./dist/index.js","module": "./dist/index.mjs",diff --git a/packages/ui/src/nav-logo.tsx b/packages/ui/src/nav-logo.tsxindex fa192d2bfd..5deca072e8 100644--- a/packages/ui/src/nav-logo.tsx+++ b/packages/ui/src/nav-logo.tsx@@ -3,6 +3,7 @@import { cn } from "@dub/utils";import * as Popover from "@radix-ui/react-popover";import { BoxSelect, Home, LayoutGrid, Type } from "lucide-react";+import { useParams } from "next/navigation";import { MouseEvent, useCallback, useContext, useState } from "react";import { toast } from "sonner";import { Button, ButtonProps } from "./button";@@ -35,13 +36,15 @@ async function copy(text: string) {*/export function NavLogo({variant = "full",- isInApp = true,+ isInApp,className,}: {variant?: "full" | "symbol";isInApp?: boolean;className?: string;}) {+ const { domain = "dub.co" } = useParams() as { domain: string };+const { theme } = useContext(NavContext);const [isPopoverOpen, setIsPopoverOpen] = useState(false);@@ -80,7 +83,7 @@ export function NavLogo({setIsPopoverOpen(false);}}>- <div className="grid gap-1 rounded-lg border border-gray-200 bg-white p-2 drop-shadow-sm dark:border-white/[0.15] dark:bg-black sm:min-w-[240px]">+ <div className="grid gap-1 rounded-lg border border-gray-200 bg-white p-2 drop-shadow-sm sm:min-w-[240px] dark:border-white/[0.15] dark:bg-black"><ContextMenuButtontext="Copy Logo as SVG"variant="outline"@@ -99,7 +102,8 @@ export function NavLogo({onClick={() => window.open("https://dub.co/brand", "_blank")}icon={<BoxSelect strokeWidth={2} className="h-4 w-4" />}/>- {isInApp ? (+ {/* If it's in the app or it's a domain placeholder page (not dub.co homepage), show the home button */}+ {isInApp || domain != "dub.co" ? (<ContextMenuButtontext="Home Page"variant="outline"diff --git a/packages/ui/src/nav-mobile.tsx b/packages/ui/src/nav-mobile.tsxindex f58b70be88..db599fa414 100644--- a/packages/ui/src/nav-mobile.tsx+++ b/packages/ui/src/nav-mobile.tsx@@ -35,7 +35,7 @@ export function NavMobile({ theme = "light" }: { theme?: NavTheme }) {<buttononClick={() => setOpen(!open)}className={cn(- "fixed right-3 top-3 z-40 rounded-full p-2 transition-colors duration-200 hover:bg-gray-200 focus:outline-none active:bg-gray-300 dark:hover:bg-white/20 dark:active:bg-white/30 lg:hidden",+ "fixed right-3 top-3 z-40 rounded-full p-2 transition-colors duration-200 hover:bg-gray-200 focus:outline-none active:bg-gray-300 lg:hidden dark:hover:bg-white/20 dark:active:bg-white/30",open && "hover:bg-gray-100 active:bg-gray-200",)}>@@ -47,7 +47,7 @@ export function NavMobile({ theme = "light" }: { theme?: NavTheme }) {</button><navclassName={cn(- "fixed inset-0 z-20 hidden w-full bg-white px-5 py-16 dark:bg-black dark:text-white/70 lg:hidden",+ "fixed inset-0 z-20 hidden w-full bg-white px-5 py-16 lg:hidden dark:bg-black dark:text-white/70",open && "block",)}>