Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix share dashboard links

Steven Tey003d6d0a755d
diff --git a/apps/web/app/app.dub.co/(share)/layout.tsx b/apps/web/app/app.dub.co/(share)/layout.tsx
index bdb90f993c..83bd18b58a 100644
--- a/apps/web/app/app.dub.co/(share)/layout.tsx
+++ b/apps/web/app/app.dub.co/(share)/layout.tsx
@@ -4,10 +4,10 @@ import { ReactNode } from "react";
export default function dashboardLayout({ children }: { children: ReactNode }) {
return (
<div className="flex min-h-screen flex-col justify-between bg-gray-50/80">
- <NavMobile />
- <Nav />
+ <NavMobile staticDomain="app.dub.co" />
+ <Nav staticDomain="app.dub.co" />
{children}
- <Footer />
+ <Footer staticDomain="app.dub.co" />
</div>
);
}
diff --git a/packages/ui/src/footer.tsx b/packages/ui/src/footer.tsx
index a283202f12..5b4c2c4e9f 100644
--- a/packages/ui/src/footer.tsx
+++ b/packages/ui/src/footer.tsx
@@ -40,8 +40,11 @@ const navigation = {
})),
};
-export function Footer() {
- const { domain = "dub.co" } = useParams() as { domain: string };
+export function Footer({ staticDomain }: { staticDomain?: string }) {
+ let { domain = "dub.co" } = useParams() as { domain: string };
+ if (staticDomain) {
+ domain = staticDomain;
+ }
return (
<footer>
diff --git a/packages/ui/src/nav/nav-mobile.tsx b/packages/ui/src/nav/nav-mobile.tsx
index 2052d4f1b2..8b36749273 100644
--- a/packages/ui/src/nav/nav-mobile.tsx
+++ b/packages/ui/src/nav/nav-mobile.tsx
@@ -9,8 +9,18 @@ import useSWR from "swr";
import { AnimatedSizeContainer } from "../animated-size-container";
import { navItems, type NavTheme } from "./nav";
-export function NavMobile({ theme = "light" }: { theme?: NavTheme }) {
- const { domain = "dub.co" } = useParams() as { domain: string };
+export function NavMobile({
+ theme = "light",
+ staticDomain,
+}: {
+ theme?: NavTheme;
+ staticDomain?: string;
+}) {
+ let { domain = "dub.co" } = useParams() as { domain: string };
+ if (staticDomain) {
+ domain = staticDomain;
+ }
+
const [open, setOpen] = useState(false);
// prevent body scroll when modal is open
useEffect(() => {
diff --git a/packages/ui/src/nav/nav.tsx b/packages/ui/src/nav/nav.tsx
index 1b6c35dcda..56805cb99a 100644
--- a/packages/ui/src/nav/nav.tsx
+++ b/packages/ui/src/nav/nav.tsx
@@ -61,8 +61,17 @@ const navItemStyles = cva(
},
);
-export function Nav({ theme = "light" }: { theme?: NavTheme }) {
- const { domain = "dub.co" } = useParams() as { domain: string };
+export function Nav({
+ theme = "light",
+ staticDomain,
+}: {
+ theme?: NavTheme;
+ staticDomain?: string;
+}) {
+ let { domain = "dub.co" } = useParams() as { domain: string };
+ if (staticDomain) {
+ domain = staticDomain;
+ }
const scrolled = useScroll(80);
const scrolledHalf = useScroll(40);