From 5a66271b41dd1fd901c508289aad5e5ec63adb5d Mon Sep 17 00:00:00 2001 From: Alexander Fedyashov Date: Mon, 3 Oct 2016 11:04:32 +0300 Subject: [PATCH 1/2] docs(Table): add `attached` example --- .../Table/Variations/TableExampleAttached.js | 104 ++++++++++++++++++ .../collections/Table/Variations/index.js | 6 + test/specs/collections/Table/Table-test.js | 1 + 3 files changed, 111 insertions(+) create mode 100644 docs/app/Examples/collections/Table/Variations/TableExampleAttached.js diff --git a/docs/app/Examples/collections/Table/Variations/TableExampleAttached.js b/docs/app/Examples/collections/Table/Variations/TableExampleAttached.js new file mode 100644 index 0000000000..d3f1243c0e --- /dev/null +++ b/docs/app/Examples/collections/Table/Variations/TableExampleAttached.js @@ -0,0 +1,104 @@ +import React from 'react' +import { Table } from 'stardust' + +const TableCelled = () => { + return ( +
+ + + + Header + Header + Header + + + + + Cell + Cell + Cell + + + Cell + Cell + Cell + + + Cell + Cell + Cell + + +
+ + + + + Cell + Cell + Cell + + + Cell + Cell + Cell + + + Cell + Cell + Cell + + +
+ + + + + Cell + Cell + Cell + + + Cell + Cell + Cell + + + Cell + Cell + Cell + + +
+ + + + + Header + Header + Header + + + + + Cell + Cell + Cell + + + Cell + Cell + Cell + + + Cell + Cell + Cell + + +
+
+ ) +} + +export default TableCelled diff --git a/docs/app/Examples/collections/Table/Variations/index.js b/docs/app/Examples/collections/Table/Variations/index.js index 27ddcd300d..dc2d58d576 100644 --- a/docs/app/Examples/collections/Table/Variations/index.js +++ b/docs/app/Examples/collections/Table/Variations/index.js @@ -12,6 +12,12 @@ const Variations = () => { examplePath='collections/Table/Variations/TableSingleLine' /> + + { common.propKeyOnlyToClassName(Table, 'structured') common.propKeyOnlyToClassName(Table, 'unstackable') + common.propKeyOrValueAndKeyToClassName(Table, 'attached') common.propKeyOrValueAndKeyToClassName(Table, 'basic') common.propKeyOrValueAndKeyToClassName(Table, 'compact') common.propKeyOrValueAndKeyToClassName(Table, 'padded') From 3c541f2918441aef84b7df809281d1b4e2437c13 Mon Sep 17 00:00:00 2001 From: Levi Thomason Date: Mon, 3 Oct 2016 09:24:37 -0700 Subject: [PATCH 2/2] refactor(TableExampleAttached): fix export and reduce LOC --- .../Table/Variations/TableExampleAttached.js | 132 +++++------------- 1 file changed, 35 insertions(+), 97 deletions(-) diff --git a/docs/app/Examples/collections/Table/Variations/TableExampleAttached.js b/docs/app/Examples/collections/Table/Variations/TableExampleAttached.js index d3f1243c0e..66a85c59a5 100644 --- a/docs/app/Examples/collections/Table/Variations/TableExampleAttached.js +++ b/docs/app/Examples/collections/Table/Variations/TableExampleAttached.js @@ -1,104 +1,42 @@ import React from 'react' import { Table } from 'stardust' -const TableCelled = () => { - return ( -
- - - - Header - Header - Header - - - - - Cell - Cell - Cell - - - Cell - Cell - Cell - - - Cell - Cell - Cell - - -
+const header = ( + + + Header + Header + Header + + +) +const body = ( + + + Cell + Cell + Cell + + +) - - - - Cell - Cell - Cell - - - Cell - Cell - Cell - - - Cell - Cell - Cell - - -
+const TableExampleAttached = () => ( +
+ {header}{body}
- - - - Cell - Cell - Cell - - - Cell - Cell - Cell - - - Cell - Cell - Cell - - -
+ + {body} +
- - - - Header - Header - Header - - - - - Cell - Cell - Cell - - - Cell - Cell - Cell - - - Cell - Cell - Cell - - -
-
- ) -} + + {body} +
-export default TableCelled + + {header} + {body} +
+
+) + +export default TableExampleAttached