Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(insights): add tooltip to explain geo selector #77329

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
type SelectOption,
type SelectProps,
} from 'sentry/components/compactSelect';
import QuestionTooltip from 'sentry/components/questionTooltip';
import {t} from 'sentry/locale';
import {space} from 'sentry/styles/space';
import {trackAnalytics} from 'sentry/utils/analytics';
Expand Down Expand Up @@ -56,6 +57,8 @@ export default function SubregionSelector({size}: Props) {
return <Fragment />;
}

const tooltip = t('These correspond to the subregions of the UN M49 standard.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there some official page we can link to

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was thinking about that too, I'll open up a new PR if I find anything


return (
<CompactSelect
size={size}
Expand All @@ -73,7 +76,12 @@ export default function SubregionSelector({size}: Props) {
clearable
value={value}
triggerLabel={value.length === 0 ? t('All') : undefined}
menuTitle={t('Filter region')}
menuTitle={
<MenuTitleContainer>
{t('Filter region')}
<QuestionTooltip title={tooltip} size="xs" />
</MenuTitleContainer>
}
options={options}
onChange={(selectedOptions: SelectOption<string>[]) => {
trackAnalytics('insight.vital.select_browser_value', {
Expand All @@ -98,3 +106,9 @@ export default function SubregionSelector({size}: Props) {
const StyledFeatureBadge = styled(FeatureBadge)`
margin-right: ${space(1)};
`;

const MenuTitleContainer = styled('div')`
display: flex;
align-items: center;
gap: ${space(0.5)};
`;
Loading