Skip to content

refactor: Inline workspace badge #4774

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 1 commit into from
Oct 26, 2022
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
refactor: Inline workspace badge
  • Loading branch information
BrunoQuaresma committed Oct 26, 2022
commit c7cfdaa55ee43f10e6745114826acdbc1d68bdab
1 change: 1 addition & 0 deletions site/src/components/PageHeader/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const useStyles = makeStyles((theme) => ({

title: {
fontSize: theme.spacing(3),
fontWeight: 400,
margin: 0,
display: "flex",
alignItems: "center",
Expand Down
9 changes: 5 additions & 4 deletions site/src/components/Pill/Pill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const useStyles = makeStyles<Theme, PillProps>((theme) => ({
icon ? theme.spacing(0.75) : theme.spacing(1.5),
paddingRight: theme.spacing(1.5),
whiteSpace: "nowrap",
fontWeight: 400,
},

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

iconWrapper: {
marginRight: theme.spacing(0.5),
width: theme.spacing(2),
height: theme.spacing(2),
width: theme.spacing(1.75),
height: theme.spacing(1.75),
lineHeight: 0,
display: "flex",
alignItems: "center",
justifyContent: "center",

"& > svg": {
width: theme.spacing(2),
height: theme.spacing(2),
width: theme.spacing(1.75),
height: theme.spacing(1.75),
},
},
}))
14 changes: 8 additions & 6 deletions site/src/components/Workspace/Workspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
</Stack>
}
>
<WorkspaceStatusBadge
build={workspace.latest_build}
className={styles.statusBadge}
/>
<Stack direction="row" spacing={3} alignItems="center">
{hasTemplateIcon && (
<img
Expand All @@ -168,7 +164,13 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
/>
)}
<div>
<PageHeaderTitle>{workspace.name}</PageHeaderTitle>
<PageHeaderTitle>
{workspace.name}
<WorkspaceStatusBadge
build={workspace.latest_build}
className={styles.statusBadge}
/>
</PageHeaderTitle>
<PageHeaderSubtitle condensed>
{workspace.owner_name}
</PageHeaderSubtitle>
Expand Down Expand Up @@ -241,7 +243,7 @@ const spacerWidth = 300
export const useStyles = makeStyles((theme) => {
return {
statusBadge: {
marginBottom: theme.spacing(3),
marginLeft: theme.spacing(2),
},

actions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export const getStatus = (
icon: <LoadingIcon />,
}
}
throw new Error("unknown text " + status)
}

export type WorkspaceStatusBadgeProps = {
Expand Down