From ed65b2a3abd662a61f15d705faf8f08dbf96d747 Mon Sep 17 00:00:00 2001 From: Ujwal Kumar Date: Mon, 19 Jun 2023 14:25:25 +0530 Subject: [PATCH] fix: Hide layout switcher when only 1 layout is enabled (#9610) * Hide layout switcher when only 1 layouts is enabled * Ran prettier --------- Co-authored-by: Jeroen Reumkens --- packages/features/bookings/Booker/components/Header.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/features/bookings/Booker/components/Header.tsx b/packages/features/bookings/Booker/components/Header.tsx index 9152d1a468..c917a8a462 100644 --- a/packages/features/bookings/Booker/components/Header.tsx +++ b/packages/features/bookings/Booker/components/Header.tsx @@ -40,13 +40,14 @@ export function Header({ // Only reason we create this component, is because it is used 3 times in this component, // and this way we can't forget to update one of the props in all places :) - const LayoutToggleWithData = () => ( - - ); + const LayoutToggleWithData = () => { + return enabledLayouts.length <= 1 ? null : ( + + ); + }; // In month view we only show the layout toggle. if (isMonthView) { - if (enabledLayouts.length <= 1) return null; return ; }