Skip to content

fix: border fixes for workspace schedule button #3010

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 4 commits into from
Jul 15, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
border fixes for workspace schedule button
  • Loading branch information
Kira-Pilot committed Jul 15, 2022
commit eb458865ff016d28bf22a394ae986b173ae42c1f
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dayjs.extend(relativeTime)
dayjs.extend(timezone)

export const Language = {
schedule: "Schedule",
editDeadlineMinus: "Subtract one hour",
editDeadlinePlus: "Add one hour",
}
Expand Down Expand Up @@ -73,7 +74,7 @@ export const WorkspaceScheduleButton: React.FC<WorkspaceScheduleButtonProps> = (
}

return (
<div className={styles.wrapper}>
<span className={styles.wrapper}>
<div className={styles.label}>
<WorkspaceScheduleLabel workspace={workspace} />
{canUpdateWorkspace && shouldDisplayPlusMinus(workspace) && (
Expand Down Expand Up @@ -101,15 +102,16 @@ export const WorkspaceScheduleButton: React.FC<WorkspaceScheduleButtonProps> = (
</Stack>
)}
</div>
<div>
<>
<Button
ref={anchorRef}
startIcon={<ScheduleIcon />}
onClick={() => {
setIsOpen(true)
}}
className={styles.scheduleButton}
>
Schedule
{Language.schedule}
</Button>
<Popover
classes={{ paper: styles.popoverPaper }}
Expand All @@ -128,19 +130,19 @@ export const WorkspaceScheduleButton: React.FC<WorkspaceScheduleButtonProps> = (
>
<WorkspaceSchedule workspace={workspace} canUpdateWorkspace={canUpdateWorkspace} />
</Popover>
</div>
</div>
</>
</span>
)
}

const useStyles = makeStyles((theme) => ({
wrapper: {
display: "flex",
alignItems: "center",
border: `1px solid ${theme.palette.divider}`,
borderRadius: `${theme.shape.borderRadius}px`,
},

label: {
border: `1px solid ${theme.palette.divider}`,
borderRight: 0,
height: "100%",
display: "flex",
Expand All @@ -150,11 +152,14 @@ const useStyles = makeStyles((theme) => ({
// It is from the button props
minHeight: 42,
},

scheduleButton: {
border: "none",
borderLeft: `1px solid ${theme.palette.divider}`,
borderRadius: `0px ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px 0px`,
},
iconButton: {
borderRadius: 2,
},

popoverPaper: {
padding: `${theme.spacing(2)}px ${theme.spacing(3)}px ${theme.spacing(3)}px`,
},
Expand Down