editing story to pull in react component instead of string

This commit is contained in:
Alex Windett 2017-01-20 14:47:29 +00:00
parent e7905322a5
commit 3b6817640f
2 changed files with 17 additions and 16 deletions

View File

@ -7,35 +7,36 @@ const {
const Table = require('./'); const Table = require('./');
const memberDetail = (name) => {
return (
<div>
<h4>{name}</h4>
<small>{name}@biztech.com</small>
</div>
);
};
const columns = [{ const columns = [{
title: 'Memeber', title: 'Memeber',
dataID: 'member', width: '50%'
dataKey: 'member',
width: ''
}, { }, {
title: 'Status', title: 'Status',
dataID: 'status', width: '10%'
dataKey: 'status',
width: ''
}, { }, {
title: 'Role', title: 'Role',
dataID: 'role', width: '20%'
dataKey: 'role',
width: ''
}, { }, {
title: '', title: '',
dataID: 'delete', width: '20%'
dataKey: 'delete',
width: ''
}]; }];
const data = [{ const data = [{
name: 'Nicola', name: memberDetail('Nicola'),
status: 'Active', status: 'Active',
role: 'Owner', role: 'Owner',
key: 1 key: 1
}, { }, {
name: 'Alex', name: memberDetail('Alex'),
status: 'Inactive', status: 'Inactive',
role: 'Read Only', role: 'Read Only',
key: 2 key: 2

View File

@ -15,7 +15,7 @@ const StyledRow = styled.tr`
border: solid ${remcalc(1)} #d8d8d8; border: solid ${remcalc(1)} #d8d8d8;
`; `;
const StyledTaleItem = styled.td` const StyledTableItem = styled.td`
padding: ${remcalc(24)}; padding: ${remcalc(24)};
`; `;
@ -27,7 +27,7 @@ const Row = ({
const rowItems = Object.keys(_dataItem).map( (item, i) => { const rowItems = Object.keys(_dataItem).map( (item, i) => {
const value = _dataItem[item]; const value = _dataItem[item];
return <StyledTaleItem key={i}>{value}</StyledTaleItem>; return <StyledTableItem key={i}>{value}</StyledTableItem>;
}); });
return ( return (