diff --git a/components/brave_wallet_ui/components/desktop/lock-screen/style.ts b/components/brave_wallet_ui/components/desktop/lock-screen/style.ts index 485ed52a767d..9ac1ca996e90 100644 --- a/components/brave_wallet_ui/components/desktop/lock-screen/style.ts +++ b/components/brave_wallet_ui/components/desktop/lock-screen/style.ts @@ -20,6 +20,7 @@ export const Title = styled.span` color: ${(p) => p.theme.color.text01}; letter-spacing: 0.02em; margin-bottom: 10px; + text-align: center; ` export const PageIcon = styled.div` diff --git a/components/brave_wallet_ui/components/extension/buttons/nav-button/index.tsx b/components/brave_wallet_ui/components/extension/buttons/nav-button/index.tsx index 7dfe251efe9b..1612a10d9adb 100644 --- a/components/brave_wallet_ui/components/extension/buttons/nav-button/index.tsx +++ b/components/brave_wallet_ui/components/extension/buttons/nav-button/index.tsx @@ -22,13 +22,19 @@ export interface Props { text: string | undefined onSubmit: () => void disabled?: boolean + needsTopMargin?: boolean } export default class NavButton extends React.PureComponent { render () { - const { onSubmit, text, buttonType, disabled } = this.props + const { onSubmit, text, buttonType, disabled, needsTopMargin } = this.props return ( - + 20 : false} + > {buttonType === 'reject' && } diff --git a/components/brave_wallet_ui/components/extension/buttons/nav-button/style.ts b/components/brave_wallet_ui/components/extension/buttons/nav-button/style.ts index 83f096aa3cba..83531b3027be 100644 --- a/components/brave_wallet_ui/components/extension/buttons/nav-button/style.ts +++ b/components/brave_wallet_ui/components/extension/buttons/nav-button/style.ts @@ -7,9 +7,10 @@ import { WalletButton } from '../../../shared/style' interface StyleProps { buttonType: PanelButtonTypes disabled?: boolean + addTopMargin?: boolean } -export const StyledButton = styled(WalletButton) ` +export const StyledButton = styled(WalletButton) >` display: flex; align-items: center; justify-content: center; @@ -17,6 +18,7 @@ export const StyledButton = styled(WalletButton) ` border-radius: 40px; padding: 10px 22px; outline: none; + margin-top: ${(p) => p.addTopMargin ? '8px' : '0px'}; background-color: ${(p) => p.disabled ? p.theme.color.disabled : p.buttonType === 'primary' || diff --git a/components/brave_wallet_ui/components/extension/confirm-transaction-panel/index.tsx b/components/brave_wallet_ui/components/extension/confirm-transaction-panel/index.tsx index 4170953e7326..2bb6e9862f78 100644 --- a/components/brave_wallet_ui/components/extension/confirm-transaction-panel/index.tsx +++ b/components/brave_wallet_ui/components/extension/confirm-transaction-panel/index.tsx @@ -18,6 +18,7 @@ import { reduceAddress } from '../../../utils/reduce-address' import { reduceNetworkDisplayName } from '../../../utils/network-utils' import { reduceAccountDisplayName } from '../../../utils/reduce-account-name' import { formatBalance, toWeiHex } from '../../../utils/format-balances' +import { formatWithCommasAndDecimals } from '../../../utils/format-prices' import { getLocale } from '../../../../common/locale' import { usePricing, useTransactionParser } from '../../../common/hooks' import { withPlaceholderIcon } from '../../shared' @@ -56,7 +57,9 @@ import { QueueStepButton, TopColumn, AssetIcon, - ErrorText + ErrorText, + SectionColumn, + SingleRow } from './style' import { @@ -300,12 +303,12 @@ function ConfirmTransactionPanel (props: Props) { {transactionInfo.txType === TransactionType.ERC721TransferFrom || transactionInfo.txType === TransactionType.ERC721SafeTransferFrom ? transactionDetails.erc721ERCToken?.name + ' ' + transactionDetails.erc721TokenId - : transactionDetails.value + ' ' + transactionDetails.symbol + : formatWithCommasAndDecimals(transactionDetails.value) + ' ' + transactionDetails.symbol } {transactionInfo.txType !== TransactionType.ERC721TransferFrom && transactionInfo.txType !== TransactionType.ERC721SafeTransferFrom && - ${transactionDetails.fiatValue} + ${formatWithCommasAndDecimals(transactionDetails.fiatValue)} } )} @@ -330,13 +333,13 @@ function ConfirmTransactionPanel (props: Props) { {getLocale('braveWalletAllowSpendEditButton')} {getLocale('braveWalletAllowSpendTransactionFee')} - {transactionDetails.gasFee} {selectedNetwork.symbol} + {formatWithCommasAndDecimals(transactionDetails.gasFee)} {selectedNetwork.symbol} {transactionDetails.insufficientFundsError ? `${getLocale('braveWalletSwapInsufficientBalance')} ` : ''} - ${transactionDetails.gasFeeFiat} + ${formatWithCommasAndDecimals(transactionDetails.gasFeeFiat)} @@ -363,24 +366,32 @@ function ConfirmTransactionPanel (props: Props) { {getLocale('braveWalletConfirmTransactionGasFee')} {getLocale('braveWalletAllowSpendEditButton')} - {transactionDetails.gasFee} {selectedNetwork.symbol} - ${transactionDetails.gasFeeFiat} + {formatWithCommasAndDecimals(transactionDetails.gasFee)} {selectedNetwork.symbol} + ${formatWithCommasAndDecimals(transactionDetails.gasFeeFiat)} - - {getLocale('braveWalletConfirmTransactionTotal')} - - {getLocale('braveWalletConfirmTransactionAmountGas')} - {transactionDetails.value} {transactionDetails.symbol} + {transactionDetails.gasFee} {selectedNetwork.symbol} - - {transactionDetails.insufficientFundsError ? `${getLocale('braveWalletSwapInsufficientBalance')} ` : ''} - ${transactionDetails.fiatTotal} - - - + + {getLocale('braveWalletConfirmTransactionAmountGas')} + + {getLocale('braveWalletConfirmTransactionTotal')} + + {(transactionInfo.txType !== TransactionType.ERC721SafeTransferFrom && + transactionInfo.txType !== TransactionType.ERC721TransferFrom) + ? formatWithCommasAndDecimals(transactionDetails.value) + : transactionDetails.value + } {transactionDetails.symbol} + {transactionDetails.gasFee} {selectedNetwork.symbol} + + + {transactionDetails.insufficientFundsError + ? `${getLocale('braveWalletSwapInsufficientBalance')} ` + : ''} + ${formatWithCommasAndDecimals(transactionDetails.fiatTotal)} + + + } diff --git a/components/brave_wallet_ui/components/extension/confirm-transaction-panel/style.ts b/components/brave_wallet_ui/components/extension/confirm-transaction-panel/style.ts index 748e9be90c4f..7c930ebf3d95 100644 --- a/components/brave_wallet_ui/components/extension/confirm-transaction-panel/style.ts +++ b/components/brave_wallet_ui/components/extension/confirm-transaction-panel/style.ts @@ -172,6 +172,23 @@ export const SectionRow = styled.div` height: inherit; ` +export const SectionColumn = styled.div` + display: flex; + align-items: flex-end; + justify-content: center; + flex-direction: column; + width: 100%; + height: inherit; +` + +export const SingleRow = styled.div` + display: flex; + align-items: center; + justify-content: space-between; + flex-direction: row; + width: 100%; +` + export const SectionRightColumn = styled.div` display: flex; align-items: flex-end; diff --git a/components/brave_wallet_ui/components/extension/edit-gas/index.tsx b/components/brave_wallet_ui/components/extension/edit-gas/index.tsx index e7fba7d90e50..12529d451727 100644 --- a/components/brave_wallet_ui/components/extension/edit-gas/index.tsx +++ b/components/brave_wallet_ui/components/extension/edit-gas/index.tsx @@ -287,6 +287,7 @@ const EditGas = (props: Props) => { p.theme.color.text01}; letter-spacing: 0.04em; margin-bottom: 12px; + text-align: center; ` export const PanelIcon = styled.div` diff --git a/components/brave_wallet_ui/panel/style.ts b/components/brave_wallet_ui/panel/style.ts index 8d8ba9fd0477..546c28639616 100644 --- a/components/brave_wallet_ui/panel/style.ts +++ b/components/brave_wallet_ui/panel/style.ts @@ -9,7 +9,7 @@ export const PanelWrapper = styled.div` align-items: center; justify-content: center; width: 320px; - height: ${(p) => p.isLonger ? '500px' : '400px'}; + height: ${(p) => p.isLonger ? '540px' : '400px'}; ` export const SendWrapper = styled.div` diff --git a/components/brave_wallet_ui/utils/format-prices.ts b/components/brave_wallet_ui/utils/format-prices.ts index e6b2f234979f..870beec0523d 100644 --- a/components/brave_wallet_ui/utils/format-prices.ts +++ b/components/brave_wallet_ui/utils/format-prices.ts @@ -23,6 +23,6 @@ export const formatWithCommasAndDecimals = (value: string) => { } const calculatedDecimalPlace = -Math.floor(Math.log(valueToNumber) / Math.log(10) + 1) - const added = Number(calculatedDecimalPlace) + 4 + const added = Number(calculatedDecimalPlace) + 3 return addCommas(valueToNumber.toFixed(added)) }