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.

Callout component added and pages updated

Marcus Farrelle7123dba5528
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/customers/[customerId]/page-client.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/customers/[customerId]/page-client.tsx
index 699c7c8b82..07ddd912d4 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/customers/[customerId]/page-client.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/[programSlug]/(enrolled)/customers/[customerId]/page-client.tsx
@@ -10,10 +10,10 @@ import { CustomerSalesTable } from "@/ui/customers/customer-sales-table";
import { PageContent } from "@/ui/layout/page-content";
import { PageWidthWrapper } from "@/ui/layout/page-width-wrapper";
import { ProgramRewardList } from "@/ui/partners/program-reward-list";
+import { Callout } from "@/ui/shared/callout";
import { Button, ChevronRight, MoneyBill2, Tooltip, User } from "@dub/ui";
import { cn, fetcher, formatDate } from "@dub/utils";
import { addMonths, isBefore } from "date-fns";
-import { AlertCircle } from "lucide-react";
import Link from "next/link";
import { redirect, useParams } from "next/navigation";
import { memo, useMemo } from "react";
@@ -118,14 +118,11 @@ export function ProgramCustomerPageClient() {
</div>
{rewardPeriodEndDate &&
isBefore(rewardPeriodEndDate, new Date()) && (
- <div className="flex items-center gap-2 rounded-lg border border-amber-100 bg-amber-50 px-3 py-2">
- <AlertCircle className="size-4 shrink-0 text-amber-600" />
- <p className="text-sm text-amber-900">
- The earning period for this customer has ended as of{" "}
- {formatDate(rewardPeriodEndDate)}. No future conversions
- will be rewarded.
- </p>
- </div>
+ <Callout variant="warn" size={2}>
+ The earning period for this customer has ended as of{" "}
+ {formatDate(rewardPeriodEndDate)}. No future conversions
+ will be rewarded.
+ </Callout>
)}
<div className="border-border-subtle overflow-hidden rounded-lg border">
diff --git a/apps/web/app/app.dub.co/(auth)/oauth/authorize/page.tsx b/apps/web/app/app.dub.co/(auth)/oauth/authorize/page.tsx
index f80f079e72..b892c74e58 100644
--- a/apps/web/app/app.dub.co/(auth)/oauth/authorize/page.tsx
+++ b/apps/web/app/app.dub.co/(auth)/oauth/authorize/page.tsx
@@ -1,9 +1,10 @@
import { validateAuthorizeRequest } from "@/lib/api/oauth/actions";
import { getSession } from "@/lib/auth";
import { authorizeRequestSchema } from "@/lib/zod/schemas/oauth";
+import { Callout } from "@/ui/shared/callout";
import EmptyState from "@/ui/shared/empty-state";
import { BlurImage, Logo } from "@dub/ui";
-import { CircleWarning, CubeSettings } from "@dub/ui/icons";
+import { CubeSettings } from "@dub/ui/icons";
import { constructMetadata } from "@dub/utils";
import { ArrowLeftRight } from "lucide-react";
import { redirect } from "next/navigation";
@@ -81,9 +82,12 @@ export default async function Authorize(props: {
</span>
{!integration.verified && (
- <div className="flex w-full items-start gap-2.5 rounded-lg border border-amber-200 bg-amber-50 p-3 text-left sm:-mx-6 sm:w-auto sm:self-stretch">
- <CircleWarning className="mt-0.5 size-4 shrink-0 text-amber-600" />
- <div className="flex flex-col gap-0.5 text-sm text-amber-900">
+ <Callout
+ variant="warn"
+ size={2}
+ className="w-full text-left sm:-mx-6 sm:w-auto sm:self-stretch"
+ >
+ <div className="flex flex-col gap-0.5">
<p className="font-medium">
Dub hasn't verified this integration
</p>
@@ -92,7 +96,7 @@ export default async function Authorize(props: {
workspace.
</p>
</div>
- </div>
+ </Callout>
)}
</div>
<div className="flex flex-col space-y-3 px-4 py-6 sm:px-10">
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/commissions/create-commission-sheet.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/commissions/create-commission-sheet.tsx
index b7ad59f1f4..cb9250d3a2 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/commissions/create-commission-sheet.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/commissions/create-commission-sheet.tsx
@@ -17,6 +17,7 @@ import {
ProgramSheetAccordionItem,
ProgramSheetAccordionTrigger,
} from "@/ui/partners/program-sheet-accordion";
+import { Callout } from "@/ui/shared/callout";
import { X } from "@/ui/shared/icons";
import { MaxCharactersCounter } from "@/ui/shared/max-characters-counter";
import {
@@ -668,26 +669,26 @@ function CreateCommissionSheetContent({
<LoadingSpinner />
</div>
) : noStripeCustomerId ? (
- <div className="rounded-lg border border-amber-200 bg-amber-50/80 p-4">
- <p className="text-sm font-medium text-amber-800">
+ <Callout variant="warn" size={2}>
+ <p className="font-medium">
No Stripe customer ID
</p>
- <p className="mt-1 text-xs text-amber-700">
+ <p className="mt-1">
{noStripeCustomerMessage ??
"This customer doesn't have a Stripe customer ID. Add one in the customer profile to use paid Stripe invoices here."}
</p>
<a
href={`/${slug}/program/customers/${customerId}`}
target="_blank"
- className="mt-2 inline-block text-xs font-medium text-amber-800 underline hover:no-underline"
+ className="mt-2 inline-block font-medium underline hover:no-underline"
>
Open customer profile →
</a>
- </div>
+ </Callout>
) : stripeInvoicesError ? (
- <div className="rounded-lg border border-red-200 bg-red-50/80 p-4 text-sm text-red-800">
+ <Callout variant="error" size={2}>
Failed to load invoices. Try again.
- </div>
+ </Callout>
) : stripeInvoices.length === 0 ? (
<div className="flex h-24 flex-col items-center justify-center rounded-lg border border-neutral-200 bg-neutral-50/30 text-center">
<p className="text-sm font-medium text-neutral-600">
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/program-payout-mode-section.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/program-payout-mode-section.tsx
index e1749fe6c7..5f1109a5fc 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/program-payout-mode-section.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/program-payout-mode-section.tsx
@@ -2,7 +2,8 @@
import useProgram from "@/lib/swr/use-program";
import useWorkspace from "@/lib/swr/use-workspace";
-import { CircleDollarOut, Webhook } from "@dub/ui";
+import { Callout } from "@/ui/shared/callout";
+import { CircleDollarOut } from "@dub/ui";
import { ProgramPayoutMode } from "@prisma/client";
import Link from "next/link";
@@ -70,22 +71,19 @@ function WebhookInfo() {
const { slug } = useWorkspace();
return (
- <div className="flex items-start gap-2 rounded-md border border-amber-100 bg-amber-50 p-2.5">
- <Webhook className="mt-0.5 size-3.5 shrink-0 text-amber-600" />
- <p className="text-xs font-medium leading-4 text-amber-900">
- Ensure webhooks are configured to listen for the{" "}
- <code className="rounded bg-amber-200 px-1 py-0.5 font-mono text-xs text-amber-900">
- payout.confirmed
- </code>{" "}
- event.{" "}
- <Link
- href={`/${slug}/settings/webhooks`}
- target="_blank"
- className="font-medium underline underline-offset-2 hover:text-amber-800"
- >
- Manage webhooks
- </Link>
- </p>
- </div>
+ <Callout variant="warn" size={1}>
+ Ensure webhooks are configured to listen for the{" "}
+ <code className="rounded bg-amber-200 px-1 py-0.5 font-mono text-xs text-amber-900">
+ payout.confirmed
+ </code>{" "}
+ event.{" "}
+ <Link
+ href={`/${slug}/settings/webhooks`}
+ target="_blank"
+ className="font-medium underline underline-offset-2 hover:text-amber-800"
+ >
+ Manage webhooks
+ </Link>
+ </Callout>
);
}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/domains/email/email-domain-dns-records.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/domains/email/email-domain-dns-records.tsx
index 5fd354b81b..c0b01a15bc 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/domains/email/email-domain-dns-records.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/settings/domains/email/email-domain-dns-records.tsx
@@ -6,10 +6,10 @@ import type { DomainConnectDiscovery } from "@/lib/domain-connect/types";
import useWorkspace from "@/lib/swr/use-workspace";
import { EmailDomainProps } from "@/lib/types";
import { useForwardDnsInstructionsModal } from "@/ui/modals/forward-dns-instructions-modal";
+import { Callout } from "@/ui/shared/callout";
import { GetDomainResponseSuccess } from "@dub/email/resend/types";
import {
Button,
- CircleCheck,
Cloudflare,
CopyButton,
StatusBadge,
@@ -310,13 +310,10 @@ export function EmailDomainDnsRecords({ domain }: EmailDomainDnsRecordsProps) {
return (
<div className="mt-4 space-y-4">
{isVerified ? (
- <div className="flex items-center gap-2 text-pretty rounded-lg bg-green-100/80 p-3 text-sm text-green-600">
- <CircleCheck className="h-5 w-5 shrink-0" />
- <div>
- Good news! All the DNS records are verified. You are ready to start
- sending emails with this domain.
- </div>
- </div>
+ <Callout variant="success" size={2}>
+ Good news! All the DNS records are verified. You are ready to start
+ sending emails with this domain.
+ </Callout>
) : records && records.length > 0 ? (
<div className="flex flex-col gap-8">
<div className="flex flex-col gap-4 rounded-lg border border-neutral-200 bg-neutral-100 p-4">
diff --git a/apps/web/app/app.dub.co/(dashboard)/account/settings/tokens/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/account/settings/tokens/page-client.tsx
index 2da0e6b23c..469e803dee 100644
--- a/apps/web/app/app.dub.co/(dashboard)/account/settings/tokens/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/account/settings/tokens/page-client.tsx
@@ -2,8 +2,9 @@
import { TokenProps } from "@/lib/types";
import { useDeleteTokenModal } from "@/ui/modals/delete-token-modal";
+import { Callout } from "@/ui/shared/callout";
import { TokenAvatar } from "@/ui/token-avatar";
-import { IconMenu, LoadingSpinner, Popover, TriangleWarning } from "@dub/ui";
+import { IconMenu, LoadingSpinner, Popover } from "@dub/ui";
import { fetcher, timeAgo } from "@dub/utils";
import { FolderOpen, MoreVertical, Trash } from "lucide-react";
import { useState } from "react";
@@ -17,29 +18,26 @@ export default function TokensPageClient() {
return (
<>
- <div className="flex items-start gap-3 rounded-lg border border-amber-200 bg-amber-50 px-4 py-2.5">
- <TriangleWarning className="mt-0.5 size-4 shrink-0 text-amber-600" />
- <p className="flex-1 text-sm text-amber-900">
- User API Keys have been replaced by Workspace API Keys. We recommend
- creating a new{" "}
- <a
- href="https://dub.co/docs/api-reference/tokens"
- target="_blank"
- className="font-medium underline underline-offset-2 transition-colors hover:text-neutral-800"
- >
- Workspace API Key
- </a>{" "}
- for more granular control over your resources such as Links, Tags,
- Domains, Analytics, etc.{" "}
- <a
- href="https://dub.co/blog/workspace-api-keys"
- target="_blank"
- className="font-medium underline underline-offset-2 transition-colors hover:text-neutral-800"
- >
- Read the announcement.
- </a>
- </p>
- </div>
+ <Callout variant="warn" size={2}>
+ User API Keys have been replaced by Workspace API Keys. We recommend
+ creating a new{" "}
+ <a
+ href="https://dub.co/docs/api-reference/tokens"
+ target="_blank"
+ className="font-medium underline underline-offset-2 transition-colors hover:text-neutral-800"
+ >
+ Workspace API Key
+ </a>{" "}
+ for more granular control over your resources such as Links, Tags,
+ Domains, Analytics, etc.{" "}
+ <a
+ href="https://dub.co/blog/workspace-api-keys"
+ target="_blank"
+ className="font-medium underline underline-offset-2 transition-colors hover:text-neutral-800"
+ >
+ Read the announcement.
+ </a>
+ </Callout>
<div className="mt-6 rounded-lg border border-neutral-200 bg-white">
{isLoading || !tokens ? (
diff --git a/apps/web/ui/domains/domain-card.tsx b/apps/web/ui/domains/domain-card.tsx
index cc81c6e04b..a074650fb2 100644
--- a/apps/web/ui/domains/domain-card.tsx
+++ b/apps/web/ui/domains/domain-card.tsx
@@ -7,10 +7,10 @@ import {
DomainVerificationStatusProps,
LinkProps,
} from "@/lib/types";
+import { Callout } from "@/ui/shared/callout";
import { CheckCircleFill, Delete, Repeat, ThreeDots } from "@/ui/shared/icons";
import {
Button,
- CircleCheck,
Copy,
Popover,
Refresh2,
@@ -310,20 +310,17 @@ export default function DomainCard({ props }: { props: DomainProps }) {
>
{verificationData ? (
verificationData.status === "Valid Configuration" ? (
- <div className="mt-6 flex items-center gap-2 text-pretty rounded-lg bg-green-100/80 p-3 text-sm text-green-600">
- <CircleCheck className="h-5 w-5 shrink-0" />
- <div>
- Good news! Your DNS records are set up correctly, but it can
- take some time for them to propagate globally.{" "}
- <Link
- href="https://dub.co/help/article/how-to-add-custom-domain#how-long-do-i-have-to-wait-for-my-domain-to-work"
- target="_blank"
- className="underline transition-colors hover:text-green-800"
- >
- Learn more.
- </Link>
- </div>
- </div>
+ <Callout variant="success" size={2} className="mt-6">
+ Good news! Your DNS records are set up correctly, but it can
+ take some time for them to propagate globally.{" "}
+ <Link
+ href="https://dub.co/help/article/how-to-add-custom-domain#how-long-do-i-have-to-wait-for-my-domain-to-work"
+ target="_blank"
+ className="underline transition-colors hover:text-green-800"
+ >
+ Learn more.
+ </Link>
+ </Callout>
) : (
<DomainConfiguration
data={verificationData}
diff --git a/apps/web/ui/links/links-container.tsx b/apps/web/ui/links/links-container.tsx
index e24ce1bc3b..9efb5e2ee7 100644
--- a/apps/web/ui/links/links-container.tsx
+++ b/apps/web/ui/links/links-container.tsx
@@ -18,6 +18,7 @@ import {
} from "react";
import { PageWidthWrapper } from "../layout/page-width-wrapper";
import { AnimatedEmptyState } from "../shared/animated-empty-state";
+import { Callout } from "../shared/callout";
import { LinkCard } from "./link-card";
import LinkCardPlaceholder from "./link-card-placeholder";
import { LinkSelectionProvider } from "./link-selection-provider";
@@ -108,9 +109,9 @@ function LinksList({
<LinksListContext.Provider value={{ openMenuLinkId, setOpenMenuLinkId }}>
<LinkSelectionProvider links={links}>
{error ? (
- <div className="rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800">
+ <Callout variant="error" size={2}>
{errorMessage}
- </div>
+ </Callout>
) : !links || links.length ? (
// Cards
<CardList variant={compact ? "compact" : "loose"} loading={loading}>
diff --git a/apps/web/ui/modals/delete-token-modal.tsx b/apps/web/ui/modals/delete-token-modal.tsx
index 88eb95a947..f523bbded0 100644
--- a/apps/web/ui/modals/delete-token-modal.tsx
+++ b/apps/web/ui/modals/delete-token-modal.tsx
@@ -1,7 +1,7 @@
import useWorkspace from "@/lib/swr/use-workspace";
import { TokenProps } from "@/lib/types";
+import { Callout } from "@/ui/shared/callout";
import { Button, Key, Modal, Tooltip, useMediaQuery } from "@dub/ui";
-import { TriangleWarning } from "@dub/ui/icons";
import { timeAgo } from "@dub/utils";
import {
Dispatch,
@@ -89,20 +89,19 @@ function DeleteTokenModal({
className="flex flex-col space-y-4 bg-neutral-50 px-4 py-4 sm:px-6"
>
{token.lastUsed && (
- <div className="flex items-start gap-3 rounded-lg border border-amber-200 bg-amber-50 p-4">
- <TriangleWarning className="mt-0.5 size-4 shrink-0 text-amber-600" />
+ <Callout variant="warn" size={2}>
<div className="space-y-1">
- <h3 className="text-sm font-semibold text-amber-900">
+ <h3 className="font-semibold">
This key is actively in use (last used{" "}
{timeAgo(token.lastUsed, { withAgo: true })})
</h3>
- <p className="text-sm text-amber-900">
+ <p>
Deleting this key will immediately break any integrations,
tracking, or API requests that depend on it. Are you sure you
want to continue?
</p>
</div>
- </div>
+ </Callout>
)}
<div className="relative flex items-center gap-2 space-x-3 rounded-md border border-neutral-300 bg-white px-4 py-2">
diff --git a/apps/web/ui/modals/link-builder/ab-testing-modal.tsx b/apps/web/ui/modals/link-builder/ab-testing-modal.tsx
index ce913db69d..839fa26b4b 100644
--- a/apps/web/ui/modals/link-builder/ab-testing-modal.tsx
+++ b/apps/web/ui/modals/link-builder/ab-testing-modal.tsx
@@ -8,6 +8,7 @@ import { useLinkBuilderKeyboardShortcut } from "@/ui/links/link-builder/use-link
import { useAvailableDomains } from "@/ui/links/use-available-domains";
import { useEndABTestingModal } from "@/ui/modals/link-builder/ab-testing/end-ab-testing-modal";
import { BusinessBadgeTooltip } from "@/ui/shared/business-badge-tooltip";
+import { Callout } from "@/ui/shared/callout";
import { X } from "@/ui/shared/icons";
import {
AnimatedSizeContainer,
@@ -16,7 +17,6 @@ import {
InfoTooltip,
Modal,
Tooltip,
- TriangleWarning,
} from "@dub/ui";
import {
cn,
@@ -421,13 +421,10 @@ function ABTestingModal({
</div>
{testVariantsParent && (
- <div className="mt-6 flex items-start gap-2 rounded-lg border border-amber-200 bg-amber-50 p-4">
- <TriangleWarning className="mt-0.5 size-4 shrink-0 text-amber-600" />
- <p className="text-sm font-medium text-amber-900">
- Changing the original A/B test settings will impact your future
- analytics and event tracking.
- </p>
- </div>
+ <Callout variant="warn" size={2} className="mt-6">
+ Changing the original A/B test settings will impact your future
+ analytics and event tracking.
+ </Callout>
)}
<div className="mt-4 flex items-center justify-between">
diff --git a/apps/web/ui/modals/remove-workspace-user-modal.tsx b/apps/web/ui/modals/remove-workspace-user-modal.tsx
index a6960c2527..dce0a52d8a 100644
--- a/apps/web/ui/modals/remove-workspace-user-modal.tsx
+++ b/apps/web/ui/modals/remove-workspace-user-modal.tsx
@@ -1,9 +1,9 @@
import { mutatePrefix } from "@/lib/swr/mutate";
import useWorkspace from "@/lib/swr/use-workspace";
import { TokenProps, UserProps } from "@/lib/types";
+import { Callout } from "@/ui/shared/callout";
import { UserAvatar } from "@/ui/users/user-avatar";
import { Button, Modal, useMediaQuery } from "@dub/ui";
-import { TriangleWarning } from "@dub/ui/icons";
import { fetcher, timeAgo } from "@dub/utils";
import { useSession } from "next-auth/react";
import { useRouter, useSearchParams } from "next/navigation";
@@ -91,40 +91,34 @@ function RemoveWorkspaceUserModal({
const content = (
<>
{restrictedTokens && restrictedTokens.length > 0 && (
- <div className="space-y-3 rounded-lg border border-amber-200 bg-amber-50 p-4">
- <div className="flex-shrink-0">
- <TriangleWarning className="size-5 text-amber-600" />
- </div>
-
- <h3 className="text-sm font-semibold leading-5 text-amber-900">
- Warning: Active tokens detected
- </h3>
-
- <p className="text-sm font-normal text-amber-900">
- {self ? "You have" : "This user has"} {restrictedTokens.length}{" "}
- active tokens. {self ? "Leaving" : "Removing this user"} will
- invalidate these tokens and may disrupt the integration.
- </p>
+ <Callout variant="warn" size={2}>
+ <div className="space-y-3">
+ <h3 className="font-semibold">Warning: Active tokens detected</h3>
+
+ <p>
+ {self ? "You have" : "This user has"} {restrictedTokens.length}{" "}
+ active tokens. {self ? "Leaving" : "Removing this user"} will
+ invalidate these tokens and may disrupt the integration.
+ </p>
- <div>
- <ul className="mt-6 space-y-2">
+ <ul className="space-y-2">
{restrictedTokens.map((token, index) => (
<li key={index} className="flex items-center justify-between">
<a
href={`/${slug}/settings/tokens`}
target="_blank"
- className="line-clamp-1 text-sm font-medium leading-4 text-amber-900 underline underline-offset-2 hover:text-amber-700"
+ className="line-clamp-1 font-medium underline underline-offset-2 hover:text-amber-700"
>
{token.name}
</a>
- <span className="whitespace-nowrap text-xs font-normal leading-4 text-amber-700">
+ <span className="whitespace-nowrap text-xs text-amber-700">
used {timeAgo(token.lastUsed, { withAgo: true })}
</span>
</li>
))}
</ul>
</div>
- </div>
+ </Callout>
)}
<div className="relative flex items-center gap-2 space-x-3 rounded-md border border-neutral-300 bg-white px-4 py-2">
diff --git a/apps/web/ui/partners/fraud-risks/risk-disclaimer-banner.tsx b/apps/web/ui/partners/fraud-risks/risk-disclaimer-banner.tsx
index 3aabd7b9de..8b5ddf1051 100644
--- a/apps/web/ui/partners/fraud-risks/risk-disclaimer-banner.tsx
+++ b/apps/web/ui/partners/fraud-risks/risk-disclaimer-banner.tsx
@@ -1,28 +1,18 @@
-import { TriangleWarning } from "@dub/ui/icons";
-import { cn } from "@dub/utils";
+import { Callout } from "../../shared/callout";
export function RiskDisclaimerBanner({ className }: { className?: string }) {
return (
- <div
- className={cn(
- "flex items-start gap-3 rounded-lg border border-amber-200 bg-amber-50 px-4 py-2.5",
- className,
- )}
- >
- <TriangleWarning className="mt-0.5 size-4 shrink-0 text-amber-600" />
- <p className="flex-1 text-sm text-amber-900">
- We recommend reviewing the risk events thoroughly before taking action.
- Unresolved events expire after 30 days, except confirmed network-level
- bans.{" "}
- <a
- href="https://dub.co/help/article/risk-monitoring"
- target="_blank"
- className="font-medium underline underline-offset-2 transition-colors hover:text-neutral-800"
- >
- Learn more
- </a>
- .
- </p>
- </div>
+ <Callout variant="warn" size={2}>
+ We recommend reviewing the risk events thoroughly before taking action.
+ Unresolved events expire after 30 days, except confirmed network-level
+ bans.{" "}
+ <a
+ href="https://dub.co/help/article/risk-monitoring"
+ target="_blank"
+ className="font-medium underline underline-offset-2 transition-colors hover:text-neutral-800"
+ >
+ Learn more
+ </a>
+ </Callout>
);
}
diff --git a/apps/web/ui/partners/merge-accounts/merge-account-form.tsx b/apps/web/ui/partners/merge-accounts/merge-account-form.tsx
index 4c6ccce789..103c18dfe5 100644
--- a/apps/web/ui/partners/merge-accounts/merge-account-form.tsx
+++ b/apps/web/ui/partners/merge-accounts/merge-account-form.tsx
@@ -1,8 +1,9 @@
import { mergePartnerAccountsAction } from "@/lib/actions/partners/merge-partner-accounts";
import useUser from "@/lib/swr/use-user";
import { PartnerAvatar } from "@/ui/partners/partner-avatar";
+import { Callout } from "@/ui/shared/callout";
import { Button } from "@dub/ui";
-import { AlertTriangle, ArrowDown } from "lucide-react";
+import { ArrowDown } from "lucide-react";
import { signOut } from "next-auth/react";
import { useAction } from "next-safe-action/hooks";
import { toast } from "sonner";
@@ -100,22 +101,22 @@ export function MergeAccountForm({
</div>
</AccountInputGroup>
- <div className="mt-2 flex flex-col gap-3 rounded-lg border border-amber-200 bg-amber-50 px-5 py-4">
- <AlertTriangle className="size-4 text-amber-600" />
- <h3 className="text-sm font-semibold leading-5 text-amber-900">
- This action can't be undone.
- </h3>
- <p className="text-sm font-normal leading-5 text-amber-900">
- All data — including links, commissions, and payouts from{" "}
- {sourceAccount.email} will be transferred to {targetAccount.email}.
- Duplicate bounty submissions from {sourceAccount.email} will also be
- deleted.
- <br />
- <br />
- After the merge, {sourceAccount.email} will be permanently deleted.
- If you're unsure, please contact our support team before proceeding.
- </p>
- </div>
+ <Callout variant="warn" size={2} className="mt-2">
+ <div className="space-y-3">
+ <h3 className="font-semibold">This action can't be undone.</h3>
+ <p>
+ All data — including links, commissions, and payouts from{" "}
+ {sourceAccount.email} will be transferred to{" "}
+ {targetAccount.email}. Duplicate bounty submissions from{" "}
+ {sourceAccount.email} will also be deleted.
+ <br />
+ <br />
+ After the merge, {sourceAccount.email} will be permanently
+ deleted. If you're unsure, please contact our support team before
+ proceeding.
+ </p>
+ </div>
+ </Callout>
</div>
<div className="flex items-center justify-between gap-4">
diff --git a/apps/web/ui/partners/payouts/bank-account-requirements-modal.tsx b/apps/web/ui/partners/payouts/bank-account-requirements-modal.tsx
index 85db54bd74..8ac30fff51 100644
--- a/apps/web/ui/partners/payouts/bank-account-requirements-modal.tsx
+++ b/apps/web/ui/partners/payouts/bank-account-requirements-modal.tsx
@@ -2,9 +2,9 @@
import usePartnerProfile from "@/lib/swr/use-partner-profile";
import { Button, Modal } from "@dub/ui";
-import { TriangleWarning } from "@dub/ui/icons";
import { COUNTRIES, COUNTRY_CURRENCY_CODES } from "@dub/utils";
import { Dispatch, SetStateAction, useMemo, useState } from "react";
+import { Callout } from "../../shared/callout";
import { Markdown } from "../../shared/markdown";
function BankAccountRequirementsModal({
@@ -40,13 +40,10 @@ function BankAccountRequirementsModal({
</div>
<div className="flex flex-col gap-6 border-t border-neutral-200 bg-neutral-50 p-6">
- <div className="flex items-start gap-2.5 rounded-lg border border-amber-200 bg-amber-50 p-3">
- <TriangleWarning className="mt-0.5 size-3.5 shrink-0 text-amber-500" />
- <p className="text-sm leading-5 text-amber-900">
- If your bank account does not meet these requirements, payouts may
- be delayed or rejected.
- </p>
- </div>
+ <Callout variant="warn" size={2}>
+ If your bank account does not meet these requirements, payouts may be
+ delayed or rejected.
+ </Callout>
<div className="flex flex-col gap-2 text-sm text-neutral-800">
<p className="font-semibold">Requirements:</p>
diff --git a/apps/web/ui/partners/payouts/stablecoin-payout-modal.tsx b/apps/web/ui/partners/payouts/stablecoin-payout-modal.tsx
index 1b2f1ba58d..d51c6199be 100644
--- a/apps/web/ui/partners/payouts/stablecoin-payout-modal.tsx
+++ b/apps/web/ui/partners/payouts/stablecoin-payout-modal.tsx
@@ -1,8 +1,8 @@
"use client";
+import { Callout } from "@/ui/shared/callout";
import { MarkdownDescription } from "@/ui/shared/markdown-description";
import { Badge, Button, CircleDollar3, Modal, ShimmerDots } from "@dub/ui";
-import { TriangleWarning } from "@dub/ui/icons";
import { Dispatch, SetStateAction, useMemo, useState } from "react";
function StablecoinPayoutModal({
@@ -94,18 +94,15 @@ function StablecoinPayoutModal({
waiting up to 15 business days with your bank account.
</MarkdownDescription>
- <div className="mt-4 flex flex-col gap-2.5 rounded-lg border border-amber-200 bg-amber-50 p-3">
- <TriangleWarning className="size-3.5 text-amber-500" />
- <p className="text-sm leading-5 text-amber-900">
- Make sure to triple-check that you’ve entered the{" "}
- <strong className="underline underline-offset-2">
- correct stablecoin wallet address and network
- </strong>{" "}
- when connecting your wallet. Since stablecoin payouts are
- irreversible, incorrect details may result in payout failures and
- lost funds.
- </p>
- </div>
+ <Callout variant="warn" size={2} className="mt-4">
+ Make sure to triple-check that you’ve entered the{" "}
+ <strong className="underline underline-offset-2">
+ correct stablecoin wallet address and network
+ </strong>{" "}
+ when connecting your wallet. Since stablecoin payouts are
+ irreversible, incorrect details may result in payout failures and
+ lost funds.
+ </Callout>
<div className="mt-2">
<label className="mb-4 flex cursor-pointer gap-3 rounded-lg border border-neutral-300 p-3">
diff --git a/apps/web/ui/shared/callout.tsx b/apps/web/ui/shared/callout.tsx
new file mode 100644
index 0000000000..1e2c66d1d2
--- /dev/null
+++ b/apps/web/ui/shared/callout.tsx
@@ -0,0 +1,64 @@
+import { CircleCheck, CircleInfo, TriangleWarning } from "@dub/ui";
+import { cn } from "@dub/utils";
+import { PropsWithChildren } from "react";
+
+const calloutVariants = {
+ success: {
+ icon: CircleCheck,
+ containerClassName: "border-green-200 bg-green-50 text-green-900",
+ iconClassName: "text-green-600",
+ },
+ info: {
+ icon: CircleInfo,
+ containerClassName: "border-blue-200 bg-blue-50 text-blue-900",
+ iconClassName: "text-blue-600",
+ },
+ warn: {
+ icon: TriangleWarning,
+ containerClassName: "border-amber-200 bg-amber-50 text-amber-900",
+ iconClassName: "text-amber-600",
+ },
+ error: {
+ icon: TriangleWarning,
+ containerClassName: "border-red-200 bg-red-50 text-red-900",
+ iconClassName: "text-red-600",
+ },
+ neutral: {
+ icon: CircleInfo,
+ containerClassName: "border-neutral-200 bg-neutral-50 text-neutral-900",
+ iconClassName: "text-neutral-600",
+ },
+};
+
+export function Callout({
+ variant = "neutral",
+ size = 2,
+ className,
+ children,
+}: PropsWithChildren<{
+ variant?: keyof typeof calloutVariants;
+ size?: 1 | 2;
+ className?: string;
+}>) {
+ const {
+ icon: Icon,
+ containerClassName,
+ iconClassName,
+ } = calloutVariants[variant];
+
+ return (
+ <div
+ className={cn(
+ "font-regular flex items-start gap-2.5 rounded-[10px] border text-sm",
+ size === 2 ? "px-4 py-3" : "px-3 py-2",
+ containerClassName,
+ className,
+ )}
+ >
+ <div className="flex h-5 shrink-0 items-center">
+ <Icon className={cn("size-3.5", iconClassName)} />
+ </div>
+ <div className="min-w-0">{children}</div>
+ </div>
+ );
+}