@@ -6,65 +6,82 @@ import CloudinaryContext from '../src/components/CloudinaryContext';
66import cloudinary from 'cloudinary-core' ;
77
88storiesOf ( 'Image' , module )
9- . add ( 'image' , ( ) => {
9+ . addWithInfo ( 'image' , "Basic tag" , ( ) => {
1010 let t = { width : 0.5 , crop : "scale" } ;
1111 return (
1212 < Image cloudName = "demo" publicId = "sample" transformation = { t } />
1313 ) } )
14- . add ( 'image with alt' , ( ) => {
14+ . addWithInfo ( 'image with alt' , "Demostrate using an img tag attribute" , ( ) => {
1515 let t = { width : 0.5 , crop : "scale" } ;
1616 return (
1717 < Image cloudName = "demo" publicId = "does-not-exist" alt = "This image is intentionally missing" transformation = { t } />
1818 )
1919 } )
20- . add ( 'image with html attributes' , ( ) => {
20+ . addWithInfo ( 'image with html attributes' , 'image with html attributes' , ( ) => {
2121 return (
2222 < Image cloudName = "demo" publicId = "sample" html_width = "100" />
2323 )
2424 } )
25- . add ( 'image with style' , ( ) => {
25+ . addWithInfo ( 'image with style' , 'image with style' , ( ) => {
2626 let t = { width : 0.5 , crop : "scale" } ;
2727 return (
28- < Image cloudName = "demo" publicId = "sample" style = { { border : "20px solid" } } transformation = { t } />
28+ < Image cloudName = "demo" publicId = "sample" style = { { border : "20px solid" } } />
29+ )
30+ } ) . addWithInfo ( 'image with chained transformation' , 'image with chained transformation' , ( ) => {
31+ let t = { width : 0.5 , crop : "scale" } ;
32+ return ( < div >
33+ < Image cloudName = "demo" publicId = "sample" width = "100" crop = "scale" angle = "10" transformation = { [ { width :100 , crop :"crop" } , { width :100 , angle : - 10 , crop : "scale" } ] } />
34+ < Image cloudName = "demo" publicId = "sample" width = "100" crop = "scale" angle = "10" />
35+ </ div >
36+ )
37+ } ) . addWithInfo ( 'image with chained transformation' , 'image with chained transformation' , ( ) => {
38+ let t = { width : 0.5 , crop : "scale" } ;
39+ return ( < div >
40+ < Image cloudName = "demo" publicId = "sample" width = "100" crop = "scale" angle = "10" >
41+ < Transformation width = "100" crop = "scale" angle = "10" />
42+ < Transformation width = "100" crop = "scale" angle = "10" />
43+ </ Image >
44+ < Image cloudName = "demo" publicId = "sample" width = "100" crop = "scale" angle = "10" />
45+ </ div >
2946 )
3047 } ) ;
3148storiesOf ( 'Video' , module )
32- . add ( 'Simple tag' , ( ) => {
49+ . addWithInfo ( 'Simple tag' , 'Simple tag' , ( ) => {
3350 return (
3451 < Video cloudName = "demo" controls publicId = "dog" />
3552 )
36- } ) . add ( 'With fallback' , ( ) => {
53+ } ) . addWithInfo ( 'With fallback' , 'With fallback' , ( ) => {
3754 return (
3855 < Video cloudName = "demo" controls = "controls" publicId = "dog" fallback = "Cannot display video" />
3956 )
40- } ) . add ( 'With inline fallback' , ( ) => {
57+ } ) . addWithInfo ( 'With inline fallback' , 'With inline fallback' , ( ) => {
4158 return (
4259 < Video cloudName = "demo" controls = "controls" publicId = "dog" >
4360 Cannot display < b > video</ b > .
4461 </ Video >
4562 )
46- } ) . add ( 'With source types' , ( ) => {
63+ } ) . addWithInfo ( 'With source types' , 'With source types' , ( ) => {
4764 return (
4865 < Video cloudName = "demo" controls = "controls" publicId = "dog" sourceTypes = { [ 'webm' , 'ogv' , 'mp4' ] } >
4966 Cannot display video.
5067 </ Video >
5168 )
52- } ) . add ( 'Simple tag with width' , ( ) => {
69+ } ) . addWithInfo ( 'Simple tag with width' , 'Simple tag with width' , ( ) => {
5370 return (
5471 < Video cloudName = "demo" controls publicId = "dog" width = "300" crop = "scale" />
5572 )
56- } ) . add ( 'Simple tag with poster url' , ( ) => {
73+ } ) . addWithInfo ( 'Simple tag with poster url' , 'Simple tag with poster url' , ( ) => {
5774 let url = cloudinary . Cloudinary . new ( { cloud_name : "demo" } ) . url ( "sample" , { width :300 , crop : "scale" } ) ;
5875 return (
5976 < Video cloudName = "demo" controls publicId = "dog" width = "300" crop = "scale" poster = { url } />
6077 )
61- } ) . add ( 'Simple tag with poster object' , ( ) => {
78+ } ) . addWithInfo ( 'Simple tag with poster object' , 'Simple tag with poster object' , ( ) => {
6279 return (
6380 < Video cloudName = "demo" controls publicId = "dog" width = "300" crop = "scale" poster = { { publicId : "sample" } } />
6481 )
6582 } ) ;
6683storiesOf ( 'CloudinaryContext' , module )
67- . add ( 'CloudinaryContext' , ( ) => {
84+ . addWithInfo ( 'CloudinaryContext' , 'CloudinaryContext' , ( ) => {
6885 let t = { width : 0.5 , crop : "scale" } ;
6986 return (
7087 < CloudinaryContext cloudName = "demo" >
@@ -75,7 +92,7 @@ storiesOf('CloudinaryContext', module)
7592 < Image publicId = "sample" transformation = { t } />
7693 </ CloudinaryContext >
7794 ) } )
78- . add ( 'Nested Context' , ( ) => {
95+ . addWithInfo ( 'Nested Context' , 'Nested Context' , ( ) => {
7996 return (
8097 < CloudinaryContext cloudName = "demo" width = "50" crop = "scale" >
8198 < Image publicId = "sample" />
0 commit comments