From 6e9331981df28bdf163ba54f7744d157246a1eb1 Mon Sep 17 00:00:00 2001 From: igorbt Date: Thu, 22 Oct 2015 07:33:24 +0300 Subject: [PATCH 1/2] adding back grid-list code examples --- .../components/pages/components/grid-list.jsx | 108 ++++++------------ .../components/raw-code/grid-list-code.txt | 32 ++++++ 2 files changed, 70 insertions(+), 70 deletions(-) create mode 100644 docs/src/app/components/raw-code/grid-list-code.txt diff --git a/docs/src/app/components/pages/components/grid-list.jsx b/docs/src/app/components/pages/components/grid-list.jsx index 4c42eb526a753a..edd1029abc0421 100644 --- a/docs/src/app/components/pages/components/grid-list.jsx +++ b/docs/src/app/components/pages/components/grid-list.jsx @@ -5,48 +5,14 @@ let StarBorder = require('svg-icons/toggle/star-border'); let IconButton = require('icon-button'); let ComponentDoc = require('../../component-doc'); - +let Code = require('grid-list-code'); +let CodeExample = require('../../code-example/code-example'); class GridListPage extends React.Component { constructor(props) { super(props); - this.code = ` -{/* Basic grid list with mostly default options */} - - { - tilesData.map(tile => by {tile.author}} - actionIcon={} - >) - } - -{/* Grid list with all possible overrides */} - - { - tilesData.map(tile => } - actionPosition="left" - titlePosition="top" - titleBackground={gradientBg} - cols={tile.featured ? 2 : 1} - rows={tile.featured ? 2 : 1} - >) - } - - `; - this.desc =

Simple flex-box based Grid List implementation. Support tiles with arbitrary cell size, @@ -207,40 +173,42 @@ class GridListPage extends React.Component { code={this.code} desc={this.desc} componentInfo={this.componentInfo}> -

- {/* Basic grid list with mostly default options */} - - { - tilesData.map(tile => by {tile.author}} - actionIcon={} - >) - } - - {/* Grid list with all possible overrides */} - - { - tilesData.map(tile => } - actionPosition="left" - titlePosition="top" - titleBackground={gradientBg} - cols={tile.featured ? 2 : 1} - rows={tile.featured ? 2 : 1} - >) - } - -
+ +
+ {/* Basic grid list with mostly default options */} + + { + tilesData.map(tile => by {tile.author}} + actionIcon={} + >) + } + + {/* Grid list with all possible overrides */} + + { + tilesData.map(tile => } + actionPosition="left" + titlePosition="top" + titleBackground={gradientBg} + cols={tile.featured ? 2 : 1} + rows={tile.featured ? 2 : 1} + >) + } + +
+
); } diff --git a/docs/src/app/components/raw-code/grid-list-code.txt b/docs/src/app/components/raw-code/grid-list-code.txt new file mode 100644 index 00000000000000..0fa7b71d181d1f --- /dev/null +++ b/docs/src/app/components/raw-code/grid-list-code.txt @@ -0,0 +1,32 @@ +{/* Basic grid list with mostly default options */} + + { + tilesData.map(tile => by {tile.author}} + actionIcon={} + >) + } + +{/* Grid list with all possible overrides */} + + { + tilesData.map(tile => } + actionPosition="left" + titlePosition="top" + titleBackground={gradientBg} + cols={tile.featured ? 2 : 1} + rows={tile.featured ? 2 : 1} + >) + } + From 8aaa2230b35c144c5d804868c8ef757215ad0bfa Mon Sep 17 00:00:00 2001 From: igorbt Date: Wed, 28 Oct 2015 06:28:43 +0200 Subject: [PATCH 2/2] fixed warning about keys and style --- docs/src/app/components/pages/components/grid-list.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/src/app/components/pages/components/grid-list.jsx b/docs/src/app/components/pages/components/grid-list.jsx index edd1029abc0421..db250fab9834f4 100644 --- a/docs/src/app/components/pages/components/grid-list.jsx +++ b/docs/src/app/components/pages/components/grid-list.jsx @@ -165,7 +165,7 @@ class GridListPage extends React.Component { }, ]; - let gradientBg = 'linear-gradient(to bottom, rgba(0,0,0,0.7) 0%,rgba(0,0,0,0.3) 70%,rgba(0,0,0,0) 100%);'; + let gradientBg = 'linear-gradient(to bottom, rgba(0,0,0,0.7) 0%,rgba(0,0,0,0.3) 70%,rgba(0,0,0,0) 100%)'; return ( { tilesData.map(tile => by {tile.author}} actionIcon={} @@ -197,6 +198,7 @@ class GridListPage extends React.Component { > { tilesData.map(tile => } actionPosition="left"