-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* TableCell shorthand * TableRow shorthand * Table shorthand * Add example to test table shorthand
- Loading branch information
Showing
6 changed files
with
158 additions
and
7 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
docs/app/Examples/collections/Table/States/TableWarningShorthand.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react' | ||
import { Icon, Table } from 'stardust' | ||
|
||
const headerRow = [ | ||
'Name', | ||
'Status', | ||
'Notes', | ||
] | ||
|
||
const bodyRow = ({ name, status, notes }) => ({ | ||
warning: !!(status && status.match('Requires Action')), | ||
items: [ | ||
name || 'No name specified', | ||
status | ||
? { icon: 'attention', content: status } | ||
: 'Unknown', | ||
notes | ||
? { icon: 'attention', content: notes, warning: true } | ||
: 'None', | ||
] | ||
}) | ||
|
||
const tableData = [ | ||
{ name: undefined, status: undefined, notes: undefined }, | ||
{ name: 'Jimmy', status: 'Requires Action', notes: undefined }, | ||
{ name: 'Jamie', status: undefined, notes: 'Hostile' }, | ||
{ name: 'Jill', status: undefined, notes: undefined }, | ||
] | ||
|
||
const TableWarningShorthand = () => { | ||
return ( | ||
<Table celled headerRow={headerRow} bodyRow={bodyRow} tableData={tableData} /> | ||
) | ||
} | ||
|
||
export default TableWarningShorthand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters