Update the frontend to adhere to the custom eslint rule twenty/no-spread-props (#1958)
* Update the frontend to adhere to the custom eslint rule `twenty/no-spread-props` Co-authored-by: v1b3m <vibenjamin6@gmail.com> * Update the frontend to adhere to the custom eslint rule `twenty/no-spread-props` Co-authored-by: v1b3m <vibenjamin6@gmail.com> * resolve bug with data-testid --------- Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
export type HeadingProps = React.ComponentProps<'div'> & {
|
||||
export type HeadingProps = {
|
||||
title: string;
|
||||
description?: string;
|
||||
};
|
||||
@ -27,9 +27,8 @@ const StyledDescription = styled.span`
|
||||
text-align: center;
|
||||
`;
|
||||
|
||||
export const Heading = ({ title, description, ...props }: HeadingProps) => (
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
<StyledContainer {...props}>
|
||||
export const Heading = ({ title, description }: HeadingProps) => (
|
||||
<StyledContainer>
|
||||
<StyledTitle>{title}</StyledTitle>
|
||||
{description && <StyledDescription>{description}</StyledDescription>}
|
||||
</StyledContainer>
|
||||
|
||||
@ -111,11 +111,36 @@ type TableProps<Data> = DataGridProps<Data> & {
|
||||
hiddenHeader?: boolean;
|
||||
};
|
||||
|
||||
export const Table = <Data,>(props: TableProps<Data>) => {
|
||||
export const Table = <Data,>({
|
||||
className,
|
||||
columns,
|
||||
components,
|
||||
headerRowHeight,
|
||||
rowKeyGetter,
|
||||
rows,
|
||||
onRowClick,
|
||||
onRowsChange,
|
||||
onSelectedRowsChange,
|
||||
selectedRows,
|
||||
}: TableProps<Data>) => {
|
||||
const { rtl } = useSpreadsheetImportInternal();
|
||||
|
||||
return (
|
||||
// eslint-disable-next-line twenty/no-spread-props
|
||||
<StyledDataGrid direction={rtl ? 'rtl' : 'ltr'} rowHeight={52} {...props} />
|
||||
<StyledDataGrid
|
||||
direction={rtl ? 'rtl' : 'ltr'}
|
||||
rowHeight={52}
|
||||
{...{
|
||||
className,
|
||||
columns,
|
||||
components,
|
||||
headerRowHeight,
|
||||
rowKeyGetter,
|
||||
rows,
|
||||
onRowClick,
|
||||
onRowsChange,
|
||||
onSelectedRowsChange,
|
||||
selectedRows,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user