Skip to content

Commit

Permalink
Add trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
gggritso committed Oct 9, 2024
1 parent 4ea8f62 commit cf4b749
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions static/app/components/questionTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {Tooltip} from 'sentry/components/tooltip';
import {IconInfo, IconQuestion} from 'sentry/icons';
import type {IconSize} from 'sentry/utils/theme';

import {Button} from './button';

interface QuestionProps
extends Partial<
Pick<
Expand Down Expand Up @@ -36,11 +38,13 @@ function QuestionTooltip({
return (
<QuestionIconContainer size={size} className={className}>
<Tooltip title={title} {...tooltipProps}>
{icon === 'info' ? (
<IconInfo size={size} color="subText" data-test-id="more-information" />
) : (
<IconQuestion size={size} color="subText" data-test-id="more-information" />
)}
<TooltipTriggerButton borderless size="xs">
{icon === 'info' ? (
<IconInfo size={size} color="subText" data-test-id="more-information" />
) : (
<IconQuestion size={size} color="subText" data-test-id="more-information" />
)}
</TooltipTriggerButton>
</Tooltip>
</QuestionIconContainer>
);
Expand All @@ -61,4 +65,11 @@ const QuestionIconContainer = styled('span')<Pick<QuestionProps, 'size' | 'class
}
`;

const TooltipTriggerButton = styled(Button)`
padding: 0;
min-height: 0;
width: auto;
height: auto;
`;

export default QuestionTooltip;

0 comments on commit cf4b749

Please sign in to comment.