@@ -30,86 +30,78 @@ module ImageExample = {
3030 render: self =>
3131 <View >
3232 <Button
33- onPress= {
34- () => {
35- ImageStore . hasImageForTag(
36- switch (self. state. imageUri) {
37- | Some (x ) => x
38- | None => ""
39- },
40- has =>
41- Alert . alert(
42- ~title= "Does store have image?" ,
43- ~message= has ? "Yes :)" : "No :(" ,
44- () ,
45- )
46- );
47- () ;
48- }
49- }
33+ onPress= {() => {
34+ ImageStore . hasImageForTag(
35+ switch (self. state. imageUri) {
36+ | Some (x ) => x
37+ | None => ""
38+ },
39+ has =>
40+ Alert . alert(
41+ ~title= "Does store have image?" ,
42+ ~message= has ? "Yes :)" : "No :(" ,
43+ () ,
44+ )
45+ );
46+ () ;
47+ }}
5048 title= "Has Image For Tag"
5149 accessibilityLabel= "Has Image For Tag"
5250 />
5351 <Button
54- onPress= {
55- () => {
56- ImageStore . addImageFromBase64(
57- image,
58- uri => self. send(SetImageUri (uri)),
59- _ => () ,
60- )
61- |> ignore ;
62- () ;
63- }
64- }
52+ onPress= {() => {
53+ ImageStore . addImageFromBase64(
54+ image,
55+ uri => self. send(SetImageUri (uri)),
56+ _ => () ,
57+ )
58+ |> ignore ;
59+ () ;
60+ }}
6561 title= "Set Image Uri"
6662 accessibilityLabel= "Set image uri"
6763 />
6864 <Button
69- onPress= {
70- () =>
71- switch (self. state. imageUri) {
72- | Some (uri ) => ImageStore . removeImageForTag(uri)
73- | None => ()
74- }
65+ onPress= {() =>
66+ switch (self. state. imageUri) {
67+ | Some (uri ) => ImageStore . removeImageForTag(uri)
68+ | None => ()
69+ }
7570 }
7671 title= "Remove Image For Tag"
7772 accessibilityLabel= "Remove Image For Tag"
7873 />
7974 <Button
80- onPress= {
81- () =>
82- switch (self. state. imageUri) {
83- | Some (uri ) =>
84- ImageStore . getBase64ForTag(
85- uri,
86- base64 => Alert . alert(~title= base64, () ),
87- _ => () ,
88- )
89- | None => ()
90- }
75+ onPress= {() =>
76+ switch (self. state. imageUri) {
77+ | Some (uri ) =>
78+ ImageStore . getBase64ForTag(
79+ uri,
80+ base64 => Alert . alert(~title= base64, () ),
81+ _ => () ,
82+ )
83+ | None => ()
84+ }
9185 }
9286 title= "Get Base64 For Tag"
9387 accessibilityLabel= "Get Base64 For Tag"
9488 />
95- {
96- switch (self. state. imageUri) {
97- | Some (imageUri ) =>
98- <Image
99- source= {
100- ` URI (
101- Image . imageURISource(
102- ~uri= imageUri,
103- ~width= Pt (200 . ),
104- ~height= Pt (200 . ),
105- () ,
106- ),
107- )
108- }
109- />
110- | None => ReasonReact . null
111- }
112- }
89+ {switch (self. state. imageUri) {
90+ | Some (imageUri ) =>
91+ <Image
92+ source= {
93+ ` URI (
94+ Image . imageURISource(
95+ ~uri= imageUri,
96+ ~width= Pt (200 . ),
97+ ~height= Pt (200 . ),
98+ () ,
99+ ),
100+ )
101+ }
102+ />
103+ | None => ReasonReact . null
104+ }}
113105 </View >,
114106 };
115107};
0 commit comments