Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part of #18714: Replacing deprecated constants with enums #19860

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import SiteIcon from '../../../../components/ui/site-icon';
import Typography from '../../../../components/ui/typography/typography';
import {
TypographyVariant,
FONT_WEIGHT,
DISPLAY,
FontWeight,
Display,
JustifyContent,
BLOCK_SIZES,
BlockSize,
AlignItems,
TEXT_ALIGN,
TextAlign,
TextColor,
} from '../../../../helpers/constants/design-system';
import {
Expand All @@ -26,14 +26,14 @@ export default function ConfirmationNetworkSwitch({ newNetwork }) {
return (
<Box
className="confirmation-network-switch"
display={DISPLAY.FLEX}
height={BLOCK_SIZES.FULL}
display={Display.Flex}
height={BlockSize.Full}
justifyContent={JustifyContent.center}
marginTop={8}
>
<Box
className="confirmation-network-switch__icon"
display={DISPLAY.BLOCK}
display={Display.Block}
>
{chainId in CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP ? (
<SiteIcon
Expand All @@ -49,10 +49,10 @@ export default function ConfirmationNetworkSwitch({ newNetwork }) {
<Typography
color={TextColor.textDefault}
variant={TypographyVariant.H6}
fontWeight={FONT_WEIGHT.NORMAL}
align={TEXT_ALIGN.CENTER}
fontWeight={FontWeight.Normal}
align={TextAlign.Center}
boxProps={{
display: DISPLAY.FLEX,
display: Display.Flex,
justifyContent: JustifyContent.center,
}}
>
Expand All @@ -61,7 +61,7 @@ export default function ConfirmationNetworkSwitch({ newNetwork }) {
</Box>
<Box
className="confirmation-network-switch__center-icon"
display={DISPLAY.FLEX}
display={Display.Flex}
alignItems={AlignItems.center}
justifyContent={JustifyContent.center}
>
Expand All @@ -70,7 +70,7 @@ export default function ConfirmationNetworkSwitch({ newNetwork }) {
</Box>
<Box
className="confirmation-network-switch__icon"
display={DISPLAY.BLOCK}
display={Display.Block}
>
{newNetwork.chainId in CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP ? (
<SiteIcon
Expand All @@ -86,10 +86,10 @@ export default function ConfirmationNetworkSwitch({ newNetwork }) {
<Typography
color={TextColor.textDefault}
variant={TypographyVariant.H6}
fontWeight={FONT_WEIGHT.NORMAL}
align={TEXT_ALIGN.CENTER}
fontWeight={FontWeight.Normal}
align={TextAlign.Center}
boxProps={{
display: DISPLAY.FLEX,
display: Display.Flex,
justifyContent: JustifyContent.center,
}}
>
Expand Down
30 changes: 15 additions & 15 deletions ui/pages/confirmation/templates/add-ethereum-chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { ethErrors } from 'eth-rpc-errors';
import React from 'react';
import { infuraProjectId } from '../../../../shared/constants/network';
import {
SEVERITIES,
Severity,
TypographyVariant,
TEXT_ALIGN,
DISPLAY,
FLEX_DIRECTION,
TextAlign,
Display,
FlexDirection,
AlignItems,
JustifyContent,
BackgroundColor,
Expand All @@ -18,7 +18,7 @@ import { jsonRpcRequest } from '../../../../shared/modules/rpc.utils';

const UNRECOGNIZED_CHAIN = {
id: 'UNRECOGNIZED_CHAIN',
severity: SEVERITIES.WARNING,
severity: Severity.Warning,
content: {
element: 'span',
children: {
Expand All @@ -32,7 +32,7 @@ const UNRECOGNIZED_CHAIN = {

const MISMATCHED_CHAIN_RECOMMENDATION = {
id: 'MISMATCHED_CHAIN_RECOMMENDATION',
severity: SEVERITIES.WARNING,
severity: Severity.Warning,
content: {
element: 'span',
children: {
Expand Down Expand Up @@ -63,7 +63,7 @@ const MISMATCHED_CHAIN_RECOMMENDATION = {

const MISMATCHED_NETWORK_NAME = {
id: 'MISMATCHED_NETWORK_NAME',
severity: SEVERITIES.WARNING,
severity: Severity.Warning,
content: {
element: 'span',
children: {
Expand All @@ -77,7 +77,7 @@ const MISMATCHED_NETWORK_NAME = {

const MISMATCHED_NETWORK_SYMBOL = {
id: 'MISMATCHED_NETWORK_SYMBOL',
severity: SEVERITIES.DANGER,
severity: Severity.Danger,
content: {
element: 'span',
children: {
Expand All @@ -91,7 +91,7 @@ const MISMATCHED_NETWORK_SYMBOL = {

const MISMATCHED_NETWORK_RPC = {
id: 'MISMATCHED_NETWORK_RPC',
severity: SEVERITIES.DANGER,
severity: Severity.Danger,
content: {
element: 'span',
children: {
Expand All @@ -105,7 +105,7 @@ const MISMATCHED_NETWORK_RPC = {

const MISMATCHED_NETWORK_RPC_CHAIN_ID = {
id: 'MISMATCHED_NETWORK_RPC_CHAIN_ID',
severity: SEVERITIES.DANGER,
severity: Severity.Danger,
content: {
element: 'span',
children: {
Expand All @@ -119,7 +119,7 @@ const MISMATCHED_NETWORK_RPC_CHAIN_ID = {

const ERROR_CONNECTING_TO_RPC = {
id: 'ERROR_CONNECTING_TO_RPC',
severity: SEVERITIES.DANGER,
severity: Severity.Danger,
content: {
element: 'span',
children: {
Expand Down Expand Up @@ -192,8 +192,8 @@ function getValues(pendingApproval, t, actions, history) {
element: 'Box',
key: 'network-box',
props: {
textAlign: TEXT_ALIGN.CENTER,
display: DISPLAY.FLEX,
textAlign: TextAlign.Center,
display: Display.Flex,
justifyContent: JustifyContent.center,
marginTop: 4,
marginBottom: 2,
Expand Down Expand Up @@ -318,8 +318,8 @@ function getValues(pendingApproval, t, actions, history) {
variant: TypographyVariant.H7,
boxProps: {
margin: originIsMetaMask ? [0, 8] : 0,
display: DISPLAY.FLEX,
flexDirection: FLEX_DIRECTION.COLUMN,
display: Display.Flex,
flexDirection: FlexDirection.Column,
alignItems: AlignItems.center,
},
},
Expand Down
14 changes: 7 additions & 7 deletions ui/pages/swaps/list-with-search/list-with-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import log from 'loglevel';

import Box from '../../../components/ui/box';
import {
DISPLAY,
FLEX_DIRECTION,
Display,
FlexDirection,
JustifyContent,
AlignItems,
TextVariant,
BLOCK_SIZES,
BlockSize,
} from '../../../helpers/constants/design-system';
import { TextFieldSearch, Text } from '../../../components/component-library';
import ItemList from '../searchable-item-list/item-list';
Expand Down Expand Up @@ -112,11 +112,11 @@ export default function ListWithSearch({
};

return (
<Box className="list-with-search" width={BLOCK_SIZES.FULL} tabIndex="0">
<Box className="list-with-search" width={BlockSize.Full} tabIndex="0">
<Box
style={{ gridColumnStart: 1, gridColumnEnd: 3 }}
display={DISPLAY.FLEX}
flexDirection={FLEX_DIRECTION.COLUMN}
display={Display.Flex}
flexDirection={FlexDirection.Column}
>
<TextFieldSearch
id="list-with-search__text-search"
Expand Down Expand Up @@ -150,7 +150,7 @@ export default function ListWithSearch({
<Box
marginTop={1}
marginBottom={5}
display={DISPLAY.FLEX}
display={Display.Flex}
justifyContent={JustifyContent.center}
alignItems={AlignItems.center}
>
Expand Down
Loading