Skip to content

fix: redesign schedule bumper to handle multiple hours of change at once #4535

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 15 commits into from
Oct 14, 2022
Prev Previous commit
Fix overflow on mobile
  • Loading branch information
presleyp committed Oct 13, 2022
commit fbd8e3c20a50ad0d3de72102038443a3e2b09757
Original file line number Diff line number Diff line change
Expand Up @@ -101,42 +101,54 @@ export const WorkspaceScheduleButton: React.FC<
direction="row"
alignItems="center"
>
<WorkspaceScheduleLabel workspace={workspace} />
<Maybe condition={canUpdateWorkspace && canEditDeadline(workspace)}>
<span className={styles.actions}>
<IconButton
className={styles.subtractButton}
size="small"
disabled={!deadlineMinusEnabled()}
onClick={() => {
setEditMode("subtract")
}}
>
<Tooltip title={t("workspaceScheduleButton.editDeadlineMinus")}>
<RemoveIcon />
</Tooltip>
</IconButton>
<IconButton
className={styles.addButton}
size="small"
disabled={!deadlinePlusEnabled()}
onClick={() => {
setEditMode("add")
}}
>
<Tooltip title={t("workspaceScheduleButton.editDeadlinePlus")}>
<AddIcon />
</Tooltip>
</IconButton>
</span>
<Maybe condition={editMode !== "off"}>
<EditHours
handleSubmit={handleSubmitHours}
max={
editMode === "add" ? maxDeadlineIncrease : maxDeadlineDecrease
}
/>
<Stack spacing={1} direction="row" alignItems="center">
<WorkspaceScheduleLabel workspace={workspace} />
<Maybe condition={canUpdateWorkspace && canEditDeadline(workspace)}>
<span className={styles.actions}>
<IconButton
className={styles.subtractButton}
size="small"
disabled={!deadlineMinusEnabled()}
onClick={() => {
setEditMode("subtract")
}}
>
<Tooltip
title={t("workspaceScheduleButton.editDeadlineMinus")}
>
<RemoveIcon />
</Tooltip>
</IconButton>
<IconButton
className={styles.addButton}
size="small"
disabled={!deadlinePlusEnabled()}
onClick={() => {
setEditMode("add")
}}
>
<Tooltip
title={t("workspaceScheduleButton.editDeadlinePlus")}
>
<AddIcon />
</Tooltip>
</IconButton>
</span>
</Maybe>
</Stack>
<Maybe
condition={
canUpdateWorkspace &&
canEditDeadline(workspace) &&
editMode !== "off"
}
>
<EditHours
handleSubmit={handleSubmitHours}
max={
editMode === "add" ? maxDeadlineIncrease : maxDeadlineDecrease
}
/>
</Maybe>
</Stack>
</Maybe>
Expand Down Expand Up @@ -194,15 +206,13 @@ const useStyles = makeStyles<Theme, StyleProps>((theme) => ({
},
},
label: {
borderRight: 0,
padding: "0 8px 0 16px",
padding: theme.spacing(0, 2),
color: theme.palette.text.secondary,

[theme.breakpoints.down("sm")]: {
width: "100%",
display: "flex",
alignItems: "center",
padding: theme.spacing(1.5, 2),
flexDirection: "column",
},
},
actions: {
Expand Down