From 11c3f1c39948253f7f3783d724acaafbac353733 Mon Sep 17 00:00:00 2001 From: Harsh Singh Date: Mon, 21 Oct 2024 22:10:32 +0530 Subject: [PATCH] fix: width in PageHeader comp (#7866) Fixes: #7864 This fix prevents layout issues caused by invalid CSS and ensures that the PageHeader component works correctly when no width prop is passed. ![Screenshot from 2024-10-20 00-03-39](https://github.com/user-attachments/assets/68340256-c756-4a56-9028-9aed32caf68e) Co-authored-by: Charles Bochet --- .../src/modules/ui/layout/page/components/PageHeader.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/twenty-front/src/modules/ui/layout/page/components/PageHeader.tsx b/packages/twenty-front/src/modules/ui/layout/page/components/PageHeader.tsx index 332dee6a219b..82a85687e499 100644 --- a/packages/twenty-front/src/modules/ui/layout/page/components/PageHeader.tsx +++ b/packages/twenty-front/src/modules/ui/layout/page/components/PageHeader.tsx @@ -31,7 +31,7 @@ const StyledTopBarContainer = styled.div<{ width?: number }>` padding: ${({ theme }) => theme.spacing(2)}; padding-left: 0; padding-right: ${({ theme }) => theme.spacing(3)}; - width: ${({ width }) => width + 'px' || '100%'}; + width: ${({ width }) => (width ? `${width}px` : '100%')}; @media (max-width: ${MOBILE_VIEWPORT}px) { width: 100%;