1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00
metamask-extension/ui/components/app/custom-spending-cap/custom-spending-cap-tooltip.js
jainex 52c44924e3
Part #19737 - Replace deprecated FormField component with TextField, Label, HelpText (#19859)
* Replacing deprecated components for component library components

* Update

* Lint fix

---------

Co-authored-by: georgewrmarshall <george.marshall@consensys.net>
2023-08-03 15:30:41 -07:00

51 lines
1.2 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import Tooltip from '../../ui/tooltip';
import {
TextColor,
TextVariant,
Display,
AlignItems,
IconColor,
} from '../../../helpers/constants/design-system';
import { Icon, IconName, IconSize, Text, Box } from '../../component-library';
export const CustomSpendingCapTooltip = ({
tooltipContentText,
tooltipIcon,
}) => (
<Box display={Display.InlineFlex} alignItems={AlignItems.center}>
<Tooltip
interactive
position="top"
html={
<Text variant={TextVariant.bodySm} color={TextColor.textAlternative}>
{tooltipContentText}
</Text>
}
>
{tooltipIcon ? (
<Icon
name={IconName.Danger}
size={IconSize.Inherit}
color={IconColor.errorDefault}
/>
) : (
tooltipIcon !== '' && (
<Icon
name={IconName.Question}
size={IconSize.Inherit}
color={IconColor.iconAlternative}
/>
)
)}
</Tooltip>
</Box>
);
CustomSpendingCapTooltip.propTypes = {
tooltipContentText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
tooltipIcon: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
};