Skip to content

Commit

Permalink
size limit and amount condition fix
Browse files Browse the repository at this point in the history
  • Loading branch information
m1aw committed Feb 4, 2025
1 parent 7e0fcc8 commit 6bec341
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
26 changes: 13 additions & 13 deletions packages/lib/.size-limit.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,41 @@ 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
*/
{
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)
*/
{
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
}
];
4 changes: 3 additions & 1 deletion packages/lib/src/components/internal/Await/Await.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ function Await(props: AwaitComponentProps) {
>
{props.brandLogo && <img src={props.brandLogo} alt={props.type} className="adyen-checkout__await__brand-logo" />}

{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) && (
<div className="adyen-checkout__await__amount">{i18n.amount(amount.value, amount.currency)}</div>
)}

Expand Down

0 comments on commit 6bec341

Please sign in to comment.