mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-26 12:29:06 +01:00
9fcbc554b0
Co-authored-by: George Marshall <george.marshall@consensys.net>
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,
|
|
DISPLAY,
|
|
TextVariant,
|
|
} from '../../../helpers/constants/design-system';
|
|
|
|
import { Icon, IconName, IconSize, Text } from '../../component-library';
|
|
|
|
export const CustomSpendingCapTooltip = ({
|
|
tooltipContentText,
|
|
tooltipIcon,
|
|
}) => (
|
|
<Box display={DISPLAY.INLINE_BLOCK}>
|
|
<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]),
|
|
};
|