Files
2024-02-15 17:01:50 +00:00

70 lines
2.0 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type {CSSProperties} from 'react';
import {useEffect} from 'react';
import replaysDeadRageBackground from 'sentry-images/spot/replay-dead-rage-changelog.svg';
import PageBanner from 'sentry/components/alerts/pageBanner';
import {LinkButton} from 'sentry/components/button';
import {IconBroadcast} from 'sentry/icons';
import {t} from 'sentry/locale';
import {trackAnalytics} from 'sentry/utils/analytics';
import useDismissAlert from 'sentry/utils/useDismissAlert';
import useOrganization from 'sentry/utils/useOrganization';
interface Props {
className?: string;
style?: CSSProperties;
}
export default function FeedbackWhatsNewBanner({className, style}: Props) {
const organization = useOrganization();
const {dismiss, isDismissed} = useDismissAlert({
key: `${organization.id}:feedback-whats-new-banner`,
});
useEffect(() => {
if (!isDismissed) {
trackAnalytics('feedback.whats-new-banner-viewed', {
organization,
});
}
}, [organization, isDismissed]);
if (isDismissed) {
return null;
}
return (
<PageBanner
className={className}
style={style}
button={
<LinkButton
external
href="https://docs.sentry.io/product/user-feedback/setup/"
priority="primary"
analyticsEventName="Clicked Feedback Onboarding Setup Button"
analyticsEventKey="feedback.whats-new-banner-clicked"
analyticsParams={{surface: 'whats-new-banner'}}
>
{t('Set Up Now')}
</LinkButton>
}
description={t(
'Users can submit feedback anytime they’re having a problem with your app via our feedback widget.'
)}
heading={t('Introducing the New User Feedback')}
icon={<IconBroadcast size="sm" />}
image={replaysDeadRageBackground}
title={t('What’s new')}
onDismiss={() => {
trackAnalytics('feedback.whats-new-banner-dismissed', {
organization,
});
dismiss();
}}
/>
);
}