From 9464a952c4c0432538b625a4a6b5feb802f49c1f Mon Sep 17 00:00:00 2001 From: Alex Yatsenko Date: Fri, 17 Apr 2020 10:22:36 +0300 Subject: [PATCH] refactor(amount): make amount markup flat (#1105) --- src/amount/__snapshots__/amount.test.tsx.snap | 46 ++++++++----------- src/amount/amount.css | 4 -- src/amount/amount.tsx | 8 ++-- 3 files changed, 24 insertions(+), 34 deletions(-) diff --git a/src/amount/__snapshots__/amount.test.tsx.snap b/src/amount/__snapshots__/amount.test.tsx.snap index 5851c00fd2..1a71a888ec 100644 --- a/src/amount/__snapshots__/amount.test.tsx.snap +++ b/src/amount/__snapshots__/amount.test.tsx.snap @@ -33,32 +33,26 @@ exports[`amount should render without problems 1`] = ` - - - 1 233 141 - -
- - , - - - 45 - -
- -   - ₽ - + + 1 233 141 + + + , + + + 45 + + +   + ₽
diff --git a/src/amount/amount.css b/src/amount/amount.css index a0a288847b..84f8869a44 100644 --- a/src/amount/amount.css +++ b/src/amount/amount.css @@ -8,10 +8,6 @@ display: inline-block; white-space: nowrap; - &__minor-container { - display: inline-block; - } - &__currency { display: inline-block; text-align: right; diff --git a/src/amount/amount.tsx b/src/amount/amount.tsx index ff2230fd11..d8cb7de705 100644 --- a/src/amount/amount.tsx +++ b/src/amount/amount.tsx @@ -104,11 +104,11 @@ export class Amount extends React.Component { const { majorPart, minorPart, currencySymbol } = formatAmount(amount); const amountInner = ( - + <> { majorPart } { this.renderSeparatorAndMinorPart(minorPart) } { this.renderCurrencySymbol(currencySymbol) } - + ); return ( @@ -141,10 +141,10 @@ export class Amount extends React.Component { if (needMinorPart) { return ( -
+ <> { AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR } { minorPart } -
+ ); }