diff --git a/.changeset/curly-crews-sleep.md b/.changeset/curly-crews-sleep.md
new file mode 100644
index 00000000000..244e4b88be4
--- /dev/null
+++ b/.changeset/curly-crews-sleep.md
@@ -0,0 +1,5 @@
+---
+"thirdweb": patch
+---
+
+Minor UI adjustments in CheckoutWidget
diff --git a/apps/dashboard/public/assets/pay/general-pay.png b/apps/dashboard/public/assets/pay/general-pay.png
new file mode 100644
index 00000000000..8729bb7c2fb
Binary files /dev/null and b/apps/dashboard/public/assets/pay/general-pay.png differ
diff --git a/apps/dashboard/src/@/utils/sdk-component-theme.ts b/apps/dashboard/src/@/utils/sdk-component-theme.ts
index 5541d2e530b..8a3dfc2da03 100644
--- a/apps/dashboard/src/@/utils/sdk-component-theme.ts
+++ b/apps/dashboard/src/@/utils/sdk-component-theme.ts
@@ -21,8 +21,8 @@ export function getSDKTheme(theme: "light" | "dark"): Theme {
primaryButtonText: "hsl(var(--inverted-foreground))",
primaryText: "hsl(var(--foreground))",
scrollbarBg: "hsl(var(--muted))",
- secondaryButtonBg: "hsl(var(--secondary))",
- secondaryButtonHoverBg: "hsl(var(--secondary)/80%)",
+ secondaryButtonBg: "hsl(var(--secondary)/70%)",
+ secondaryButtonHoverBg: "hsl(var(--secondary))",
secondaryButtonText: "hsl(var(--secondary-foreground))",
secondaryIconColor: "hsl(var(--secondary-foreground))",
secondaryIconHoverBg: "hsl(var(--accent))",
@@ -33,7 +33,7 @@ export function getSDKTheme(theme: "light" | "dark"): Theme {
separatorLine: "hsl(var(--border))",
skeletonBg: "hsl(var(--secondary-foreground)/15%)",
success: "hsl(var(--success-text))",
- tertiaryBg: "hsl(var(--muted)/30%)",
+ tertiaryBg: "hsl(var(--muted)/50%)",
tooltipBg: "hsl(var(--popover))",
tooltipText: "hsl(var(--popover-foreground))",
},
diff --git a/apps/dashboard/src/app/pay/[id]/header.tsx b/apps/dashboard/src/app/pay/[id]/header.tsx
new file mode 100644
index 00000000000..eea5b92ddf8
--- /dev/null
+++ b/apps/dashboard/src/app/pay/[id]/header.tsx
@@ -0,0 +1,72 @@
+"use client";
+import { Img } from "@workspace/ui/components/img";
+import { MoonIcon, SunIcon } from "lucide-react";
+import { useTheme } from "next-themes";
+import { ClientOnly } from "@/components/blocks/client-only";
+import { Button } from "@/components/ui/button";
+import { Skeleton } from "@/components/ui/skeleton";
+import { cn } from "@/lib/utils";
+import { resolveSchemeWithErrorHandler } from "@/utils/resolveSchemeWithErrorHandler";
+import { payAppThirdwebClient } from "../constants";
+
+export function PayIdPageHeader(props: {
+ projectName: string;
+ projectIcon: string | undefined;
+}) {
+ return (
+
+ );
+}
+
+function ToggleThemeButton(props: { className?: string }) {
+ const { setTheme, theme } = useTheme();
+
+ return (
+ }
+ >
+
+
+ );
+}
diff --git a/apps/dashboard/src/app/pay/[id]/page.tsx b/apps/dashboard/src/app/pay/[id]/page.tsx
index 3e46240c99e..24694c29ace 100644
--- a/apps/dashboard/src/app/pay/[id]/page.tsx
+++ b/apps/dashboard/src/app/pay/[id]/page.tsx
@@ -1,21 +1,16 @@
-import { ShieldCheckIcon } from "lucide-react";
+import { cn } from "@workspace/ui/lib/utils";
import type { Metadata } from "next";
import { ThemeProvider } from "next-themes";
-import { Bridge, defineChain, toTokens } from "thirdweb";
-import { getChainMetadata } from "thirdweb/chains";
-import { shortenAddress } from "thirdweb/utils";
+import { Bridge } from "thirdweb";
import { getPaymentLink } from "@/api/universal-bridge/links";
-import { Badge } from "@/components/ui/badge";
import { NEXT_PUBLIC_THIRDWEB_API_HOST } from "@/constants/public-envs";
import {
API_SERVER_SECRET,
DASHBOARD_THIRDWEB_SECRET_KEY,
} from "@/constants/server-envs";
import { getConfiguredThirdwebClient } from "@/constants/thirdweb.server";
-import { resolveEns } from "@/lib/ens";
-import { resolveSchemeWithErrorHandler } from "@/utils/resolveSchemeWithErrorHandler";
import { PayPageWidget } from "../components/client/PayPageWidget.client";
-import { payAppThirdwebClient } from "../constants";
+import { PayIdPageHeader } from "./header";
const title = "thirdweb Pay";
const description = "Fast, secure, and simple payments.";
@@ -54,26 +49,10 @@ export default async function PayPage({
tokenAddress: paymentLink.destinationToken.address,
});
- const chainPromise = getChainMetadata(
- // eslint-disable-next-line no-restricted-syntax
- defineChain(Number(paymentLink.destinationToken.chainId)),
- );
-
- const recipientPromise = resolveEns(
- paymentLink.receiver,
- getConfiguredThirdwebClient({
- secretKey: DASHBOARD_THIRDWEB_SECRET_KEY,
- teamId: undefined,
- }),
- );
-
- const [tokens, projectMetadata, chain, recipientEnsOrAddress] =
- await Promise.all([
- tokensPromise,
- projectMetadataPromise,
- chainPromise,
- recipientPromise,
- ]);
+ const [tokens, projectMetadata] = await Promise.all([
+ tokensPromise,
+ projectMetadataPromise,
+ ]);
const token = tokens[0];
if (!token) {
@@ -81,144 +60,33 @@ export default async function PayPage({
}
return (
-
+
-
-
-
-
- {projectMetadata.image && (
-

- )}
-
{projectMetadata.name}
-
- {projectMetadata.description && (
-
- {projectMetadata.description}
-
- )}
-
-
-
- {paymentLink.amount && (
-
-
Details
-
-
- {token.iconUri && (
-

- )}
- {toTokens(BigInt(paymentLink.amount), token.decimals)}{" "}
- {token.symbol}
-
- {token.prices.USD && (
-
- $
- {(
- Number(token.prices.USD) *
- Number(
- toTokens(
- BigInt(paymentLink.amount),
- token.decimals,
- ),
- )
- ).toFixed(2)}
-
- )}
-
-
- )}
- {chain && (
-
-
Network
-
-
- {chain.icon?.url && (
-

- )}
- {chain.name}
-
-
-
- )}
- {recipientEnsOrAddress.ensName ||
- (recipientEnsOrAddress.address && (
-
-
- Seller
-
-
- {recipientEnsOrAddress.ensName ??
- shortenAddress(recipientEnsOrAddress.address)}
-
-
- ))}
-
+
-
-
-
- Secured by thirdweb
-
-
-
-
-
-
-
+
+
+
+
);
@@ -237,7 +105,24 @@ async function getProjectMetadata(clientId: string) {
}
const { data } = (await response.json()) as {
- data: { name: string; image: string | null; description: string | null };
+ data: { name: string; image: string | null };
};
return data;
}
+
+function DotsBackgroundPattern(props: { className?: string }) {
+ return (
+
+ );
+}
diff --git a/apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx b/apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx
index c2b50f91b65..c3f66c49398 100644
--- a/apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx
+++ b/apps/dashboard/src/app/pay/components/client/PayPageWidget.client.tsx
@@ -1,4 +1,5 @@
"use client";
+import { cn } from "@workspace/ui/lib/utils";
import { payAppThirdwebClient } from "app/pay/constants";
import { useTheme } from "next-themes";
import { createThirdwebClient, NATIVE_TOKEN_ADDRESS, toTokens } from "thirdweb";
@@ -63,7 +64,12 @@ export function PayPageWidget({
client={
clientId ? createThirdwebClient({ clientId }) : payAppThirdwebClient
}
- image={image}
+ className={cn(
+ "shadow-xl",
+ !image &&
+ "[&_.tw-header-image]:invert dark:[&_.tw-header-image]:invert-0",
+ )}
+ image={image || "/assets/pay/general-pay.png"}
name={name}
onSuccess={() => {
reportPaymentLinkBuySuccessful();
diff --git a/packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx b/packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx
index 3a3b9417269..729cf88dcd3 100644
--- a/packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx
+++ b/packages/thirdweb/src/react/web/ui/Bridge/DirectPayment.tsx
@@ -93,11 +93,11 @@ export function DirectPayment({
>
{/* Price section */}
One-time payment
@@ -125,11 +128,11 @@ export function DirectPayment({
-
+
-
+
-
+
Price
-
+
{`${paymentInfo.amount} ${paymentInfo.token.symbol}`}
-
+
{/* Network section */}
-
+
-
+
-
+
{/* Action button */}
@@ -194,11 +188,11 @@ export function DirectPayment({
{showThirdwebBranding ? (
) : null}
-
+
);
diff --git a/packages/thirdweb/src/react/web/ui/Bridge/common/WithHeader.tsx b/packages/thirdweb/src/react/web/ui/Bridge/common/WithHeader.tsx
index 4e2b980a872..d4314bbafa0 100644
--- a/packages/thirdweb/src/react/web/ui/Bridge/common/WithHeader.tsx
+++ b/packages/thirdweb/src/react/web/ui/Bridge/common/WithHeader.tsx
@@ -1,7 +1,7 @@
import type { ThirdwebClient } from "../../../../../client/client.js";
import { resolveScheme } from "../../../../../utils/ipfs.js";
import { useCustomTheme } from "../../../../core/design-system/CustomThemeProvider.js";
-import { radius } from "../../../../core/design-system/index.js";
+import { radius, spacing } from "../../../../core/design-system/index.js";
import { Container } from "../../components/basic.js";
import { Spacer } from "../../components/Spacer.js";
import { Text } from "../../components/text.js";
@@ -20,6 +20,7 @@ export function WithHeader(props: {
{/* image */}
{props.image && (
{/* title */}
{props.title && (
-
+
{props.title}
)}
diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.tsx b/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.tsx
index 23fdb24f664..f2541044ee4 100644
--- a/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.tsx
+++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/Buy/swap/FiatValue.tsx
@@ -45,7 +45,7 @@ export function FiatValue(
}
return cryptoToFiatQuery.data?.result ? (
-
+
{formatCurrencyAmount(
props.currency || "USD",
cryptoToFiatQuery.data.result,
diff --git a/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/formatTokenBalance.ts b/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/formatTokenBalance.ts
index 0c9f9d450c4..229d16da968 100644
--- a/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/formatTokenBalance.ts
+++ b/packages/thirdweb/src/react/web/ui/ConnectWallet/screens/formatTokenBalance.ts
@@ -49,5 +49,7 @@ function formatMoney(
return new Intl.NumberFormat(locale, {
style: "currency",
currency: currencyCode,
+ maximumFractionDigits: 5,
+ minimumFractionDigits: 0,
}).format(value);
}