1
- import Button from "@material-ui/core/Button "
1
+ import IconButton from "@material-ui/core/IconButton "
2
2
import Link from "@material-ui/core/Link"
3
3
import { makeStyles } from "@material-ui/core/styles"
4
+ import Tooltip from "@material-ui/core/Tooltip"
4
5
import Typography from "@material-ui/core/Typography"
6
+ import AddBoxIcon from "@material-ui/icons/AddBox"
7
+ import IndeterminateCheckBoxIcon from "@material-ui/icons/IndeterminateCheckBox"
5
8
import ScheduleIcon from "@material-ui/icons/Schedule"
6
9
import cronstrue from "cronstrue"
7
10
import dayjs from "dayjs"
@@ -67,8 +70,8 @@ export const Language = {
67
70
}
68
71
} ,
69
72
editScheduleLink : "Edit schedule" ,
70
- editDeadlineMinus : "[-1 hour] " ,
71
- editDeadlinePlus : "[+1 hour] " ,
73
+ editDeadlineMinus : "Subtract one hour" ,
74
+ editDeadlinePlus : "Add one hour" ,
72
75
scheduleHeader : ( workspace : Workspace ) : string => {
73
76
const tz = workspace . autostart_schedule
74
77
? extractTimezone ( workspace . autostart_schedule )
@@ -98,16 +101,18 @@ export const WorkspaceSchedule: FC<WorkspaceScheduleProps> = ({
98
101
} ) => {
99
102
const styles = useStyles ( )
100
103
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 >
111
116
) : null
112
117
113
118
return (
@@ -125,11 +130,13 @@ export const WorkspaceSchedule: FC<WorkspaceScheduleProps> = ({
125
130
</ div >
126
131
< div >
127
132
< 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 >
131
139
</ div >
132
- { editDeadlineButtons }
133
140
< div >
134
141
< Link
135
142
className = { styles . scheduleAction }
@@ -168,20 +175,15 @@ const useStyles = makeStyles((theme) => ({
168
175
color : theme . palette . text . secondary ,
169
176
} ,
170
177
scheduleValue : {
171
- fontSize : 16 ,
172
- marginTop : theme . spacing ( 0.25 ) ,
178
+ fontSize : 14 ,
179
+ marginTop : theme . spacing ( 0.75 ) ,
173
180
display : "inline-block" ,
174
181
color : theme . palette . text . secondary ,
175
182
} ,
176
183
scheduleAction : {
177
184
cursor : "pointer" ,
178
185
} ,
179
186
editDeadline : {
180
- fontSize : 12 ,
181
- textTransform : "uppercase" ,
182
- display : "inline-block" ,
183
- fontWeight : 600 ,
184
187
color : theme . palette . text . secondary ,
185
- margin : theme . spacing ( 0 ) ,
186
188
} ,
187
189
} ) )
0 commit comments