From 64ed511d776f75623f16b033486f3acb52ed5d14 Mon Sep 17 00:00:00 2001 From: Nicole Date: Fri, 17 Apr 2026 22:32:47 +1000 Subject: [PATCH 1/3] feat: change slotHeight from 40 to 60 --- ios/Rooms/Sources/RoomViews/BookingsLayoutView.swift | 7 ++++--- ios/Rooms/Sources/RoomViews/RoomBookingsListView.swift | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ios/Rooms/Sources/RoomViews/BookingsLayoutView.swift b/ios/Rooms/Sources/RoomViews/BookingsLayoutView.swift index f7e793d2..2cc2bd1a 100644 --- a/ios/Rooms/Sources/RoomViews/BookingsLayoutView.swift +++ b/ios/Rooms/Sources/RoomViews/BookingsLayoutView.swift @@ -15,11 +15,12 @@ struct BookingsLayoutView: View { var hour: Int let borderColor = Color.gray.opacity(0.3) + let slotHeight: CGFloat = 60 var body: some View { HStack { Text(formatHour(hour)) - .frame(width: 50, height: 40, alignment: .topTrailing) + .frame(width: 50, height: slotHeight, alignment: .topTrailing) .foregroundStyle(theme.accent.primary) .overlay( VStack(spacing: 0) { @@ -35,11 +36,11 @@ struct BookingsLayoutView: View { VStack(spacing: 0) { Rectangle() .strokeBorder(borderColor, lineWidth: 1) - .frame(height: 20) + .frame(height: slotHeight / 2) Rectangle() .fill(.clear) - .frame(height: 20) + .frame(height: slotHeight / 2) .overlay(alignment: .leading) { Rectangle() .frame(width: 1) diff --git a/ios/Rooms/Sources/RoomViews/RoomBookingsListView.swift b/ios/Rooms/Sources/RoomViews/RoomBookingsListView.swift index 2f2c7f0c..86c3aefd 100644 --- a/ios/Rooms/Sources/RoomViews/RoomBookingsListView.swift +++ b/ios/Rooms/Sources/RoomViews/RoomBookingsListView.swift @@ -25,6 +25,7 @@ struct RoomBookingsListView: View { @Binding var dateSelect: Date let hoursToDisplay: CGFloat = 24 - 9 + let slotHeight: CGFloat = 60 var dateComponent: DateComponents { Calendar.current.dateComponents([.day, .month, .year, .hour, .minute], from: dateSelect) @@ -44,7 +45,7 @@ struct RoomBookingsListView: View { if roomViewModel.getBookingsIsLoading { RoundedRectangle(cornerRadius: 12) .fill(Color.gray.opacity(0.3)) - .frame(height: 24 * 40) + .frame(height: 24 * slotHeight) } // Background time grid @@ -65,9 +66,9 @@ struct RoomBookingsListView: View { .padding(.trailing, 10) } } - .frame(height: hoursToDisplay * 40) + .frame(height: hoursToDisplay * slotHeight) } - .frame(height: hoursToDisplay * 40) + .frame(height: hoursToDisplay * slotHeight) .clipShape(RoundedRectangle(cornerRadius: 12)) .onAppear { let currentHour = max(dateComponent.hour ?? 0, 9) From fabb6ce1e9366003d53d2e69818a141f2cffc305 Mon Sep 17 00:00:00 2001 From: Nicole Date: Fri, 17 Apr 2026 22:37:55 +1000 Subject: [PATCH 2/3] fix: adjust booking cards to fit new slot height --- .../RoomViews/RoomBookingCardView.swift | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/ios/Rooms/Sources/RoomViews/RoomBookingCardView.swift b/ios/Rooms/Sources/RoomViews/RoomBookingCardView.swift index 3515f6f9..d455a7a9 100644 --- a/ios/Rooms/Sources/RoomViews/RoomBookingCardView.swift +++ b/ios/Rooms/Sources/RoomViews/RoomBookingCardView.swift @@ -24,20 +24,20 @@ struct RoomBookingCardView: View { // MARK: Internal var topRadius: CGFloat { - if (start.hour ?? 0) < 9 { - 0 - } else if isSmallBooking { - 10 - } else { - 15 + switch (bookingSize) { + case .small: + return 8 + case .medium: + return 10 } } var bottomRadius: CGFloat { - if isSmallBooking { - 10 - } else { - 15 + switch (bookingSize) { + case .small: + return 8 + case .medium: + return 10 } } @@ -50,28 +50,22 @@ struct RoomBookingCardView: View { topTrailingRadius: topRadius) .fill(theme.accent.primary) - VStack(alignment: .leading, spacing: 2 * (isSmallBooking ? 0.5 : numberTimeSlots)) { + VStack(alignment: .leading, spacing: 3 * (bookingSize == .small ? 1 : 2)) { Text("\(time.0) - \(time.1)") - .font( - isSmallBooking - ? .system(size: 10, weight: .medium) - : .system(size: 12, weight: .medium)) + .font(.system(size: (bookingSize == .small ? 8 : 12), weight: .medium)) Text("\(booking.name)") - .font( - isSmallBooking - ? .system(size: 18, weight: .medium) - : .system(size: 20, weight: .medium)) + .font(.system(size: (bookingSize == .small ? 14 : 20), weight: .medium)) } - .padding(isSmallBooking ? 2 : 10) - .padding(.horizontal, isSmallBooking ? 10 : 0) + .padding(.vertical, (bookingSize == .small ? 1 : 4)) + .padding(.horizontal, 10) .bold() .foregroundStyle(.white) } - .frame(height: (20 * numberTimeSlots) - 4) + .frame(height: ((30 * numberTimeSlots) - 4)) .offset( x: 0, - y: CGFloat(startMinutes) * (40 / 60) + 2) + y: CGFloat(startMinutes) + 2) } var numberTimeSlots: CGFloat { @@ -112,9 +106,17 @@ struct RoomBookingCardView: View { private var start: DateComponents private var end: DateComponents private let startMinutes: Int + + private enum BookingSize{ + case small, medium + } - private var isSmallBooking: Bool { - numberTimeSlots < 4 + private var bookingSize: BookingSize { + if (numberTimeSlots == 1) { + return .small + } else { + return .medium + } } private func formatHour(_ hour: Int, _ minute: Int) -> String { From be9b066adbeb8da20f75e6487b1afcd7ec1f7659 Mon Sep 17 00:00:00 2001 From: Nicole Date: Fri, 17 Apr 2026 23:11:29 +1000 Subject: [PATCH 3/3] style: format RoomBookingCardView --- .../RoomViews/RoomBookingCardView.swift | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/ios/Rooms/Sources/RoomViews/RoomBookingCardView.swift b/ios/Rooms/Sources/RoomViews/RoomBookingCardView.swift index d455a7a9..b6baf3f9 100644 --- a/ios/Rooms/Sources/RoomViews/RoomBookingCardView.swift +++ b/ios/Rooms/Sources/RoomViews/RoomBookingCardView.swift @@ -24,20 +24,20 @@ struct RoomBookingCardView: View { // MARK: Internal var topRadius: CGFloat { - switch (bookingSize) { - case .small: - return 8 - case .medium: - return 10 + switch bookingSize { + case .small: + 8 + case .medium: + 10 } } var bottomRadius: CGFloat { - switch (bookingSize) { - case .small: - return 8 - case .medium: - return 10 + switch bookingSize { + case .small: + 8 + case .medium: + 10 } } @@ -52,17 +52,17 @@ struct RoomBookingCardView: View { VStack(alignment: .leading, spacing: 3 * (bookingSize == .small ? 1 : 2)) { Text("\(time.0) - \(time.1)") - .font(.system(size: (bookingSize == .small ? 8 : 12), weight: .medium)) + .font(.system(size: bookingSize == .small ? 8 : 12, weight: .medium)) Text("\(booking.name)") - .font(.system(size: (bookingSize == .small ? 14 : 20), weight: .medium)) + .font(.system(size: bookingSize == .small ? 14 : 20, weight: .medium)) } - .padding(.vertical, (bookingSize == .small ? 1 : 4)) + .padding(.vertical, bookingSize == .small ? 1 : 4) .padding(.horizontal, 10) .bold() .foregroundStyle(.white) } - .frame(height: ((30 * numberTimeSlots) - 4)) + .frame(height: (30 * numberTimeSlots) - 4) .offset( x: 0, y: CGFloat(startMinutes) + 2) @@ -99,6 +99,10 @@ struct RoomBookingCardView: View { // MARK: Private + private enum BookingSize { + case small, medium + } + @Environment(Theme.self) private var theme private var room: Room @@ -106,16 +110,12 @@ struct RoomBookingCardView: View { private var start: DateComponents private var end: DateComponents private let startMinutes: Int - - private enum BookingSize{ - case small, medium - } private var bookingSize: BookingSize { - if (numberTimeSlots == 1) { - return .small + if numberTimeSlots == 1 { + .small } else { - return .medium + .medium } }