Skip to content

Commit a4e259e

Browse files
fix: Page header width in the workspace page (coder#2125)
1 parent 3752f4c commit a4e259e

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

site/src/components/PageHeader/PageHeader.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import { makeStyles } from "@material-ui/core/styles"
2+
import { combineClasses } from "../../util/combineClasses"
23
import { Stack } from "../Stack/Stack"
34

45
export interface PageHeaderProps {
56
actions?: JSX.Element
7+
className?: string
68
}
79

8-
export const PageHeader: React.FC<PageHeaderProps> = ({ children, actions }) => {
10+
export const PageHeader: React.FC<PageHeaderProps> = ({ children, actions, className }) => {
911
const styles = useStyles()
1012

1113
return (
12-
<div className={styles.root}>
14+
<div className={combineClasses([styles.root, className])}>
1315
<hgroup>{children}</hgroup>
1416
<Stack direction="row" className={styles.actions}>
1517
{actions}

site/src/components/Workspace/Workspace.tsx

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { makeStyles } from "@material-ui/core/styles"
22
import { FC } from "react"
33
import * as TypesGen from "../../api/typesGenerated"
4-
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
54
import { BuildsTable } from "../BuildsTable/BuildsTable"
65
import { Margins } from "../Margins/Margins"
76
import { PageHeader, PageHeaderSubtitle, PageHeaderTitle } from "../PageHeader/PageHeader"
@@ -49,6 +48,7 @@ export const Workspace: FC<WorkspaceProps> = ({
4948
return (
5049
<Margins>
5150
<PageHeader
51+
className={styles.header}
5252
actions={
5353
<WorkspaceActions
5454
workspace={workspace}
@@ -89,29 +89,19 @@ export const Workspace: FC<WorkspaceProps> = ({
8989
)
9090
}
9191

92+
const spacerWidth = 300
93+
9294
export const useStyles = makeStyles((theme) => {
9395
return {
9496
firstColumnSpacer: {
9597
flex: 2,
9698
},
9799
secondColumnSpacer: {
98-
flex: "0 0 300px",
100+
flex: `0 0 ${spacerWidth}px`,
99101
},
100102
header: {
101-
paddingTop: theme.spacing(5),
102-
paddingBottom: theme.spacing(5),
103-
fontFamily: MONOSPACE_FONT_FAMILY,
104-
display: "flex",
105-
alignItems: "center",
106-
justifyContent: "space-between",
107-
},
108-
title: {
109-
fontWeight: 600,
110-
fontFamily: "inherit",
111-
},
112-
subtitle: {
113-
fontFamily: "inherit",
114-
marginTop: theme.spacing(0.5),
103+
// 100% - (the size of sidebar + the space between both )
104+
maxWidth: `calc(100% - (${spacerWidth}px + ${theme.spacing(3)}px))`,
115105
},
116106
layout: {
117107
alignItems: "flex-start",

0 commit comments

Comments
 (0)