From 00a30775bc1e63471b2b3d76c57da03588c8dc3e Mon Sep 17 00:00:00 2001 From: Bruno Quaresma Date: Wed, 31 May 2023 10:00:30 -0300 Subject: [PATCH] refactor(site): Improve and fix loading buttons (#7719) --- site/src/components/Navbar/NavbarView.tsx | 3 +- .../components/UserDropdown/UsersDropdown.tsx | 11 ++++++- .../WorkspaceActions/WorkspaceActions.tsx | 5 +--- site/src/theme/theme.ts | 29 +++++++++++++------ 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/site/src/components/Navbar/NavbarView.tsx b/site/src/components/Navbar/NavbarView.tsx index 176a9ae446..8167590fba 100644 --- a/site/src/components/Navbar/NavbarView.tsx +++ b/site/src/components/Navbar/NavbarView.tsx @@ -23,6 +23,7 @@ import Divider from "@mui/material/Divider" import HelpOutline from "@mui/icons-material/HelpOutline" import Tooltip from "@mui/material/Tooltip" import Skeleton from "@mui/material/Skeleton" +import { BUTTON_SM_HEIGHT } from "theme/theme" export const USERS_LINK = `/users?filter=${encodeURIComponent("status:active")}` @@ -195,7 +196,7 @@ const ProxyMenu: FC<{ proxyContextValue: ProxyContextValue }> = ({ return ( ) diff --git a/site/src/components/UserDropdown/UsersDropdown.tsx b/site/src/components/UserDropdown/UsersDropdown.tsx index 32582b6fd0..1e77e5ad6b 100644 --- a/site/src/components/UserDropdown/UsersDropdown.tsx +++ b/site/src/components/UserDropdown/UsersDropdown.tsx @@ -9,6 +9,7 @@ import { BorderedMenu } from "../BorderedMenu/BorderedMenu" import { CloseDropdown, OpenDropdown } from "../DropdownArrows/DropdownArrows" import { UserAvatar } from "../UserAvatar/UserAvatar" import { UserDropdownContent } from "../UserDropdownContent/UserDropdownContent" +import { BUTTON_SM_HEIGHT } from "theme/theme" export interface UserDropdownProps { user: TypesGen.User @@ -42,7 +43,15 @@ export const UserDropdown: FC> = ({ >
- + {anchorEl ? ( diff --git a/site/src/components/WorkspaceActions/WorkspaceActions.tsx b/site/src/components/WorkspaceActions/WorkspaceActions.tsx index a842426871..194b3a6d94 100644 --- a/site/src/components/WorkspaceActions/WorkspaceActions.tsx +++ b/site/src/components/WorkspaceActions/WorkspaceActions.tsx @@ -102,10 +102,7 @@ export const WorkspaceActions: FC = ({ ? buttonMapping[ButtonTypesEnum.updating] : buttonMapping[ButtonTypesEnum.update])} {isRestarting && buttonMapping[ButtonTypesEnum.restarting]} - {!isRestarting && - actionsByStatus.map((action) => ( - {buttonMapping[action]} - ))} + {!isRestarting && actionsByStatus.map((action) => buttonMapping[action])} {canCancel && }