Skip to content

Commit 72febb5

Browse files
committed
Adjust style to match #2091
1 parent ef4ea0c commit 72febb5

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

site/src/components/WorkspaceSchedule/WorkspaceSchedule.tsx

+26-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import Button from "@material-ui/core/Button"
1+
import IconButton from "@material-ui/core/IconButton"
22
import Link from "@material-ui/core/Link"
33
import { makeStyles } from "@material-ui/core/styles"
4+
import Tooltip from "@material-ui/core/Tooltip"
45
import Typography from "@material-ui/core/Typography"
6+
import AddBoxIcon from "@material-ui/icons/AddBox"
7+
import IndeterminateCheckBoxIcon from "@material-ui/icons/IndeterminateCheckBox"
58
import ScheduleIcon from "@material-ui/icons/Schedule"
69
import cronstrue from "cronstrue"
710
import dayjs from "dayjs"
@@ -67,8 +70,8 @@ export const Language = {
6770
}
6871
},
6972
editScheduleLink: "Edit schedule",
70-
editDeadlineMinus: "[-1 hour]",
71-
editDeadlinePlus: "[+1 hour]",
73+
editDeadlineMinus: "Subtract one hour",
74+
editDeadlinePlus: "Add one hour",
7275
scheduleHeader: (workspace: Workspace): string => {
7376
const tz = workspace.autostart_schedule
7477
? extractTimezone(workspace.autostart_schedule)
@@ -98,16 +101,18 @@ export const WorkspaceSchedule: FC<WorkspaceScheduleProps> = ({
98101
}) => {
99102
const styles = useStyles()
100103
const editDeadlineButtons = shouldDisplayPlusMins(workspace) ? (
101-
<div>
102-
<Stack direction="row">
103-
<Button className={styles.editDeadline} onClick={onDeadlineMinus}>
104-
<span className={styles.scheduleLabel}>{Language.editDeadlineMinus}</span>
105-
</Button>
106-
<Button className={styles.editDeadline} onClick={onDeadlinePlus}>
107-
<span className={styles.scheduleLabel}>{Language.editDeadlinePlus}</span>
108-
</Button>
109-
</Stack>
110-
</div>
104+
<Stack direction="row" spacing={0}>
105+
<IconButton size="small" className={styles.editDeadline} onClick={onDeadlineMinus}>
106+
<Tooltip title={Language.editDeadlineMinus}>
107+
<IndeterminateCheckBoxIcon />
108+
</Tooltip>
109+
</IconButton>
110+
<IconButton size="small" className={styles.editDeadline} onClick={onDeadlinePlus}>
111+
<Tooltip title={Language.editDeadlinePlus}>
112+
<AddBoxIcon />
113+
</Tooltip>
114+
</IconButton>
115+
</Stack>
111116
) : null
112117

113118
return (
@@ -125,11 +130,13 @@ export const WorkspaceSchedule: FC<WorkspaceScheduleProps> = ({
125130
</div>
126131
<div>
127132
<span className={styles.scheduleLabel}>{Language.autoStopLabel}</span>
128-
<span className={[styles.scheduleValue, "chromatic-ignore"].join(" ")}>
129-
{Language.autoStopDisplay(workspace)}
130-
</span>
133+
<Stack direction="row">
134+
<span className={[styles.scheduleValue, "chromatic-ignore"].join(" ")}>
135+
{Language.autoStopDisplay(workspace)}
136+
</span>
137+
{editDeadlineButtons}
138+
</Stack>
131139
</div>
132-
{editDeadlineButtons}
133140
<div>
134141
<Link
135142
className={styles.scheduleAction}
@@ -168,20 +175,15 @@ const useStyles = makeStyles((theme) => ({
168175
color: theme.palette.text.secondary,
169176
},
170177
scheduleValue: {
171-
fontSize: 16,
172-
marginTop: theme.spacing(0.25),
178+
fontSize: 14,
179+
marginTop: theme.spacing(0.75),
173180
display: "inline-block",
174181
color: theme.palette.text.secondary,
175182
},
176183
scheduleAction: {
177184
cursor: "pointer",
178185
},
179186
editDeadline: {
180-
fontSize: 12,
181-
textTransform: "uppercase",
182-
display: "inline-block",
183-
fontWeight: 600,
184187
color: theme.palette.text.secondary,
185-
margin: theme.spacing(0),
186188
},
187189
}))

0 commit comments

Comments
 (0)