Skip to content

Commit

Permalink
fix table (#117)
Browse files Browse the repository at this point in the history
- will return empty `td` for conditionally rendering cells.
  • Loading branch information
jay-deshmukh authored Apr 15, 2020
1 parent 31aeadd commit a8d5d35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
12 changes: 1 addition & 11 deletions src/components/Table/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,7 @@ export const config = {
date: {
value: '01/01/2019',
},
delete_btn: {
props: {
theme: 'danger',
size: 'sm',
onClick: () => console.log('Delete Btn Click'),
},
children: 'Delete',
events: {
onClick: () => console.log('Clicked the cell'),
},
},
delete_btn: null,
input_test: {
props: {
type: 'number',
Expand Down
4 changes: 4 additions & 0 deletions src/components/Table/js/cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import React from 'react';
import PropTypes from 'prop-types';

export const Cell = ({ col, row }) => {
if (!row.values[col.id]) {
return <td />;
}

if (col.type === 'string') {
return (
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
Expand Down

0 comments on commit a8d5d35

Please sign in to comment.