Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor: replace MUI buttons on Alerts #16209

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

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions site/src/components/Alert/Alert.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Button from "@mui/material/Button";
import type { Meta, StoryObj } from "@storybook/react";
import { Button } from "components/Button/Button";
import { Alert } from "./Alert";

const meta: Meta<typeof Alert> = {
Expand All @@ -11,7 +11,7 @@ export default meta;
type Story = StoryObj<typeof Alert>;

const ExampleAction = (
<Button onClick={() => null} size="small" variant="text">
<Button onClick={() => null} size="sm" variant="subtle">
Button
</Button>
);
Expand Down
6 changes: 3 additions & 3 deletions site/src/components/Alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import MuiAlert, {
type AlertProps as MuiAlertProps,
// biome-ignore lint/nursery/noRestrictedImports: Used as base component
} from "@mui/material/Alert";
import Button from "@mui/material/Button";
import Collapse from "@mui/material/Collapse";
import { Button } from "components/Button/Button";
import {
type FC,
type PropsWithChildren,
Expand Down Expand Up @@ -51,8 +51,8 @@ export const Alert: FC<AlertProps> = ({
{/* close CTA */}
{dismissible && (
<Button
variant="text"
size="small"
variant="subtle"
size="sm"
onClick={() => {
setOpen(false);
onDismiss?.();
Expand Down
4 changes: 2 additions & 2 deletions site/src/components/Alert/ErrorAlert.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Button from "@mui/material/Button";
import type { Meta, StoryObj } from "@storybook/react";
import { Button } from "components/Button/Button";
import { mockApiError } from "testHelpers/entities";
import { ErrorAlert } from "./ErrorAlert";

Expand All @@ -21,7 +21,7 @@ export default meta;
type Story = StoryObj<typeof ErrorAlert>;

const ExampleAction = (
<Button onClick={() => null} size="small" variant="text">
<Button onClick={() => null} size="sm" variant="subtle">
Button
</Button>
);
Expand Down
6 changes: 3 additions & 3 deletions site/src/pages/TerminalPage/TerminalAlerts.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Button from "@mui/material/Button";
import Link from "@mui/material/Link";
import type { WorkspaceAgent } from "api/typesGenerated";
import { Alert, type AlertProps } from "components/Alert/Alert";
import { Button } from "components/Button/Button";
import { type FC, useEffect, useRef, useState } from "react";
import { docs } from "utils/docs";
import type { ConnectionStatus } from "./types";
Expand Down Expand Up @@ -186,8 +186,8 @@ const RefreshSessionButton: FC = () => {
return (
<Button
disabled={isRefreshing}
size="small"
variant="text"
size="sm"
variant="subtle"
onClick={() => {
setIsRefreshing(true);
window.location.reload();
Expand Down
Loading