Skip to content

Commit d1589b0

Browse files
authored
alert: drop custom alert (#91892)
Fixes DE-33 Before ![CleanShot 2025-05-19 at 15 53 24@2x](https://github.com/user-attachments/assets/e606483f-bb0e-4a9a-b8b7-210a24a18c20) After ![CleanShot 2025-05-19 at 15 54 53@2x](https://github.com/user-attachments/assets/7b6fff41-43aa-4fae-9886-a6b63965c978) Fwiw, this was also quite broken in dark mode... ![CleanShot 2025-05-19 at 15 53 17@2x](https://github.com/user-attachments/assets/9cfffcc6-e450-45ad-bdb5-23c5872b2767)
1 parent 74e76dd commit d1589b0

File tree

4 files changed

+52
-67
lines changed

4 files changed

+52
-67
lines changed

static/app/components/pageAlertBar.tsx

Lines changed: 0 additions & 13 deletions
This file was deleted.

static/app/views/issueDetails/groupDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import {
6060
IssueDetailsTourContext,
6161
ORDERED_ISSUE_DETAILS_TOUR,
6262
} from 'sentry/views/issueDetails/issueDetailsTour';
63-
import SampleEventAlert from 'sentry/views/issueDetails/sampleEventAlert';
63+
import {SampleEventAlert} from 'sentry/views/issueDetails/sampleEventAlert';
6464
import {GroupDetailsLayout} from 'sentry/views/issueDetails/streamline/groupDetailsLayout';
6565
import {useIssueActivityDrawer} from 'sentry/views/issueDetails/streamline/hooks/useIssueActivityDrawer';
6666
import {useMergedIssuesDrawer} from 'sentry/views/issueDetails/streamline/hooks/useMergedIssuesDrawer';
Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,45 @@
1-
import styled from '@emotion/styled';
2-
1+
import {Alert} from 'sentry/components/core/alert';
32
import {LinkButton} from 'sentry/components/core/button/linkButton';
4-
import PageAlertBar from 'sentry/components/pageAlertBar';
53
import {IconLightning} from 'sentry/icons';
64
import {t} from 'sentry/locale';
7-
import {space} from 'sentry/styles/space';
85
import type {Organization} from 'sentry/types/organization';
96
import type {AvatarProject} from 'sentry/types/project';
107
import {trackAnalytics} from 'sentry/utils/analytics';
118

12-
function SampleEventAlert({
9+
export function SampleEventAlert({
1310
organization,
1411
project,
1512
}: {
1613
organization: Organization;
1714
project: AvatarProject;
1815
}) {
1916
return (
20-
<PageAlertBar>
21-
<IconLightning />
22-
<TextWrapper>
23-
{t(
24-
'You are viewing a sample error. Configure Sentry to start viewing real errors.'
25-
)}
26-
</TextWrapper>
27-
<LinkButton
28-
size="xs"
29-
priority="primary"
30-
to={`/${organization.slug}/${project.slug}/getting-started/${
31-
project.platform || ''
32-
}`}
33-
onClick={() =>
34-
trackAnalytics('growth.sample_error_onboarding_link_clicked', {
35-
project_id: project.id?.toString(),
36-
organization,
37-
platform: project.platform,
38-
})
39-
}
40-
>
41-
{t('Get Started')}
42-
</LinkButton>
43-
</PageAlertBar>
17+
<Alert
18+
system
19+
type="info"
20+
icon={<IconLightning />}
21+
trailingItems={
22+
<LinkButton
23+
size="xs"
24+
priority="primary"
25+
to={`/${organization.slug}/${project.slug}/getting-started/${
26+
project.platform || ''
27+
}`}
28+
onClick={() =>
29+
trackAnalytics('growth.sample_error_onboarding_link_clicked', {
30+
project_id: project.id?.toString(),
31+
organization,
32+
platform: project.platform,
33+
})
34+
}
35+
>
36+
{t('Get Started')}
37+
</LinkButton>
38+
}
39+
>
40+
{t(
41+
'You are viewing a sample error. Configure Sentry to start viewing real errors.'
42+
)}
43+
</Alert>
4444
);
4545
}
46-
47-
export default SampleEventAlert;
48-
49-
const TextWrapper = styled('span')`
50-
margin: 0 ${space(1)};
51-
`;

static/app/views/performance/transactionDetails/finishSetupAlert.tsx

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import styled from '@emotion/styled';
22

3+
import {Alert} from 'sentry/components/core/alert';
34
import {LinkButton} from 'sentry/components/core/button/linkButton';
4-
import PageAlertBar from 'sentry/components/pageAlertBar';
55
import {IconLightning} from 'sentry/icons';
66
import {t} from 'sentry/locale';
77
import {space} from 'sentry/styles/space';
@@ -16,28 +16,32 @@ export default function FinishSetupAlert({
1616
projectId: string;
1717
}) {
1818
return (
19-
<PageAlertBar>
20-
<IconLightning />
19+
<Alert
20+
type="info"
21+
icon={<IconLightning />}
22+
trailingItems={
23+
<LinkButton
24+
size="xs"
25+
priority="primary"
26+
external
27+
href="https://docs.sentry.io/performance-monitoring/getting-started/"
28+
onClick={() =>
29+
trackAnalytics('growth.sample_transaction_docs_link_clicked', {
30+
project_id: projectId,
31+
organization,
32+
})
33+
}
34+
>
35+
{t('Get Started')}
36+
</LinkButton>
37+
}
38+
>
2139
<TextWrapper>
2240
{t(
2341
'You are viewing a sample transaction. Configure performance to start viewing real transactions.'
2442
)}
2543
</TextWrapper>
26-
<LinkButton
27-
size="xs"
28-
priority="primary"
29-
external
30-
href="https://docs.sentry.io/performance-monitoring/getting-started/"
31-
onClick={() =>
32-
trackAnalytics('growth.sample_transaction_docs_link_clicked', {
33-
project_id: projectId,
34-
organization,
35-
})
36-
}
37-
>
38-
{t('Get Started')}
39-
</LinkButton>
40-
</PageAlertBar>
44+
</Alert>
4145
);
4246
}
4347

0 commit comments

Comments
 (0)