1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 01:47:00 +01:00

Part of #18714: Replacing deprecated constants with enums (#19516)

* replacing deprecated constants with enums

* Removing redundant properties
This commit is contained in:
Dhruv 2023-06-21 03:44:45 +05:30 committed by GitHub
parent 84135f5d4c
commit ab0374d48a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 39 deletions

View File

@ -6,8 +6,8 @@ import { EditGasModes } from '../../../../../shared/constants/gas';
import Box from '../../../ui/box';
import CheckBox from '../../../ui/check-box';
import {
DISPLAY,
FLEX_DIRECTION,
Display,
FlexDirection,
TextColor,
TextVariant,
} from '../../../../helpers/constants/design-system';
@ -72,8 +72,8 @@ const AdvancedGasFeeDefaults = () => {
return (
<Box
display={DISPLAY.FLEX}
flexDirection={FLEX_DIRECTION.ROW}
display={Display.Flex}
flexDirection={FlexDirection.Row}
marginTop={4}
marginLeft={2}
marginRight={2}
@ -90,7 +90,6 @@ const AdvancedGasFeeDefaults = () => {
variant={TextVariant.bodySm}
as="h6"
color={TextColor.textAlternative}
margin={0}
>
{isDefaultSettingsSelected
? t('advancedGasFeeDefaultOptOut')

View File

@ -12,7 +12,7 @@ import Popover from '../../../ui/popover';
import {
FontWeight,
TextVariant,
DISPLAY,
Display,
Size,
BorderStyle,
BorderColor,
@ -65,17 +65,16 @@ export default function ContractDetailsModal({
fontWeight={FontWeight.Bold}
variant={TextVariant.bodyMd}
as="h5"
display={DISPLAY.FLEX}
boxProps={{ marginTop: 0, marginBottom: 0 }}
display={Display.Flex}
>
{t('contractTitle')}
</Text>
<Text
variant={TextVariant.bodySm}
as="h6"
display={DISPLAY.FLEX}
display={Display.Flex}
color={TextColor.textAlternative}
boxProps={{ marginTop: 2, marginBottom: 0 }}
marginTop={2}
>
{t('contractDescription')}
</Text>
@ -84,14 +83,14 @@ export default function ContractDetailsModal({
<Text
variant={TextVariant.bodySm}
as="h6"
display={DISPLAY.FLEX}
display={Display.Flex}
marginTop={4}
marginBottom={2}
>
{nft ? t('contractNFT') : t('contractToken')}
</Text>
<Box
display={DISPLAY.FLEX}
display={Display.Flex}
borderRadius={Size.SM}
borderStyle={BorderStyle.solid}
borderColor={BorderColor.borderDefault}
@ -124,9 +123,8 @@ export default function ContractDetailsModal({
<Text
variant={TextVariant.bodySm}
as="h6"
display={DISPLAY.FLEX}
display={Display.Flex}
color={TextColor.textAlternative}
marginTop={0}
marginBottom={4}
>
{ellipsify(tokenAddress)}
@ -148,7 +146,7 @@ export default function ContractDetailsModal({
}
>
<ButtonIcon
display={DISPLAY.FLEX}
display={Display.Flex}
iconName={
copiedTokenAddress ? IconName.CopySuccess : IconName.Copy
}
@ -163,7 +161,7 @@ export default function ContractDetailsModal({
</Tooltip>
<Tooltip position="top" title={t('openInBlockExplorer')}>
<ButtonIcon
display={DISPLAY.FLEX}
display={Display.Flex}
iconName={IconName.Export}
color={Color.iconMuted}
onClick={() => {
@ -189,7 +187,7 @@ export default function ContractDetailsModal({
<Text
variant={TextVariant.bodySm}
as="h6"
display={DISPLAY.FLEX}
display={Display.Flex}
marginTop={4}
marginBottom={2}
>
@ -200,7 +198,7 @@ export default function ContractDetailsModal({
t('contractRequestingSpendingCap')}
</Text>
<Box
display={DISPLAY.FLEX}
display={Display.Flex}
borderRadius={Size.SM}
borderStyle={BorderStyle.solid}
borderColor={BorderColor.borderDefault}
@ -224,9 +222,8 @@ export default function ContractDetailsModal({
<Text
variant={TextVariant.bodySm}
as="h6"
display={DISPLAY.FLEX}
display={Display.Flex}
color={TextColor.textAlternative}
marginTop={0}
marginBottom={4}
>
{ellipsify(toAddress)}
@ -246,7 +243,7 @@ export default function ContractDetailsModal({
}
>
<ButtonIcon
display={DISPLAY.FLEX}
display={Display.Flex}
iconName={
copiedToAddress ? IconName.CopySuccess : IconName.Copy
}
@ -261,7 +258,7 @@ export default function ContractDetailsModal({
</Tooltip>
<Tooltip position="top" title={t('openInBlockExplorer')}>
<ButtonIcon
display={DISPLAY.FLEX}
display={Display.Flex}
iconName={IconName.Export}
color={Color.iconMuted}
onClick={() => {
@ -284,7 +281,7 @@ export default function ContractDetailsModal({
</Box>
</Box>
<Box
display={DISPLAY.FLEX}
display={Display.Flex}
paddingTop={6}
paddingRight={4}
paddingBottom={6}

View File

@ -3,8 +3,8 @@ import PropTypes from 'prop-types';
import IconWithFallback from '../../ui/icon-with-fallback';
import Identicon from '../../ui/identicon';
import {
DISPLAY,
FLEX_DIRECTION,
Display,
FlexDirection,
TextVariant,
FontWeight,
AlignItems,
@ -33,22 +33,22 @@ export default function NetworkAccountBalanceHeader({
return (
<Box
display={DISPLAY.FLEX}
flexDirection={FLEX_DIRECTION.ROW}
display={Display.Flex}
flexDirection={FlexDirection.Row}
padding={4}
className="network-account-balance-header"
alignItems={AlignItems.center}
justifyContent={JustifyContent.spaceBetween}
>
<Box
display={DISPLAY.FLEX}
flexDirection={FLEX_DIRECTION.ROW}
display={Display.Flex}
flexDirection={FlexDirection.Row}
alignItems={AlignItems.center}
gap={2}
>
<Box
display={DISPLAY.FLEX}
flexDirection={FLEX_DIRECTION.ROW}
display={Display.Flex}
flexDirection={FlexDirection.Row}
alignItems={AlignItems.center}
>
<Identicon address={accountAddress} diameter={32} />
@ -60,15 +60,14 @@ export default function NetworkAccountBalanceHeader({
/>
</Box>
<Box
display={DISPLAY.FLEX}
display={Display.Flex}
alignItems={AlignItems.flexStart}
flexDirection={FLEX_DIRECTION.COLUMN}
flexDirection={FlexDirection.Column}
>
<Text
variant={TextVariant.bodySm}
as="h6"
color={TextColor.textAlternative}
marginBottom={0}
>
{networkName}
</Text>
@ -78,22 +77,20 @@ export default function NetworkAccountBalanceHeader({
as="h6"
color={TextColor.textDefault}
fontWeight={FontWeight.Bold}
marginTop={0}
>
{accountName}
</Text>
</Box>
</Box>
<Box
display={DISPLAY.FLEX}
display={Display.Flex}
alignItems={AlignItems.flexEnd}
flexDirection={FLEX_DIRECTION.COLUMN}
flexDirection={FlexDirection.Column}
>
<Text
variant={TextVariant.bodySm}
as="h6"
color={TextColor.textAlternative}
marginBottom={0}
>
{t('balance')}
</Text>
@ -103,7 +100,6 @@ export default function NetworkAccountBalanceHeader({
as="h6"
color={TextColor.textDefault}
fontWeight={FontWeight.Bold}
marginTop={0}
align={TextAlign.End}
>
{accountBalance} {tokenName}