@@ -97,7 +97,7 @@ const withFullscreenBordered = (fn: RenderFunction) => (
9797 < FullscreenBordered > { fn ( ) } </ FullscreenBordered >
9898) ;
9999
100- const ColumnBordered = makeBorderedContainer ( 'Column' , Column , 'yellow ' ) ;
100+ const ColumnBordered = makeBorderedContainer ( 'Column' , Column , 'purple ' ) ;
101101
102102const withColumnBordered = ( fn : RenderFunction ) => (
103103 < ColumnBordered
@@ -189,4 +189,40 @@ storiesOf('components/flex', module)
189189 )
190190 . add ( 'MaxWidth > Row' , ( ) =>
191191 withMaxWidthBordered ( repeat ( 'Row' , ( ) => withRowBordered ( makeContent ) ) )
192- ) ;
192+ )
193+ . add ( 'Playground \uD83D\uDE80' , ( ) => {
194+ let decorators = [ ] ;
195+ let current = null ;
196+
197+ do {
198+ current = select (
199+ `Component ${ decorators . length } ` ,
200+ [ 'Fullscreen' , 'MaxWidth' , 'Centered' , 'Row' , 'Column' , null ] ,
201+ null ,
202+ 'structure'
203+ ) ;
204+
205+ switch ( current ) {
206+ case 'Fullscreen' :
207+ decorators . push ( withFullscreenBordered ) ;
208+ break ;
209+ case 'MaxWidth' :
210+ decorators . push ( withMaxWidthBordered ) ;
211+ break ;
212+ case 'Centered' :
213+ decorators . push ( withCenteredBordered ) ;
214+ break ;
215+ case 'Row' :
216+ decorators . push ( withRowBordered ) ;
217+ break ;
218+ case 'Column' :
219+ decorators . push ( withColumnBordered ) ;
220+ break ;
221+ }
222+ } while ( current ) ;
223+
224+ return decorators . reduceRight (
225+ ( last , decorator , i ) => repeat ( `Component ${ i } ` , ( ) => decorator ( last ) ) ,
226+ makeContent
227+ ) ( ) ;
228+ } ) ;
0 commit comments