From 692a84a86ea06bac4ef34f7a15c91586777d3fc5 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Fri, 16 Dec 2022 12:46:15 +0000 Subject: [PATCH] Fixes the start and end time mobile view (#6057) --- apps/web/pages/availability/[schedule].tsx | 124 +++++++++--------- .../schedules/components/Schedule.tsx | 7 +- 2 files changed, 63 insertions(+), 68 deletions(-) diff --git a/apps/web/pages/availability/[schedule].tsx b/apps/web/pages/availability/[schedule].tsx index 20d7eabd09..890a1e3cd7 100644 --- a/apps/web/pages/availability/[schedule].tsx +++ b/apps/web/pages/availability/[schedule].tsx @@ -174,74 +174,70 @@ export default function Availability({ schedule }: { schedule: number }) { }> -
- {/* TODO: Find a better way to guarantee alignment, but for now this'll do. */} - -
-
{ - updateMutation.mutate({ - scheduleId: schedule, - dateOverrides: dateOverrides.flatMap((override) => override.ranges), - ...values, - }); - }} - className="-mx-4 flex flex-col pb-16 sm:mx-0 xl:flex-row xl:space-x-6"> -
-
-

- {t("change_start_end")} -

- {typeof me.data?.weekStart === "string" && ( - - )} -
- {data?.workingHours && } +
+ { + updateMutation.mutate({ + scheduleId: schedule, + dateOverrides: dateOverrides.flatMap((override) => override.ranges), + ...values, + }); + }} + className="flex flex-col pb-16 sm:mx-0 xl:flex-row xl:space-x-6"> +
+
+

+ {t("change_start_end")} +

+ {typeof me.data?.weekStart === "string" && ( + + )}
-
-
-
- - - value ? ( - onChange(timezone.value)} - /> - ) : ( - - ) - } - /> -
-
-
-

{t("something_doesnt_look_right")}

-
- -
+ {data?.workingHours && } +
+
+
+
+ + + value ? ( + onChange(timezone.value)} + /> + ) : ( + + ) + } + /> +
+
+
+

{t("something_doesnt_look_right")}

+
+
- -
+
+
); diff --git a/packages/features/schedules/components/Schedule.tsx b/packages/features/schedules/components/Schedule.tsx index d54ccc6462..c946246384 100644 --- a/packages/features/schedules/components/Schedule.tsx +++ b/packages/features/schedules/components/Schedule.tsx @@ -51,7 +51,7 @@ const ScheduleDay = ({ const watchDayRange = watch(name); return ( -
+
{/* Label & switch container */}
@@ -83,7 +83,6 @@ const ScheduleDay = ({ )} -
); }; @@ -140,7 +139,7 @@ const Schedule = < const { i18n } = useLocale(); return ( - <> +
{/* First iterate for each day */} {weekdayNames(i18n.language, weekStart, "long").map((weekday, num) => { const weekdayIndex = (num + weekStart) % 7; @@ -155,7 +154,7 @@ const Schedule = < /> ); })} - +
); };