Skip to content

Commit

Permalink
Fixing start time picker padding and margin
Browse files Browse the repository at this point in the history
  • Loading branch information
villepynttari committed Sep 12, 2024
1 parent f69c3ff commit 88cc6c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ describe('AvailableRoomList', () => {
},
selectedRoom: fakeRooms[0]
};

it('renders room data', async () => {
render(
<AvailableRoomList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const TimePickerButton = styled(ToggleButton)(() => ({
}
}));

async function checkIfFavorited(room: Room, pref?: Preferences) {
function checkIfFavorited(room: Room, pref?: Preferences) {
if (pref && pref.fav_rooms) {
room.favorited = pref.fav_rooms.includes(room.id);
} else {
Expand Down Expand Up @@ -59,10 +59,10 @@ const AvailableRoomList = (props: BookingListProps) => {

// Effect to update room favorited status
useEffect(() => {
const updateFavoritedRooms = async () => {
const updateFavoritedRooms = () => {
const roomsCopy = [...rooms]; // Make a shallow copy of rooms
for (const room of roomsCopy) {
await checkIfFavorited(room, preferences);
checkIfFavorited(room, preferences);
}
setUpdatedRooms(roomsCopy); // Update state after processing all rooms
};
Expand Down
6 changes: 2 additions & 4 deletions frontend/src/components/BookingView/StartingTimePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import { formatTimeToHalfAndFullHours } from '../util/Time';
import AlertBox from '../util/alertBox';

const StartingTimeButton = styled(ToggleButton)(() => ({}));
const StartingTimePickerContent = styled(Box)(({ theme }) => ({
margin: '8px 0px'
}));
const StartingTimePickerContent = styled(Box)(({ theme }) => ({}));

type StartingTimePickerProps = {
startingTime: string;
Expand Down Expand Up @@ -81,7 +79,7 @@ const StartingTimePicker = (props: StartingTimePickerProps) => {
exclusive
onChange={handleChange}
aria-label="duration picker"
sx={{ margin: '8px 0' }}
sx={{ marginTop: '8px', paddingBottom: '8px' }}
fullWidth
>
<StartingTimeButton
Expand Down

0 comments on commit 88cc6c3

Please sign in to comment.