diff --git a/ui/app/components/app/dropdowns/network-dropdown.js b/ui/app/components/app/dropdowns/network-dropdown.js index 4fe270b08..4de92e718 100644 --- a/ui/app/components/app/dropdowns/network-dropdown.js +++ b/ui/app/components/app/dropdowns/network-dropdown.js @@ -15,7 +15,7 @@ import { isPrefixedFormattedHexString } from '../../../../../shared/modules/util import { getEnvironmentType } from '../../../../../app/scripts/lib/util' import ColorIndicator from '../../ui/color-indicator' -import { COLORS } from '../../../helpers/constants/design-system' +import { COLORS, SIZES } from '../../../helpers/constants/design-system' import { Dropdown, DropdownMenuItem } from './components/dropdown' // classes from nodes of the toggle element. @@ -149,7 +149,7 @@ class NetworkDropdown extends Component { )} @@ -219,7 +219,7 @@ class NetworkDropdown extends Component { )} @@ -309,7 +309,7 @@ class NetworkDropdown extends Component { type={ColorIndicator.TYPES.FILLED} color={COLORS.TRANSPARENT} borderColor={COLORS.UI2} - size={ColorIndicator.SIZES.LARGE} + size={SIZES.LG} /> ({ @@ -36,7 +42,7 @@ export default function NetworkDisplay({ > ) } NetworkDisplay.propTypes = { colored: PropTypes.bool, + indicatorSize: PropTypes.oneOf(Object.values(SIZES)), + labelProps: PropTypes.shape({ + ...Chip.propTypes.labelProps, + }), outline: PropTypes.bool, disabled: PropTypes.bool, iconClassName: PropTypes.string, @@ -75,4 +86,5 @@ NetworkDisplay.propTypes = { NetworkDisplay.defaultProps = { colored: true, + indicatorSize: SIZES.LG, } diff --git a/ui/app/components/ui/color-indicator/color-indicator.js b/ui/app/components/ui/color-indicator/color-indicator.js index 83718a0f7..22ef28c0c 100644 --- a/ui/app/components/ui/color-indicator/color-indicator.js +++ b/ui/app/components/ui/color-indicator/color-indicator.js @@ -1,7 +1,7 @@ import React from 'react' import classnames from 'classnames' import PropTypes from 'prop-types' -import { COLORS } from '../../../helpers/constants/design-system' +import { COLORS, SIZES } from '../../../helpers/constants/design-system' export default function ColorIndicator({ size = 'small', @@ -29,12 +29,6 @@ export default function ColorIndicator({ ) } -ColorIndicator.SIZES = { - LARGE: 'large', - MEDIUM: 'medium', - SMALL: 'small,', -} - ColorIndicator.TYPES = { FILLED: 'filled', PARTIAL: 'partial-filled', @@ -44,7 +38,7 @@ ColorIndicator.TYPES = { ColorIndicator.propTypes = { color: PropTypes.oneOf(Object.values(COLORS)), borderColor: PropTypes.oneOf(Object.values(COLORS)), - size: PropTypes.oneOf(Object.values(ColorIndicator.SIZES)), + size: PropTypes.oneOf(Object.values(SIZES)), iconClassName: PropTypes.string, type: PropTypes.oneOf(Object.values(ColorIndicator.TYPES)), } diff --git a/ui/app/components/ui/color-indicator/color-indicator.scss b/ui/app/components/ui/color-indicator/color-indicator.scss index b6eb93104..4a3e1ca34 100644 --- a/ui/app/components/ui/color-indicator/color-indicator.scss +++ b/ui/app/components/ui/color-indicator/color-indicator.scss @@ -2,9 +2,11 @@ @use "design-system"; $sizes: ( - 'large': 6, - 'medium': 5, - 'small': 4, + 'xl': 8, + 'lg': 6, + 'md': 5, + 'sm': 4, + 'xs': 2.5, ); .color-indicator { diff --git a/ui/app/components/ui/color-indicator/color-indicator.stories.js b/ui/app/components/ui/color-indicator/color-indicator.stories.js index 81d7a2159..1c661869b 100644 --- a/ui/app/components/ui/color-indicator/color-indicator.stories.js +++ b/ui/app/components/ui/color-indicator/color-indicator.stories.js @@ -1,6 +1,6 @@ import React from 'react' import { select } from '@storybook/addon-knobs' -import { COLORS } from '../../../helpers/constants/design-system' +import { COLORS, SIZES } from '../../../helpers/constants/design-system' import ColorIndicator from './color-indicator' export default { @@ -9,7 +9,7 @@ export default { export const colorIndicator = () => ( ( export const withIcon = () => ( {this.context.t('newNetwork')}