From 29369234911b0650ff244b2b2c53ad3ebd057337 Mon Sep 17 00:00:00 2001 From: Bruno Date: Fri, 1 Jul 2022 11:52:50 +0000 Subject: [PATCH] refactor: Make the applications more notable in the resources table --- site/src/components/AppLink/AppLink.tsx | 36 +++++-------------- site/src/components/Resources/Resources.tsx | 34 +++++++++--------- .../components/TerminalLink/TerminalLink.tsx | 21 ++++------- site/src/theme/overrides.ts | 11 ++++++ 4 files changed, 43 insertions(+), 59 deletions(-) diff --git a/site/src/components/AppLink/AppLink.tsx b/site/src/components/AppLink/AppLink.tsx index f57dd0ef32afa..8e09166f68af5 100644 --- a/site/src/components/AppLink/AppLink.tsx +++ b/site/src/components/AppLink/AppLink.tsx @@ -1,9 +1,9 @@ +import Button from "@material-ui/core/Button" import Link from "@material-ui/core/Link" import { makeStyles } from "@material-ui/core/styles" import ComputerIcon from "@material-ui/icons/Computer" import { FC } from "react" import * as TypesGen from "../../api/typesGenerated" -import { combineClasses } from "../../util/combineClasses" export interface AppLinkProps { userName: TypesGen.User["username"] @@ -26,36 +26,18 @@ export const AppLink: FC = ({ userName, workspaceName, appName, ap window.open(href, appName, "width=900,height=600") }} > - {appIcon ? ( - {`${appName} - ) : ( - - )} - {appName} + ) } -const useStyles = makeStyles((theme) => ({ +const useStyles = makeStyles(() => ({ link: { - color: theme.palette.text.secondary, - display: "flex", - alignItems: "center", - }, - - icon: { - width: 16, - height: 16, - marginRight: theme.spacing(1.5), - - // If no icon is provided we still want the padding on the left - // to occur. - "&.empty": { - opacity: 0, - }, + textDecoration: "none !important", }, })) diff --git a/site/src/components/Resources/Resources.tsx b/site/src/components/Resources/Resources.tsx index 580794a86ffc7..ca5dbfb149574 100644 --- a/site/src/components/Resources/Resources.tsx +++ b/site/src/components/Resources/Resources.tsx @@ -102,15 +102,16 @@ export const Resources: FC = ({ {agent.name} - {agent.operating_system} - {agentStatus.status} +
+ {agent.operating_system} + {agentStatus.status} +
{canUpdateWorkspace && ( - +
{agent.status === "connected" && ( = ({ workspaceName={workspace.name} /> ))} - +
)} @@ -165,23 +166,22 @@ const useStyles = makeStyles((theme) => ({ paddingLeft: `${theme.spacing(2)}px !important`, }, - accessLink: { - color: theme.palette.text.secondary, + agentInfo: { display: "flex", - alignItems: "center", - - "& svg": { - width: 16, - height: 16, - marginRight: theme.spacing(1.5), - }, - }, - - operatingSystem: { + gap: theme.spacing(1.5), fontSize: 14, color: theme.palette.text.secondary, marginTop: theme.spacing(0.5), + }, + + operatingSystem: { display: "block", textTransform: "capitalize", }, + + accessLinks: { + display: "flex", + gap: theme.spacing(0.5), + flexWrap: "wrap", + }, })) diff --git a/site/src/components/TerminalLink/TerminalLink.tsx b/site/src/components/TerminalLink/TerminalLink.tsx index d49f0b519da20..d12178850a629 100644 --- a/site/src/components/TerminalLink/TerminalLink.tsx +++ b/site/src/components/TerminalLink/TerminalLink.tsx @@ -1,3 +1,4 @@ +import Button from "@material-ui/core/Button" import Link from "@material-ui/core/Link" import { makeStyles } from "@material-ui/core/styles" import ComputerIcon from "@material-ui/icons/Computer" @@ -44,25 +45,15 @@ export const TerminalLink: FC = ({ window.open(href, Language.terminalTitle(generateRandomString(12)), "width=900,height=600") }} > - - {Language.linkText} + ) } -// Replicating these from accessLink style from Resources component until we -// define if we want these styles coming from the parent or having a -// ResourceLink component for that -const useStyles = makeStyles((theme) => ({ +const useStyles = makeStyles(() => ({ link: { - color: theme.palette.text.secondary, - display: "flex", - alignItems: "center", - }, - - icon: { - width: 16, - height: 16, - marginRight: theme.spacing(1.5), + textDecoration: "none !important", }, })) diff --git a/site/src/theme/overrides.ts b/site/src/theme/overrides.ts index 40b672cd6ca17..c0f76a9b57a35 100644 --- a/site/src/theme/overrides.ts +++ b/site/src/theme/overrides.ts @@ -32,6 +32,17 @@ export const getOverrides = (palette: PaletteOptions) => { backgroundColor: "#000000", }, }, + sizeSmall: { + padding: `0 12px`, + fontSize: 14, + minHeight: 36, + }, + iconSizeSmall: { + width: 16, + height: 16, + marginLeft: "0 !important", + marginRight: 12, + }, }, MuiTableHead: { root: {