From b01745dba7971f8566af36c0124d50de3c913ab8 Mon Sep 17 00:00:00 2001 From: nitin <142569587+ehconitin@users.noreply.github.com> Date: Mon, 9 Sep 2024 18:52:59 +0530 Subject: [PATCH] Prevent fullWidth from being passed to Link ie (#6893) fixes #6825 --- .../ui/navigation/link/components/UndecoratedLink.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/twenty-front/src/modules/ui/navigation/link/components/UndecoratedLink.tsx b/packages/twenty-front/src/modules/ui/navigation/link/components/UndecoratedLink.tsx index c5c6e2ed15e8..09cae367bacf 100644 --- a/packages/twenty-front/src/modules/ui/navigation/link/components/UndecoratedLink.tsx +++ b/packages/twenty-front/src/modules/ui/navigation/link/components/UndecoratedLink.tsx @@ -1,8 +1,15 @@ import styled from '@emotion/styled'; import React from 'react'; -import { Link } from 'react-router-dom'; +import { Link, LinkProps } from 'react-router-dom'; -const StyledUndecoratedLink = styled(Link)<{ fullWidth: boolean }>` +type StyledLinkProps = LinkProps & { + fullWidth?: boolean; +}; + +const StyledUndecoratedLink = styled( + // eslint-disable-next-line react/jsx-props-no-spreading + ({ fullWidth: _, ...props }: StyledLinkProps) => , +)` text-decoration: none; width: ${({ fullWidth }) => (fullWidth ? '100%' : 'auto')}; `;