diff --git a/src/app/globals.css b/src/app/globals.css index c132dfa..db5397c 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -7,8 +7,8 @@ --foreground: 0 0% 3.9%; --card: 0 0% 100%; --card-foreground: 0 0% 3.9%; - --popover: 0 0% 3.9%; - --popover-foreground: 0 0% 98%; + --popover: 0 0% 98%; + --popover-foreground: 0 0% 3.9%; --primary: 0 0% 9%; --primary-foreground: 0 0% 98%; --secondary: 0 0% 96.1%; @@ -27,15 +27,15 @@ --chart-3: 197 37% 24%; --chart-4: 43 74% 66%; --chart-5: 27 87% 67%; - --radius: 0.5rem + --radius: 0.5rem; } .dark { --background: 0 0% 3.9%; --foreground: 0 0% 98%; --card: 0 0% 3.9%; --card-foreground: 0 0% 98%; - --popover: 0 0% 100%; - --popover-foreground: 0 0% 3.9%; + --popover: 0 0% 3.9%; + --popover-foreground: 0 0% 98%; --primary: 0 0% 98%; --primary-foreground: 0 0% 9%; --secondary: 0 0% 14.9%; @@ -53,7 +53,7 @@ --chart-2: 160 60% 45%; --chart-3: 30 80% 55%; --chart-4: 280 65% 60%; - --chart-5: 340 75% 55% + --chart-5: 340 75% 55%; } } @layer base { diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index 6ef2568..d2b8af6 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -6,26 +6,26 @@ export default async function NotFound() { const { user } = await getCurrentSession(); return ( -
+
-
- EI +
+ EI
-

404

+

404

- - + + Page Not Found
-

+

The page you're looking for doesn't exist or may have been moved.

-

+

Your account and invoices remain secure.

@@ -33,13 +33,13 @@ export default async function NotFound() {
-
- +
+
-

Payouts

-

+

Payouts

+

Single, batch or recurring payouts

@@ -47,27 +47,27 @@ export default async function NotFound() { {user ? ( -
- +
+
-

+

Create Invoice

-

+

Start a new payment request

) : ( -
-
- +
+
+
-

+

Sign in to create invoices

-

+

Start a new payment request

@@ -76,27 +76,27 @@ export default async function NotFound() { {user ? ( -
- +
+
-

+

Subscription Plans

-

+

Manage your subscription plans

) : ( -
-
- +
+
+
-

+

Sign in to manage subscription plans

-

+

View and manage your subscription options

@@ -105,7 +105,7 @@ export default async function NotFound() { Back to Dashboard diff --git a/src/components/payment-route.tsx b/src/components/payment-route.tsx index 9944270..ffa1419 100644 --- a/src/components/payment-route.tsx +++ b/src/components/payment-route.tsx @@ -47,7 +47,7 @@ export function PaymentRoute({ if (isDirectPayment) { return { bgColor: "bg-primary/10", - textColor: "text-primary-foreground", + textColor: "text-primary", icon: , }; } diff --git a/src/lib/invoice-status.ts b/src/lib/invoice-status.ts index 50ec2a0..6d5e90f 100644 --- a/src/lib/invoice-status.ts +++ b/src/lib/invoice-status.ts @@ -75,18 +75,18 @@ export const getPaymentSectionStatusClass = ( status: (typeof requestStatusEnum.enumValues)[number], ) => { if (status === "paid" || status === "crypto_paid") { - return "bg-green-100 text-green-800"; + return "bg-success/10 text-success-foreground"; } if (status === "offramp_failed") { - return "bg-red-100 text-red-800"; + return "bg-destructive/10 text-destructive"; } if (status.includes("offramp") || status === "processing") { - return "bg-orange-100 text-orange-800"; + return "bg-warning/10 text-warning-foreground"; } - return "bg-blue-100 text-blue-800"; + return "bg-primary/10 text-primary"; }; /** diff --git a/src/lib/schemas/ecommerce.ts b/src/lib/schemas/ecommerce.ts index 7deb77f..e1421c7 100644 --- a/src/lib/schemas/ecommerce.ts +++ b/src/lib/schemas/ecommerce.ts @@ -30,22 +30,27 @@ const baseEcommerceClientApiSchema = z.object({ domain: z.string().url(), feeAddress: z .string() - .transform((val) => (val === "" ? undefined : val)) + .optional() + .transform((val) => { + if (val === undefined || val === "") return undefined; + return val; + }) .refine((value) => { if (value === undefined) return true; return isEthereumAddress(value); - }, "Invalid Ethereum address format") - .optional(), + }, "Invalid Ethereum address format"), feePercentage: z .string() - .transform((val) => (val === "" ? undefined : val)) + .optional() + .transform((val) => { + if (val === undefined || val === "") return undefined; + return val; + }) .refine((value) => { if (value === undefined) return true; const num = Number(value); - return !Number.isNaN(num) && num >= 0 && num <= 100; - }, "Fee percentage must be a number between 0 and 100") - .optional(), + }, "Fee percentage must be a number between 0 and 100"), }); export const ecommerceClientApiSchema = diff --git a/src/server/routers/ecommerce.ts b/src/server/routers/ecommerce.ts index 78f75b2..55b59ea 100644 --- a/src/server/routers/ecommerce.ts +++ b/src/server/routers/ecommerce.ts @@ -32,8 +32,8 @@ export const ecommerceRouter = router({ const response = await apiClient.post("v2/client-ids", { label: input.label, allowedDomains: [input.domain], - feePercentage: input.feePercentage ?? null, - feeAddress: input.feeAddress ?? null, + feePercentage: input.feePercentage ?? undefined, + feeAddress: input.feeAddress ?? undefined, }); if (!response.data.clientId) { diff --git a/src/server/routers/invoice.ts b/src/server/routers/invoice.ts index c970b1b..3891a51 100644 --- a/src/server/routers/invoice.ts +++ b/src/server/routers/invoice.ts @@ -447,9 +447,15 @@ export const invoiceRouter = router({ .query(async ({ input }) => { const { requestId, walletAddress } = input; - const response = await apiClient.get( - `/v2/request/${requestId}/routes?wallet=${walletAddress}&feePercentage=${process.env.FEE_PERCENTAGE_FOR_PAYMENT}&feeAddress=${process.env.FEE_ADDRESS_FOR_PAYMENT}`, - ); + let url = `/v2/request/${requestId}/routes?wallet=${walletAddress}`; + + if ( + process.env.FEE_PERCENTAGE_FOR_PAYMENT && + process.env.FEE_ADDRESS_FOR_PAYMENT + ) { + url += `&feePercentage=${process.env.FEE_PERCENTAGE_FOR_PAYMENT}&feeAddress=${process.env.FEE_ADDRESS_FOR_PAYMENT}`; + } + const response = await apiClient.get(url); if (response.status !== 200) { throw new TRPCError({