From 2fbeb682806ce43a6f1b52a8d2aed454aa1ddee5 Mon Sep 17 00:00:00 2001
From: BrunoQuaresma
Date: Thu, 15 May 2025 18:26:03 +0000
Subject: [PATCH 1/5] chore: replace MUI Button - 1
---
.../PaginationWidget/PageButtons.tsx | 29 ++++++----
.../PaginationWidget/PaginationNavButton.tsx | 18 ++----
.../resources/DownloadAgentLogsButton.tsx | 10 ++--
.../modules/resources/PortForwardButton.tsx | 55 +++++++++----------
.../modules/resources/SSHButton/SSHButton.tsx | 16 +++---
.../TemplateExampleCard.tsx | 21 +++----
site/src/pages/ChatPage/ChatLanding.tsx | 10 ++--
.../pages/TemplatesPage/EmptyTemplates.tsx | 11 ++--
8 files changed, 82 insertions(+), 88 deletions(-)
diff --git a/site/src/components/PaginationWidget/PageButtons.tsx b/site/src/components/PaginationWidget/PageButtons.tsx
index 1e5f9ff7df18c..f3dc1edf33c05 100644
--- a/site/src/components/PaginationWidget/PageButtons.tsx
+++ b/site/src/components/PaginationWidget/PageButtons.tsx
@@ -1,6 +1,7 @@
import { useTheme } from "@emotion/react";
-import Button from "@mui/material/Button";
+import { Button } from "components/Button/Button";
import type { FC, ReactNode } from "react";
+import { cn } from "utils/cn";
type NumberedPageButtonProps = {
pageNumber: number;
@@ -72,18 +73,22 @@ const BasePageButton: FC = ({
return (
);
-};
+};
\ No newline at end of file
diff --git a/site/src/modules/resources/PortForwardButton.tsx b/site/src/modules/resources/PortForwardButton.tsx
index a4b8ee8277ebc..f89b99d356862 100644
--- a/site/src/modules/resources/PortForwardButton.tsx
+++ b/site/src/modules/resources/PortForwardButton.tsx
@@ -2,7 +2,6 @@ import { type Interpolation, type Theme, useTheme } from "@emotion/react";
import LockIcon from "@mui/icons-material/Lock";
import LockOpenIcon from "@mui/icons-material/LockOpen";
import SensorsIcon from "@mui/icons-material/Sensors";
-import MUIButton from "@mui/material/Button";
import CircularProgress from "@mui/material/CircularProgress";
import FormControl from "@mui/material/FormControl";
import Link from "@mui/material/Link";
@@ -77,26 +76,24 @@ export const PortForwardButton: FC = (props) => {
return (
- }
+ size="sm"
+ variant="subtle"
css={{ fontSize: 13, padding: "8px 12px" }}
- startIcon={
- portsQuery.data ? (
-
-
- {portsQuery.data.ports.length}
-
-
- ) : (
-
- )
- }
>
+ {portsQuery.data ? (
+
+
+ {portsQuery.data.ports.length}
+
+
+ ) : (
+
+ )}
Open ports
-
+
+
= ({
required
css={styles.newPortInput}
/>
- = ({
color: theme.palette.text.primary,
}}
/>
-
+
@@ -369,9 +366,9 @@ export const PortForwardPopoverView: FC = ({
alignItems="center"
>
{canSharePorts && (
- {
await upsertSharedPortMutation.mutateAsync({
agent_name: agent.name,
@@ -383,7 +380,7 @@ export const PortForwardPopoverView: FC = ({
}}
>
Share
-
+
)}
@@ -483,9 +480,9 @@ export const PortForwardPopoverView: FC = ({
)}
- {
await deleteSharedPortMutation.mutateAsync({
@@ -502,7 +499,7 @@ export const PortForwardPopoverView: FC = ({
color: theme.palette.text.primary,
}}
/>
-
+
);
diff --git a/site/src/modules/resources/SSHButton/SSHButton.tsx b/site/src/modules/resources/SSHButton/SSHButton.tsx
index 2673d8a8e2241..291ccf20d63a5 100644
--- a/site/src/modules/resources/SSHButton/SSHButton.tsx
+++ b/site/src/modules/resources/SSHButton/SSHButton.tsx
@@ -1,5 +1,5 @@
import type { Interpolation, Theme } from "@emotion/react";
-import Button from "@mui/material/Button";
+import { Button } from "components/Button/Button";
import { CodeExample } from "components/CodeExample/CodeExample";
import {
HelpTooltipLink,
@@ -34,12 +34,12 @@ export const AgentSSHButton: FC = ({
}
+ size="sm"
+ variant="subtle"
css={{ fontSize: 13, padding: "8px 12px" }}
>
Connect via SSH
+
@@ -96,12 +96,12 @@ export const AgentDevcontainerSSHButton: FC<
}
+ size="sm"
+ variant="subtle"
css={{ fontSize: 13, padding: "8px 12px" }}
>
Connect via SSH
+
@@ -163,4 +163,4 @@ const styles = {
codeExampleLabel: {
fontSize: 12,
},
-} satisfies Record>;
+} satisfies Record>;
\ No newline at end of file
diff --git a/site/src/modules/templates/TemplateExampleCard/TemplateExampleCard.tsx b/site/src/modules/templates/TemplateExampleCard/TemplateExampleCard.tsx
index f003a886552e1..5f040f846cd5a 100644
--- a/site/src/modules/templates/TemplateExampleCard/TemplateExampleCard.tsx
+++ b/site/src/modules/templates/TemplateExampleCard/TemplateExampleCard.tsx
@@ -1,5 +1,5 @@
import type { Interpolation, Theme } from "@emotion/react";
-import Button from "@mui/material/Button";
+import { Button } from "components/Button/Button";
import Link from "@mui/material/Link";
import type { TemplateExample } from "api/typesGenerated";
import { ExternalImage } from "components/ExternalImage/ExternalImage";
@@ -54,15 +54,16 @@ export const TemplateExampleCard: FC = ({
-
-
- Use template
-
-
+
+
+
+ Use template
+
+
+
);
};
diff --git a/site/src/pages/ChatPage/ChatLanding.tsx b/site/src/pages/ChatPage/ChatLanding.tsx
index 060752f895313..58e5ed32d9f4c 100644
--- a/site/src/pages/ChatPage/ChatLanding.tsx
+++ b/site/src/pages/ChatPage/ChatLanding.tsx
@@ -1,6 +1,6 @@
import { useTheme } from "@emotion/react";
import SendIcon from "@mui/icons-material/Send";
-import Button from "@mui/material/Button";
+import { Button } from "components/Button/Button";
import IconButton from "@mui/material/IconButton";
import Paper from "@mui/material/Paper";
import Stack from "@mui/material/Stack";
@@ -89,19 +89,19 @@ const ChatLanding: FC = () => {
sx={{ mb: 2 }}
>
setInput("Help me work on issue #...")}
>
Work on Issue
setInput("Help me build a template for...")}
>
Build a Template
setInput("Help me start a new project using...")}
>
Start a Project
@@ -161,4 +161,4 @@ const ChatLanding: FC = () => {
);
};
-export default ChatLanding;
+export default ChatLanding;
\ No newline at end of file
diff --git a/site/src/pages/TemplatesPage/EmptyTemplates.tsx b/site/src/pages/TemplatesPage/EmptyTemplates.tsx
index 5cefe910b1569..0da852957e230 100644
--- a/site/src/pages/TemplatesPage/EmptyTemplates.tsx
+++ b/site/src/pages/TemplatesPage/EmptyTemplates.tsx
@@ -1,5 +1,5 @@
import type { Interpolation, Theme } from "@emotion/react";
-import Button from "@mui/material/Button";
+import { Button } from "components/Button/Button";
import Link from "@mui/material/Link";
import type { TemplateExample } from "api/typesGenerated";
import { CodeExample } from "components/CodeExample/CodeExample";
@@ -79,12 +79,13 @@ export const EmptyTemplates: FC = ({
- View all starter templates
+
+ View all starter templates
+
}
From ebe7c0f12e9fd6fea13af058a2cbd820d8a98afa Mon Sep 17 00:00:00 2001
From: BrunoQuaresma
Date: Thu, 15 May 2025 18:36:13 +0000
Subject: [PATCH 2/5] Update pagination buttons
---
.../PaginationWidget/PageButtons.tsx | 26 +++----------------
.../PaginationWidget/PaginationNavButton.tsx | 13 +++-------
.../PaginationWidget/PaginationWidgetBase.tsx | 4 +--
3 files changed, 8 insertions(+), 35 deletions(-)
diff --git a/site/src/components/PaginationWidget/PageButtons.tsx b/site/src/components/PaginationWidget/PageButtons.tsx
index f3dc1edf33c05..666720b62b913 100644
--- a/site/src/components/PaginationWidget/PageButtons.tsx
+++ b/site/src/components/PaginationWidget/PageButtons.tsx
@@ -1,12 +1,9 @@
-import { useTheme } from "@emotion/react";
import { Button } from "components/Button/Button";
import type { FC, ReactNode } from "react";
-import { cn } from "utils/cn";
type NumberedPageButtonProps = {
pageNumber: number;
totalPages: number;
-
onClick?: () => void;
highlighted?: boolean;
disabled?: boolean;
@@ -69,27 +66,10 @@ const BasePageButton: FC = ({
highlighted = false,
disabled = false,
}) => {
- const theme = useTheme();
-
return (
{
- if (disabled) {
- setShowDisabledMessage(true);
- } else {
- onClick();
- }
- }}
+ size="icon"
+ disabled={disabled}
+ onClick={onClick}
{...delegatedProps}
/>
diff --git a/site/src/components/PaginationWidget/PaginationWidgetBase.tsx b/site/src/components/PaginationWidget/PaginationWidgetBase.tsx
index d163b70740285..2022461a401f6 100644
--- a/site/src/components/PaginationWidget/PaginationWidgetBase.tsx
+++ b/site/src/components/PaginationWidget/PaginationWidgetBase.tsx
@@ -59,7 +59,7 @@ export const PaginationWidgetBase: FC = ({
}
}}
>
-
+
{isMobile ? (
@@ -86,7 +86,7 @@ export const PaginationWidgetBase: FC = ({
}
}}
>
-
+
);
From 48d65c92929013faa24ef77bbee8f7dde1f67fce Mon Sep 17 00:00:00 2001
From: BrunoQuaresma
Date: Thu, 15 May 2025 18:43:35 +0000
Subject: [PATCH 3/5] Replace buton in more components
---
.../ResetPasswordPage/RequestOTPPage.tsx | 26 ++++++++++---------
.../TemplateInsightsPage/IntervalMenu.tsx | 5 ++--
.../pages/TemplatesPage/TemplatesPageView.tsx | 9 +++----
3 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/site/src/pages/ResetPasswordPage/RequestOTPPage.tsx b/site/src/pages/ResetPasswordPage/RequestOTPPage.tsx
index 2767dff4736ae..093c409677010 100644
--- a/site/src/pages/ResetPasswordPage/RequestOTPPage.tsx
+++ b/site/src/pages/ResetPasswordPage/RequestOTPPage.tsx
@@ -1,5 +1,4 @@
import { type Interpolation, type Theme, useTheme } from "@emotion/react";
-import MuiButton from "@mui/material/Button";
import TextField from "@mui/material/TextField";
import { requestOneTimePassword } from "api/queries/users";
import { ErrorAlert } from "components/Alert/ErrorAlert";
@@ -98,15 +97,16 @@ const RequestOTP: FC = ({
Reset password
-
- Cancel
-
+
+ Cancel
+
+
@@ -151,9 +151,11 @@ const RequestOTPSuccess: FC<{ email: string }> = ({ email }) => {
Contact your deployment administrator if you encounter issues.
-
- Back to login
-
+
+
+ Back to login
+
+
);
diff --git a/site/src/pages/TemplatePage/TemplateInsightsPage/IntervalMenu.tsx b/site/src/pages/TemplatePage/TemplateInsightsPage/IntervalMenu.tsx
index 6f14cb0e38e75..c7da8332a29ab 100644
--- a/site/src/pages/TemplatePage/TemplateInsightsPage/IntervalMenu.tsx
+++ b/site/src/pages/TemplatePage/TemplateInsightsPage/IntervalMenu.tsx
@@ -1,7 +1,7 @@
import ExpandMoreOutlined from "@mui/icons-material/ExpandMoreOutlined";
-import Button from "@mui/material/Button";
import Menu from "@mui/material/Menu";
import MenuItem from "@mui/material/MenuItem";
+import { Button } from "components/Button/Button";
import { CheckIcon } from "lucide-react";
import { type FC, useRef, useState } from "react";
@@ -38,9 +38,10 @@ export const IntervalMenu: FC = ({ value, onChange }) => {
aria-haspopup="true"
aria-expanded={open ? "true" : undefined}
onClick={() => setOpen(true)}
- endIcon={}
+ variant="outline"
>
{insightsIntervals[value].label}
+