Skip to content

Commit d88b824

Browse files
refactor: Inline workspace badge (#4774)
1 parent 896f628 commit d88b824

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

site/src/components/PageHeader/PageHeader.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const useStyles = makeStyles((theme) => ({
6262

6363
title: {
6464
fontSize: theme.spacing(3),
65+
fontWeight: 400,
6566
margin: 0,
6667
display: "flex",
6768
alignItems: "center",

site/src/components/Pill/Pill.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const useStyles = makeStyles<Theme, PillProps>((theme) => ({
3939
icon ? theme.spacing(0.75) : theme.spacing(1.5),
4040
paddingRight: theme.spacing(1.5),
4141
whiteSpace: "nowrap",
42+
fontWeight: 400,
4243
},
4344

4445
pillColor: {
@@ -54,16 +55,16 @@ const useStyles = makeStyles<Theme, PillProps>((theme) => ({
5455

5556
iconWrapper: {
5657
marginRight: theme.spacing(0.5),
57-
width: theme.spacing(2),
58-
height: theme.spacing(2),
58+
width: theme.spacing(1.75),
59+
height: theme.spacing(1.75),
5960
lineHeight: 0,
6061
display: "flex",
6162
alignItems: "center",
6263
justifyContent: "center",
6364

6465
"& > svg": {
65-
width: theme.spacing(2),
66-
height: theme.spacing(2),
66+
width: theme.spacing(1.75),
67+
height: theme.spacing(1.75),
6768
},
6869
},
6970
}))

site/src/components/Workspace/Workspace.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,6 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
155155
</Stack>
156156
}
157157
>
158-
<WorkspaceStatusBadge
159-
build={workspace.latest_build}
160-
className={styles.statusBadge}
161-
/>
162158
<Stack direction="row" spacing={3} alignItems="center">
163159
{hasTemplateIcon && (
164160
<img
@@ -168,7 +164,13 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
168164
/>
169165
)}
170166
<div>
171-
<PageHeaderTitle>{workspace.name}</PageHeaderTitle>
167+
<PageHeaderTitle>
168+
{workspace.name}
169+
<WorkspaceStatusBadge
170+
build={workspace.latest_build}
171+
className={styles.statusBadge}
172+
/>
173+
</PageHeaderTitle>
172174
<PageHeaderSubtitle condensed>
173175
{workspace.owner_name}
174176
</PageHeaderSubtitle>
@@ -241,7 +243,7 @@ const spacerWidth = 300
241243
export const useStyles = makeStyles((theme) => {
242244
return {
243245
statusBadge: {
244-
marginBottom: theme.spacing(3),
246+
marginLeft: theme.spacing(2),
245247
},
246248

247249
actions: {

site/src/components/WorkspaceStatusBadge/WorkspaceStatusBadge.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ export const getStatus = (
8888
icon: <LoadingIcon />,
8989
}
9090
}
91-
throw new Error("unknown text " + status)
9291
}
9392

9493
export type WorkspaceStatusBadgeProps = {

0 commit comments

Comments
 (0)