1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 23:58:06 +01:00
metamask-extension/ui/components/app/custom-spending-cap/custom-spending-cap-tooltip.js
George Marshall bf61322ee1
Update Text import paths: /app (#20083)
* Updating import paths

* Updating snapshots

* Fixing lint issues

* Updating snapshots
2023-07-19 15:32:35 -07:00

53 lines
1.3 KiB
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import Box from '../../ui/box';
import Tooltip from '../../ui/tooltip';
import {
TextColor,
TextVariant,
Display,
} from '../../../helpers/constants/design-system';
import { Icon, IconName, IconSize, Text } from '../../component-library';
export const CustomSpendingCapTooltip = ({
tooltipContentText,
tooltipIcon,
}) => (
<Box display={Display.InlineBlock}>
<Tooltip
interactive
position="top"
html={
<Text
variant={TextVariant.bodySm}
as="h6"
margin={3}
color={TextColor.textAlternative}
className="form-field__heading-title__tooltip"
>
{tooltipContentText}
</Text>
}
>
{tooltipIcon ? (
<Icon
name={IconName.Danger}
className="form-field__heading-title__tooltip__warning-icon"
size={IconSize.Inherit}
style={{ 'vertical-align': 'bottom' }}
/>
) : (
tooltipIcon !== '' && (
<Icon name={IconName.Question} size={IconSize.Inherit} />
)
)}
</Tooltip>
</Box>
);
CustomSpendingCapTooltip.propTypes = {
tooltipContentText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
tooltipIcon: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
};