Skip to content

Commit 8499bcb

Browse files
committed
Refactor Alert
1 parent 988c9af commit 8499bcb

File tree

3 files changed

+0
-33
lines changed

3 files changed

+0
-33
lines changed

site/src/components/Alert/Alert.stories.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Alert } from "./Alert";
22
import Button from "@mui/material/Button";
3-
import Link from "@mui/material/Link";
43
import type { Meta, StoryObj } from "@storybook/react";
54

65
const meta: Meta<typeof Alert> = {
@@ -21,7 +20,6 @@ export const Success: Story = {
2120
args: {
2221
children: "You're doing great!",
2322
severity: "success",
24-
onRetry: undefined,
2523
},
2624
};
2725

@@ -56,14 +54,3 @@ export const WarningWithActionAndDismiss: Story = {
5654
severity: "warning",
5755
},
5856
};
59-
60-
export const WithChildren: Story = {
61-
args: {
62-
severity: "warning",
63-
children: (
64-
<div>
65-
This is a message with a <Link href="#">link</Link>
66-
</div>
67-
),
68-
},
69-
};

site/src/components/Alert/Alert.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ import Box from "@mui/material/Box";
88
export type AlertProps = MuiAlertProps & {
99
actions?: ReactNode;
1010
dismissible?: boolean;
11-
onRetry?: () => void;
1211
onDismiss?: () => void;
1312
};
1413

1514
export const Alert: FC<AlertProps> = ({
1615
children,
1716
actions,
18-
onRetry,
1917
dismissible,
2018
severity,
2119
onDismiss,
@@ -34,13 +32,6 @@ export const Alert: FC<AlertProps> = ({
3432
{/* CTAs passed in by the consumer */}
3533
{actions}
3634

37-
{/* retry CTA */}
38-
{onRetry && (
39-
<Button variant="text" size="small" onClick={onRetry}>
40-
Retry
41-
</Button>
42-
)}
43-
4435
{/* close CTA */}
4536
{dismissible && (
4637
<Button

site/src/components/Alert/ErrorAlert.stories.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import Button from "@mui/material/Button";
22
import { mockApiError } from "testHelpers/entities";
33
import type { Meta, StoryObj } from "@storybook/react";
4-
import { action } from "@storybook/addon-actions";
54
import { ErrorAlert } from "./ErrorAlert";
65

76
const mockError = mockApiError({
@@ -15,7 +14,6 @@ const meta: Meta<typeof ErrorAlert> = {
1514
args: {
1615
error: mockError,
1716
dismissible: false,
18-
onRetry: undefined,
1917
},
2018
};
2119

@@ -57,15 +55,6 @@ export const WithActionAndDismiss: Story = {
5755

5856
export const WithRetry: Story = {
5957
args: {
60-
onRetry: action("retry"),
61-
dismissible: true,
62-
},
63-
};
64-
65-
export const WithActionRetryAndDismiss: Story = {
66-
args: {
67-
actions: [ExampleAction],
68-
onRetry: action("retry"),
6958
dismissible: true,
7059
},
7160
};

0 commit comments

Comments
 (0)