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.

improve tooltip

Steven Tey4c8aaa505217
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/integrations/[integrationSlug]/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/integrations/[integrationSlug]/page-client.tsx
index 797efa70cd..3dabd3072c 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/integrations/[integrationSlug]/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/integrations/[integrationSlug]/page-client.tsx
@@ -18,6 +18,7 @@ import {
TokenAvatar,
} from "@dub/ui";
import { ConnectedDots, Globe, OfficeBuilding } from "@dub/ui/src/icons";
+import { TooltipContent } from "@dub/ui/src/tooltip";
import { cn, formatDate, getPrettyUrl } from "@dub/utils";
import { BookOpenText, ChevronLeft, Trash } from "lucide-react";
import { useAction } from "next-safe-action/hooks";
@@ -96,11 +97,16 @@ export default function IntegrationPageClient({
onClick={() => {
setShowUninstallIntegrationModal(true);
}}
- disabledTooltip={
- integration.slug === "stripe"
- ? "You cannot uninstall the Stripe integration from here. Please visit the Stripe dashboard to uninstall the app."
- : null
- }
+ {...(integration.slug === "stripe" && {
+ disabledTooltip: (
+ <TooltipContent
+ title="You cannot uninstall the Stripe integration from here. Please visit the Stripe dashboard to uninstall the app."
+ cta="Go to Stripe"
+ href="https://dashboard.stripe.com/settings/apps/dub.co"
+ target="_blank"
+ />
+ ),
+ })}
/>
</div>
}
diff --git a/packages/ui/src/tooltip.tsx b/packages/ui/src/tooltip.tsx
index b18eedb990..7c640ee264 100644
--- a/packages/ui/src/tooltip.tsx
+++ b/packages/ui/src/tooltip.tsx
@@ -1,13 +1,13 @@
"use client";
-import { nFormatter, timeAgo } from "@dub/utils";
+import { cn, nFormatter, timeAgo } from "@dub/utils";
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
import Linkify from "linkify-react";
import { HelpCircle } from "lucide-react";
import Link from "next/link";
import { ReactNode, useState } from "react";
import { Badge } from "./badge";
-import { ButtonProps } from "./button";
+import { Button, ButtonProps, buttonVariants } from "./button";
export function TooltipProvider({ children }: { children: ReactNode }) {
return (
@@ -84,18 +84,15 @@ export function TooltipContent({
<Link
href={href}
{...(target ? { target } : {})}
- className="mt-4 w-full rounded-md border border-black bg-black px-3 py-1.5 text-center text-sm text-white transition-all hover:bg-white hover:text-black"
+ className={cn(
+ buttonVariants({ variant: "primary" }),
+ "flex h-9 w-full items-center justify-center whitespace-nowrap rounded-lg border px-4 text-sm",
+ )}
>
{cta}
</Link>
) : onClick ? (
- <button
- type="button"
- className="mt-4 w-full rounded-md border border-black bg-black px-3 py-1.5 text-center text-sm text-white transition-all hover:bg-white hover:text-black"
- onClick={onClick}
- >
- {cta}
- </button>
+ <Button onClick={onClick} text={cta} variant="primary" />
) : null)}
</div>
);