From 6bec341ed0354767c85cb9b6e0167bd159b51846 Mon Sep 17 00:00:00 2001 From: antoniof Date: Tue, 4 Feb 2025 15:54:32 +0100 Subject: [PATCH] size limit and amount condition fix --- packages/lib/.size-limit.cjs | 26 +++++++++---------- .../src/components/internal/Await/Await.tsx | 4 ++- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/lib/.size-limit.cjs b/packages/lib/.size-limit.cjs index b0ba0b52f9..d54dd11749 100644 --- a/packages/lib/.size-limit.cjs +++ b/packages/lib/.size-limit.cjs @@ -5,8 +5,8 @@ module.exports = [ { name: 'UMD', path: 'dist/umd/adyen.js', - limit: '110 KB', - running: false, + limit: '120 KB', + running: false }, /** * 'auto' bundle with all Components included, excluding Languages @@ -14,9 +14,9 @@ module.exports = [ { name: 'Auto', path: 'auto/auto.js', - import: "{ AdyenCheckout, Dropin }", - limit: '110 KB', - running: false, + import: '{ AdyenCheckout, Dropin }', + limit: '120 KB', + running: false }, /** * ES modules (tree-shake) @@ -24,22 +24,22 @@ module.exports = [ { name: 'ESM - Core', path: 'dist/es/index.js', - import: "{ AdyenCheckout }", + import: '{ AdyenCheckout }', limit: '30 KB', - running: false, + running: false }, { name: 'ESM - Core + Card', path: 'dist/es/index.js', - import: "{ AdyenCheckout, Card }", + import: '{ AdyenCheckout, Card }', limit: '65 KB', - running: false, + running: false }, { name: 'ESM - Core + Dropin with Card', path: 'dist/es/index.js', - import: "{ AdyenCheckout, Dropin, Card }", + import: '{ AdyenCheckout, Dropin, Card }', limit: '70 KB', - running: false, - }, -] + running: false + } +]; diff --git a/packages/lib/src/components/internal/Await/Await.tsx b/packages/lib/src/components/internal/Await/Await.tsx index 09541f2fcc..53cc2b41b1 100644 --- a/packages/lib/src/components/internal/Await/Await.tsx +++ b/packages/lib/src/components/internal/Await/Await.tsx @@ -192,7 +192,9 @@ function Await(props: AwaitComponentProps) { > {props.brandLogo && {props.type}} - {props.showAmount && amount && amount.value && amount.currency && ( + {/* Everything is wrapped in !! so we evaluate the result as boolean, + otherwise we might just print the value or object as mistake */} + {!!(props.showAmount && amount && amount.value && amount.currency) && (
{i18n.amount(amount.value, amount.currency)}
)}