1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 06:07:06 +01:00
metamask-extension/ui/components/app/custom-spending-cap/custom-spending-cap-tooltip.js
Harsh Shukla 1277c6225d
Part of #18714 in ui\components\app\custom-spending-cap (#20039)
* Part of #18714 in ui\components\app\custom-spending-cap

* Update checkbox.test.tsx.snap
2023-07-17 22:03:46 -07:00

54 lines
1.4 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 } from '../../component-library';
import { Text } from '../../component-library/text/deprecated';
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]),
};