@@ -18,13 +18,17 @@ function App() {
1818 const onSuccess = res => {
1919 console . log ( "Success" ) ;
2020 console . log ( res ) ;
21- setUploadedImageSource ( res . url ) ;
21+ setUploadedImageSource ( res . url ) ;
2222 } ;
2323
2424 const [ uploadedImageSource , setUploadedImageSource ] = useState ( ) ;
2525 const [ imageTr , setImageTr ] = useState ( [ {
26- "height" : "200" ,
27- "width" : "200"
26+ "height" : "200" ,
27+ "width" : "200"
28+ } ] ) ;
29+ const [ imageTrSansIKContext , setImageTrSansIKContext ] = useState ( [ {
30+ "height" : "300" ,
31+ "width" : "300"
2832 } ] ) ;
2933
3034 return (
@@ -34,25 +38,56 @@ function App() {
3438 < p > Directly using < code > IkImage</ code > </ p >
3539 < IKImage urlEndpoint = { urlEndpoint } src = { src } />
3640
41+ < p > Dynamic transformation update directly using IKImage</ p >
42+ < IKImage
43+ publicKey = { publicKey }
44+ urlEndpoint = { urlEndpoint }
45+ authenticationEndpoint = { authenticationEndpoint }
46+ className = { 'img-transformation-direct' }
47+ path = { path }
48+ transformation = { imageTrSansIKContext }
49+ />
50+ < div >
51+ < p > Click here to apply transformations on the above image</ p >
52+ < button
53+ className = { 'btn-to-change-tr-direct' }
54+ onClick = { ( ) => setImageTrSansIKContext ( [ {
55+ "height" : "200" ,
56+ "width" : "600" ,
57+ "radius" : "max" ,
58+ } , {
59+ "height" : "200" ,
60+ "width" : "200" ,
61+ "rotate" : 180 ,
62+ } , {
63+ "ot" : "TEST" ,
64+ "oy" : 50 ,
65+ "ox" : 100 ,
66+ "otc" : "10C0F0"
67+ } ] ) }
68+ > Click to apply transformations</ button >
69+ </ div >
70+ < br />
71+
3772 < p > Using context < code > IKContext</ code > </ p >
3873 < IKContext publicKey = { publicKey } urlEndpoint = { urlEndpoint } authenticationEndpoint = { authenticationEndpoint } >
3974 < p > Let's add an Image</ p >
4075 < IKImage src = { src } />
4176
4277 < p > Transformation - height and width manipulation</ p >
4378 < IKImage className = { 'img-transformation' } path = { path } transformation = { imageTr } />
44- < div >
45- < p > Click here to apply max radius on above image </ p >
46- < button
47- className = { 'btn-to-change-tr' }
48- onClick = { ( ) => setImageTr ( [ {
49- "height" : "200" ,
50- "width" : "200" ,
51- "radius" : "max"
52- } ] ) }
53- > Click to apply radius</ button >
54- </ div >
55- < br />
79+ < div >
80+ < p > Click here to apply max radius on above image </ p >
81+ < button
82+ className = { 'btn-to-change-tr' }
83+ onClick = { ( ) => setImageTr ( [ {
84+ "height" : "200" ,
85+ "width" : "200" ,
86+ "radius" : "max"
87+ } ] ) }
88+ > Click to apply radius</ button >
89+ </ div >
90+ < br />
5691 < p > Chained transformation</ p >
5792 < IKImage path = { path } transformation = { [ {
5893 "height" : "200" ,
@@ -75,7 +110,7 @@ function App() {
75110
76111 < p > Progressive image loading wihtout lazy loading</ p >
77112 < IKImage
78- className = { 'lqip' }
113+ className = { 'lqip' }
79114 path = { path }
80115 transformation = { [ {
81116 "height" : "200" ,
@@ -88,7 +123,7 @@ function App() {
88123
89124 < p > Progressive image loading with lazy loading</ p >
90125 < IKImage
91- className = { 'lazyload-lqip' }
126+ className = { 'lazyload-lqip' }
92127 path = { path }
93128 transformation = { [ {
94129 "height" : "200" ,
@@ -98,13 +133,6 @@ function App() {
98133 lqip = { { active : true , quality : 20 , blur : 30 } }
99134 />
100135
101-
102- < p > File upload - To use this funtionality please remember to setup the server</ p >
103- < IKUpload
104- onError = { onError }
105- onSuccess = { onSuccess }
106- />
107-
108136 < p > File upload along with upload API options - To use this funtionality please remember to setup the server</ p >
109137 < IKUpload
110138 fileName = "test.jpg"
@@ -117,8 +145,8 @@ function App() {
117145 onError = { onError } onSuccess = { onSuccess }
118146 />
119147
120- < p > Your above uploaded file will appear here </ p >
121- < IKImage urlEndpoint = { urlEndpoint } src = { uploadedImageSource } />
148+ < p > Your above uploaded file will appear here </ p >
149+ < IKImage urlEndpoint = { urlEndpoint } src = { uploadedImageSource } />
122150 </ IKContext >
123151 </ div >
124152 ) ;
0 commit comments