mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-29 23:58:06 +01:00
bf61322ee1
* Updating import paths * Updating snapshots * Fixing lint issues * Updating snapshots
53 lines
1.3 KiB
JavaScript
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]),
|
|
};
|