From 4d12c36cf8624bd90d0313371a8225cfe97408a7 Mon Sep 17 00:00:00 2001
From: Vladimir Saric <92527393+VSaric@users.noreply.github.com>
Date: Wed, 4 Jan 2023 18:01:52 +0100
Subject: [PATCH] Align custom spending cap Max button in approve screen for
multiple languages (#16927)
* Align custom spending cap Max button in approve screen for multiple languages
* Modify some css styles and adding Box props
* Using ButtonLink component instead of
Co-authored-by: Brad Decker
---
.../custom-spending-cap.js | 42 ++++++++++---------
.../app/custom-spending-cap/index.scss | 17 +-------
.../ui/review-spending-cap/index.scss | 5 ---
.../review-spending-cap.js | 8 ++--
4 files changed, 29 insertions(+), 43 deletions(-)
diff --git a/ui/components/app/custom-spending-cap/custom-spending-cap.js b/ui/components/app/custom-spending-cap/custom-spending-cap.js
index 9afedc0b5..ef2d13ae3 100644
--- a/ui/components/app/custom-spending-cap/custom-spending-cap.js
+++ b/ui/components/app/custom-spending-cap/custom-spending-cap.js
@@ -5,6 +5,7 @@ import { I18nContext } from '../../../contexts/i18n';
import Box from '../../ui/box';
import FormField from '../../ui/form-field';
import Typography from '../../ui/typography';
+import { ButtonLink } from '../../component-library';
import {
ALIGN_ITEMS,
COLORS,
@@ -15,6 +16,7 @@ import {
TYPOGRAPHY,
JUSTIFY_CONTENT,
SIZES,
+ BLOCK_SIZES,
} from '../../../helpers/constants/design-system';
import { getCustomTokenAmount } from '../../../selectors';
import { setCustomTokenAmount } from '../../../ducks/app/app';
@@ -112,21 +114,6 @@ export default function CustomSpendingCap({
return (
<>
-
-
-
{
e.preventDefault();
setShowUseDefaultButton(false);
@@ -184,12 +170,30 @@ export default function CustomSpendingCap({
}}
>
{t('useDefault')}
-
+
)
}
titleDetailWrapperProps={{ marginBottom: 2, marginRight: 0 }}
allowDecimals
/>
+
+ {
+ e.preventDefault();
+ handleChange(currentTokenBalance);
+ }}
+ >
+ {t('max')}
+
+
-
+