Skip to content

Commit

Permalink
fix: add layout props to TableHeaderCell and TableCell (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydaf authored Oct 26, 2021
1 parent 3f561d0 commit 0915c58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/components/Table/components/TableCell.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React, { ComponentPropsWithoutRef, FC, useContext } from 'react';
import styled from 'styled-components';
import { compose, textAlign, TextAlignProps } from 'styled-system';
import { compose, LayoutProps, textAlign, TextAlignProps } from 'styled-system';
import { TableContext } from '../context/TableContext';
import { TableProps } from './Table';

type TableCellProps = Pick<TableProps, 'rowSize' | 'columnSpace'> & ComponentPropsWithoutRef<'td'> & TextAlignProps;
type TableCellProps = Pick<TableProps, 'rowSize' | 'columnSpace'> &
ComponentPropsWithoutRef<'td'> &
TextAlignProps &
LayoutProps;

const TableCellElement = styled.td<TableCellProps>`
height: ${p => p.rowSize};
Expand Down
5 changes: 3 additions & 2 deletions src/components/Table/components/TableHeaderCell.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { ComponentPropsWithoutRef, FC, useContext } from 'react';
import styled from 'styled-components';
import { compose, textAlign, TextAlignProps } from 'styled-system';
import { compose, LayoutProps, textAlign, TextAlignProps } from 'styled-system';
import { Colors } from '../../../essentials';
import { theme } from '../../../essentials/theme';
import { get } from '../../../utils/themeGet';
Expand All @@ -9,7 +9,8 @@ import { TableProps } from './Table';

type TableHeaderCellProps = Pick<TableProps, 'rowSize' | 'columnSpace'> &
ComponentPropsWithoutRef<'th'> &
TextAlignProps;
TextAlignProps &
LayoutProps;

const TableHeaderCellElement = styled.th.attrs({ theme })<TableHeaderCellProps>`
border-bottom: 0.0625rem solid ${Colors.AUTHENTIC_BLUE_550} !important;
Expand Down

0 comments on commit 0915c58

Please sign in to comment.