mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
UX Icon: updated fas-question icon (#17828)
* updated fas-question icon * removed as property from Box * fallback prop for heading
This commit is contained in:
parent
72af5626de
commit
3437d7161f
@ -8,6 +8,7 @@ import {
|
|||||||
DISPLAY,
|
DISPLAY,
|
||||||
TypographyVariant,
|
TypographyVariant,
|
||||||
} from '../../../helpers/constants/design-system';
|
} from '../../../helpers/constants/design-system';
|
||||||
|
import { Icon, ICON_NAMES } from '../../component-library';
|
||||||
|
|
||||||
export const CustomSpendingCapTooltip = ({
|
export const CustomSpendingCapTooltip = ({
|
||||||
tooltipContentText,
|
tooltipContentText,
|
||||||
@ -31,7 +32,7 @@ export const CustomSpendingCapTooltip = ({
|
|||||||
{tooltipIcon ? (
|
{tooltipIcon ? (
|
||||||
<i className="fa fa-exclamation-triangle form-field__heading-title__tooltip__warning-icon" />
|
<i className="fa fa-exclamation-triangle form-field__heading-title__tooltip__warning-icon" />
|
||||||
) : (
|
) : (
|
||||||
tooltipIcon !== '' && <i className="fa fa-question-circle" />
|
tooltipIcon !== '' && <Icon name={ICON_NAMES.QUESTION} />
|
||||||
)}
|
)}
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Box>
|
</Box>
|
||||||
|
@ -26,6 +26,7 @@ export default function FormField({
|
|||||||
TooltipCustomComponent,
|
TooltipCustomComponent,
|
||||||
titleDetail = '',
|
titleDetail = '',
|
||||||
titleDetailWrapperProps,
|
titleDetailWrapperProps,
|
||||||
|
titleHeadingWrapperProps,
|
||||||
error,
|
error,
|
||||||
onChange = undefined,
|
onChange = undefined,
|
||||||
value = 0,
|
value = 0,
|
||||||
@ -55,6 +56,7 @@ export default function FormField({
|
|||||||
className="form-field__heading-title"
|
className="form-field__heading-title"
|
||||||
display={DISPLAY.FLEX}
|
display={DISPLAY.FLEX}
|
||||||
alignItems={AlignItems.baseline}
|
alignItems={AlignItems.baseline}
|
||||||
|
{...titleHeadingWrapperProps}
|
||||||
>
|
>
|
||||||
{TitleTextCustomComponent ||
|
{TitleTextCustomComponent ||
|
||||||
(titleText && (
|
(titleText && (
|
||||||
@ -210,6 +212,13 @@ FormField.propTypes = {
|
|||||||
titleDetailWrapperProps: PropTypes.shape({
|
titleDetailWrapperProps: PropTypes.shape({
|
||||||
...Box.propTypes,
|
...Box.propTypes,
|
||||||
}),
|
}),
|
||||||
|
/**
|
||||||
|
* Props to pass to wrapping Box component of the titleHeading component
|
||||||
|
* Accepts all props of the Box component
|
||||||
|
*/
|
||||||
|
titleHeadingWrapperProps: PropTypes.shape({
|
||||||
|
...Box.propTypes,
|
||||||
|
}),
|
||||||
/**
|
/**
|
||||||
* Show error message
|
* Show error message
|
||||||
*/
|
*/
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import Typography from '../typography';
|
import Typography from '../typography';
|
||||||
import Tooltip from '../tooltip';
|
import Tooltip from '../tooltip';
|
||||||
import Box from '../box';
|
|
||||||
|
|
||||||
|
import { Icon, ICON_NAMES } from '../../component-library';
|
||||||
|
import { AlignItems } from '../../../helpers/constants/design-system';
|
||||||
import README from './README.mdx';
|
import README from './README.mdx';
|
||||||
import FormField from '.';
|
import FormField from '.';
|
||||||
|
|
||||||
@ -94,6 +95,7 @@ export const CustomComponents = (args) => {
|
|||||||
<div style={{ width: '600px' }}>
|
<div style={{ width: '600px' }}>
|
||||||
<FormField
|
<FormField
|
||||||
{...args}
|
{...args}
|
||||||
|
titleHeadingWrapperProps={{ alignItems: AlignItems.center }}
|
||||||
TitleTextCustomComponent={
|
TitleTextCustomComponent={
|
||||||
<Typography>TitleTextCustomComponent</Typography>
|
<Typography>TitleTextCustomComponent</Typography>
|
||||||
}
|
}
|
||||||
@ -106,7 +108,7 @@ export const CustomComponents = (args) => {
|
|||||||
position="top"
|
position="top"
|
||||||
html={<Typography>Custom tooltip</Typography>}
|
html={<Typography>Custom tooltip</Typography>}
|
||||||
>
|
>
|
||||||
<Box as="i" marginLeft={2} className="fa fa-question-circle" />
|
<Icon name={ICON_NAMES.QUESTION} marginLeft={2} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
}
|
}
|
||||||
titleDetail={<Typography>TitleDetail</Typography>}
|
titleDetail={<Typography>TitleDetail</Typography>}
|
||||||
|
@ -36,12 +36,6 @@
|
|||||||
color: var(--color-text-default);
|
color: var(--color-text-default);
|
||||||
}
|
}
|
||||||
|
|
||||||
i {
|
|
||||||
color: var(--color-icon-default);
|
|
||||||
font-size: $font-size-h7;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__input {
|
&__input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
padding-bottom: 1px;
|
padding-bottom: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fa-question-circle,
|
|
||||||
.popover-header__button {
|
.popover-header__button {
|
||||||
color: var(--color-icon-default);
|
color: var(--color-icon-default);
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ import { IMPORT_TOKEN_ROUTE } from '../../../helpers/constants/routes';
|
|||||||
import Chip from '../chip/chip';
|
import Chip from '../chip/chip';
|
||||||
import { setFirstTimeUsedNetwork } from '../../../store/actions';
|
import { setFirstTimeUsedNetwork } from '../../../store/actions';
|
||||||
import { NETWORK_TYPES } from '../../../../shared/constants/network';
|
import { NETWORK_TYPES } from '../../../../shared/constants/network';
|
||||||
|
import { Icon, ICON_NAMES } from '../../component-library';
|
||||||
|
|
||||||
const NewNetworkInfo = () => {
|
const NewNetworkInfo = () => {
|
||||||
const t = useContext(I18nContext);
|
const t = useContext(I18nContext);
|
||||||
@ -103,7 +104,11 @@ const NewNetworkInfo = () => {
|
|||||||
primaryTokenImage ? (
|
primaryTokenImage ? (
|
||||||
<Identicon image={primaryTokenImage} diameter={14} />
|
<Identicon image={primaryTokenImage} diameter={14} />
|
||||||
) : (
|
) : (
|
||||||
<i className="fa fa-question-circle" />
|
<Icon
|
||||||
|
className="question"
|
||||||
|
name={ICON_NAMES.QUESTION}
|
||||||
|
color={Color.iconDefault}
|
||||||
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
@ -65,7 +65,7 @@ describe('NewNetworkInfo', () => {
|
|||||||
updateTokenDetectionSupportStatus,
|
updateTokenDetectionSupportStatus,
|
||||||
);
|
);
|
||||||
const { container } = renderWithProvider(<NewNetworkInfo />, store);
|
const { container } = renderWithProvider(<NewNetworkInfo />, store);
|
||||||
const questionMark = container.querySelector('.fa fa-question-circle');
|
const questionMark = container.querySelector('.question');
|
||||||
|
|
||||||
expect(questionMark).toBeDefined();
|
expect(questionMark).toBeDefined();
|
||||||
});
|
});
|
||||||
|
@ -4,7 +4,7 @@ import { I18nContext } from '../../../contexts/i18n';
|
|||||||
import Box from '../box';
|
import Box from '../box';
|
||||||
import Tooltip from '../tooltip';
|
import Tooltip from '../tooltip';
|
||||||
import Typography from '../typography';
|
import Typography from '../typography';
|
||||||
import { ButtonLink } from '../../component-library';
|
import { ButtonLink, Icon, ICON_NAMES } from '../../component-library';
|
||||||
import {
|
import {
|
||||||
AlignItems,
|
AlignItems,
|
||||||
DISPLAY,
|
DISPLAY,
|
||||||
@ -15,6 +15,7 @@ import {
|
|||||||
Size,
|
Size,
|
||||||
BackgroundColor,
|
BackgroundColor,
|
||||||
TextColor,
|
TextColor,
|
||||||
|
Color,
|
||||||
} from '../../../helpers/constants/design-system';
|
} from '../../../helpers/constants/design-system';
|
||||||
import { Numeric } from '../../../../shared/modules/Numeric';
|
import { Numeric } from '../../../../shared/modules/Numeric';
|
||||||
|
|
||||||
@ -92,7 +93,11 @@ export default function ReviewSpendingCap({
|
|||||||
<i className="fa fa-exclamation-triangle review-spending-cap__heading-title__tooltip__warning-icon" />
|
<i className="fa fa-exclamation-triangle review-spending-cap__heading-title__tooltip__warning-icon" />
|
||||||
)}
|
)}
|
||||||
{Number(tokenValue) === 0 && (
|
{Number(tokenValue) === 0 && (
|
||||||
<i className="far fa-question-circle review-spending-cap__heading-title__tooltip__question-icon" />
|
<Icon
|
||||||
|
className="review-spending-cap__heading-title__tooltip__question-icon"
|
||||||
|
name={ICON_NAMES.QUESTION}
|
||||||
|
color={Color.iconDefault}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Box>
|
</Box>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user