Skip to content

Commit

Permalink
format again & some css fixing in order to get the buttons use at lea…
Browse files Browse the repository at this point in the history
…st 100% of the width (durationpicker)
  • Loading branch information
Ilkka Korhonen authored and Ilkka Korhonen committed Jun 26, 2024
1 parent fdbb679 commit 382c099
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
14 changes: 8 additions & 6 deletions frontend/src/components/BookingDrawer/BookingDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,15 @@ const BookingDrawer = (props: Props) => {
</AvailableText>
</RowCentered>
<Row>
<DurationPicker
duration={duration}
setDuration={setDuration}
onChange={handleDurationChange}
title="duration"
/>
<SmallText>quick duration selection</SmallText>
</Row>

<DurationPicker
duration={duration}
setDuration={setDuration}
onChange={handleDurationChange}
title="quick duration selection"
/>
<Row>
<SmallText>booking (rounded to next 5 min)</SmallText>
</Row>
Expand Down
18 changes: 8 additions & 10 deletions frontend/src/components/BookingDrawer/DurationPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ const DurationButton = styled(ToggleButton)(() => ({
padding: '8px 16px'
}));

const DurationButtonGroup = styled(ToggleButtonGroup)(() => ({
minWidth: '100%',
padding: '6px 8px',
marginBottom: '0px !important'
}));

type DurationPickerProps = {
onChange: (duration: number) => void;
title: string;
Expand All @@ -29,15 +35,7 @@ const DurationPicker = (props: DurationPickerProps) => {

return (
<div>
<Typography
variant="subtitle1"
textAlign="left"
marginBottom={'8px'}
marginLeft={'24px'}
>
{title}
</Typography>
<ToggleButtonGroup
<DurationButtonGroup
data-testid="DurationPicker"
color="primary"
value={duration}
Expand Down Expand Up @@ -75,7 +73,7 @@ const DurationPicker = (props: DurationPickerProps) => {
>
2 h
</DurationButton>
</ToggleButtonGroup>
</DurationButtonGroup>
</div>
);
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/BookingView/StartingTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const StartingTimePicker = (props: StartingTimePickerProps) => {
};

const now = DateTime.now();
const startingTimeNow = timeFormat(now.hour, now.minute);
const startingTimeNow = 'Now'; //timeFormat(now.hour, now.minute);
const startingTime2 = formatTimeToHalfAndFullHours(now, 0);
const startingTime3 = formatTimeToHalfAndFullHours(now, 30);
const startingTime4 = formatTimeToHalfAndFullHours(now, 60);
Expand Down

0 comments on commit 382c099

Please sign in to comment.