Skip to content

Commit

Permalink
Change props spreading pattern from ...rest to ...otherProps on T…
Browse files Browse the repository at this point in the history
…able components
  • Loading branch information
victorhmp committed Oct 18, 2021
1 parent 6a26200 commit 35a85ac
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/store-ui/src/molecules/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export interface TableProps extends HTMLAttributes<HTMLTableElement> {
}

const Table = forwardRef<HTMLTableElement, TableProps>(function Table(
{ testId = 'store-table', children, ...rest },
{ testId = 'store-table', children, ...otherProps },
ref
) {
return (
<table ref={ref} data-store-table data-testid={testId} {...rest}>
<table ref={ref} data-store-table data-testid={testId} {...otherProps}>
{children}
</table>
)
Expand Down
12 changes: 10 additions & 2 deletions packages/store-ui/src/molecules/Table/TableBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@ export interface TableBodyProps
}

const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(
function TableBody({ children, testId = 'store-table-body', ...rest }, ref) {
function TableBody(
{ children, testId = 'store-table-body', ...otherProps },
ref
) {
return (
<tbody ref={ref} data-testid={testId} data-store-table-body {...rest}>
<tbody
ref={ref}
data-testid={testId}
data-store-table-body
{...otherProps}
>
{children}
</tbody>
)
Expand Down
10 changes: 8 additions & 2 deletions packages/store-ui/src/molecules/Table/TableCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ export interface TableCellProps extends HTMLAttributes<HTMLTableCellElement> {

const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(
function TableCell(
{ testId = 'store-table-cell', children, variant = 'data', scope, ...rest },
{
testId = 'store-table-cell',
children,
variant = 'data',
scope,
...otherProps
},
ref
) {
const Cell = variant === 'header' ? 'th' : 'td'
Expand All @@ -32,7 +38,7 @@ const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(
data-store-table-cell={variant}
data-testid={testId}
scope={scope}
{...rest}
{...otherProps}
>
{children}
</Cell>
Expand Down
9 changes: 7 additions & 2 deletions packages/store-ui/src/molecules/Table/TableFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ export interface TableFooterProps

const TableFooter = forwardRef<HTMLTableSectionElement, TableFooterProps>(
function TableFooter(
{ children, testId = 'store-table-footer', ...rest },
{ children, testId = 'store-table-footer', ...otherProps },
ref
) {
return (
<tfoot ref={ref} data-testid={testId} data-store-table-footer {...rest}>
<tfoot
ref={ref}
data-testid={testId}
data-store-table-footer
{...otherProps}
>
{children}
</tfoot>
)
Expand Down
12 changes: 10 additions & 2 deletions packages/store-ui/src/molecules/Table/TableHead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@ export interface TableHeadProps
}

const TableHead = forwardRef<HTMLTableSectionElement, TableHeadProps>(
function TableHead({ children, testId = 'store-table-head', ...rest }, ref) {
function TableHead(
{ children, testId = 'store-table-head', ...otherProps },
ref
) {
return (
<thead ref={ref} data-testid={testId} data-store-table-head {...rest}>
<thead
ref={ref}
data-testid={testId}
data-store-table-head
{...otherProps}
>
{children}
</thead>
)
Expand Down
7 changes: 5 additions & 2 deletions packages/store-ui/src/molecules/Table/TableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ export interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
}

const TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(
function TableRow({ testId = 'store-table-row', children, ...rest }, ref) {
function TableRow(
{ testId = 'store-table-row', children, ...otherProps },
ref
) {
return (
<tr ref={ref} data-store-table-row data-testid={testId} {...rest}>
<tr ref={ref} data-store-table-row data-testid={testId} {...otherProps}>
{children}
</tr>
)
Expand Down

0 comments on commit 35a85ac

Please sign in to comment.