1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-29 07:16:36 +01:00
metamask-extension/ui/components/app/custom-spending-cap/custom-spending-cap-tooltip.js
Harsh Shukla 9fcbc554b0
Some linting issues in the file custom spending cap tooltip.js (#18687)
Co-authored-by: George Marshall <george.marshall@consensys.net>
2023-04-24 10:52:57 -05: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,
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]),
};