diff --git a/site/src/components/WorkspaceScheduleButton/WorkspaceScheduleButton.stories.tsx b/site/src/components/WorkspaceScheduleButton/WorkspaceScheduleButton.stories.tsx index 94d0b8b332160..222be67473ac9 100644 --- a/site/src/components/WorkspaceScheduleButton/WorkspaceScheduleButton.stories.tsx +++ b/site/src/components/WorkspaceScheduleButton/WorkspaceScheduleButton.stories.tsx @@ -87,3 +87,11 @@ CannotEdit.args = { }, canUpdateWorkspace: false, } + +export const SmallViewport = Template.bind({}) +SmallViewport.args = { + ...WorkspaceOffShort.args, +} +SmallViewport.parameters = { + chromatic: { viewports: [320] }, +} diff --git a/site/src/components/WorkspaceScheduleButton/WorkspaceScheduleButton.tsx b/site/src/components/WorkspaceScheduleButton/WorkspaceScheduleButton.tsx index f643b5b4acd05..0a6ccd312de21 100644 --- a/site/src/components/WorkspaceScheduleButton/WorkspaceScheduleButton.tsx +++ b/site/src/components/WorkspaceScheduleButton/WorkspaceScheduleButton.tsx @@ -140,6 +140,10 @@ const useStyles = makeStyles((theme) => ({ alignItems: "center", border: `1px solid ${theme.palette.divider}`, borderRadius: `${theme.shape.borderRadius}px`, + + [theme.breakpoints.down("sm")]: { + flexDirection: "column", + }, }, label: { borderRight: 0, @@ -150,11 +154,15 @@ const useStyles = makeStyles((theme) => ({ width: "100%", display: "flex", alignItems: "center", + padding: theme.spacing(1.5, 2), }, }, actions: { [theme.breakpoints.down("sm")]: { marginLeft: "auto", + display: "flex", + paddingLeft: theme.spacing(1), + marginRight: -theme.spacing(1), }, }, scheduleButton: { @@ -162,6 +170,13 @@ const useStyles = makeStyles((theme) => ({ borderLeft: `1px solid ${theme.palette.divider}`, borderRadius: `0px ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px 0px`, flexShrink: 0, + + [theme.breakpoints.down("sm")]: { + width: "100%", + borderLeft: 0, + borderTop: `1px solid ${theme.palette.divider}`, + borderRadius: `0 0 ${theme.shape.borderRadius}px ${theme.shape.borderRadius}px`, + }, }, iconButton: { borderRadius: 2, diff --git a/site/src/components/WorkspaceScheduleButton/WorkspaceScheduleLabel.tsx b/site/src/components/WorkspaceScheduleButton/WorkspaceScheduleLabel.tsx index e57ec0087ac8a..d4b10e4b6db04 100644 --- a/site/src/components/WorkspaceScheduleButton/WorkspaceScheduleLabel.tsx +++ b/site/src/components/WorkspaceScheduleButton/WorkspaceScheduleLabel.tsx @@ -14,18 +14,16 @@ export const WorkspaceScheduleLabel: React.FC<{ workspace: Workspace }> = ({ wor // If it is shutting down, we don't need to display the auto stop label return ( - {shouldDisplayStrongLabel && ( - {Language.autoStopLabel} - )} - {stopLabel} + {shouldDisplayStrongLabel && {Language.autoStopLabel}}{" "} + {stopLabel} ) } return ( - {Language.autoStartLabel} - {autoStartDisplay(workspace.autostart_schedule)} + {Language.autoStartLabel}{" "} + {autoStartDisplay(workspace.autostart_schedule)} ) } @@ -33,9 +31,17 @@ export const WorkspaceScheduleLabel: React.FC<{ workspace: Workspace }> = ({ wor const useStyles = makeStyles((theme) => ({ labelText: { marginRight: theme.spacing(2), + lineHeight: "160%", + + [theme.breakpoints.down("sm")]: { + marginRight: 0, + width: "100%", + }, }, - labelStrong: { - marginRight: theme.spacing(0.5), + value: { + [theme.breakpoints.down("sm")]: { + whiteSpace: "nowrap", + }, }, }))