Skip to content

Commit 7994917

Browse files
committed
Format
1 parent 833210e commit 7994917

File tree

3 files changed

+38
-24
lines changed

3 files changed

+38
-24
lines changed

site/src/components/WorkspaceScheduleButton/EditHours.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export const EditHours = ({ handleSubmit }: EditHoursProps): JSX.Element => {
1919
onChange={(e) => setHours(parseInt(e.target.value))}
2020
type="number"
2121
/>
22-
<Button type="submit">{t("workspaceScheduleButton.submitDeadline")}</Button>
22+
<Button type="submit">
23+
{t("workspaceScheduleButton.submitDeadline")}
24+
</Button>
2325
</form>
2426
)
2527
}

site/src/components/WorkspaceScheduleButton/WorkspaceScheduleButton.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,13 @@ const useStyles = makeStyles<Theme, StyleProps>((theme) => ({
218218
},
219219
addButton: {
220220
borderRadius: theme.shape.borderRadius,
221-
backgroundColor: ({ editMode }) => editMode === "add" ? theme.palette.primary.main : "inherit"
221+
backgroundColor: ({ editMode }) =>
222+
editMode === "add" ? theme.palette.primary.main : "inherit",
222223
},
223224
subtractButton: {
224225
borderRadius: theme.shape.borderRadius,
225-
backgroundColor: ({ editMode }) => editMode === "subtract" ? theme.palette.primary.main : "inherit"
226+
backgroundColor: ({ editMode }) =>
227+
editMode === "subtract" ? theme.palette.primary.main : "inherit",
226228
},
227229
popoverPaper: {
228230
padding: `${theme.spacing(2)}px ${theme.spacing(3)}px ${theme.spacing(

site/src/components/WorkspaceScheduleButton/WorkspaceScheduleLabel.tsx

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,43 @@ import { Maybe } from "components/Conditionals/Maybe"
44
import { useTranslation } from "react-i18next"
55
import { Workspace } from "../../api/typesGenerated"
66
import { combineClasses } from "../../util/combineClasses"
7-
import { autoStartDisplay, autoStopDisplay, isShuttingDown } from "../../util/schedule"
7+
import {
8+
autoStartDisplay,
9+
autoStopDisplay,
10+
isShuttingDown,
11+
} from "../../util/schedule"
812
import { isWorkspaceOn } from "../../util/workspace"
913

10-
export const WorkspaceScheduleLabel: React.FC<{ workspace: Workspace }> = ({ workspace }) => {
14+
export const WorkspaceScheduleLabel: React.FC<{ workspace: Workspace }> = ({
15+
workspace,
16+
}) => {
1117
const styles = useStyles()
1218
const { t } = useTranslation("common")
1319

14-
return <ChooseOne>
15-
<Cond condition={isWorkspaceOn(workspace)}>
16-
<span className={combineClasses([styles.labelText, "chromatic-ignore"])}>
17-
<Maybe condition={!isShuttingDown(workspace)}>
18-
<strong>{t("schedule.autoStopLabel")}</strong>
19-
</Maybe>
20-
{" "}
21-
<span className={styles.value}>
22-
{autoStopDisplay(workspace)}
20+
return (
21+
<ChooseOne>
22+
<Cond condition={isWorkspaceOn(workspace)}>
23+
<span
24+
className={combineClasses([styles.labelText, "chromatic-ignore"])}
25+
>
26+
<Maybe condition={!isShuttingDown(workspace)}>
27+
<strong>{t("schedule.autoStopLabel")}</strong>
28+
</Maybe>{" "}
29+
<span className={styles.value}>{autoStopDisplay(workspace)}</span>
2330
</span>
24-
</span>
25-
</Cond>
26-
<Cond>
27-
<span className={combineClasses([styles.labelText, "chromatic-ignore"])}>
28-
<strong>{t("schedule.autoStartLabel")}</strong>
29-
{" "}
30-
<span className={styles.value}>{autoStartDisplay(workspace.autostart_schedule)}</span>
31-
</span>
32-
</Cond>
33-
</ChooseOne>
31+
</Cond>
32+
<Cond>
33+
<span
34+
className={combineClasses([styles.labelText, "chromatic-ignore"])}
35+
>
36+
<strong>{t("schedule.autoStartLabel")}</strong>{" "}
37+
<span className={styles.value}>
38+
{autoStartDisplay(workspace.autostart_schedule)}
39+
</span>
40+
</span>
41+
</Cond>
42+
</ChooseOne>
43+
)
3444
}
3545

3646
const useStyles = makeStyles((theme) => ({

0 commit comments

Comments
 (0)