@@ -44,15 +44,13 @@ let header = (~onBack=?, ~title, ()) =>
4444 <View style= styles##headerCenter>
4545 <Text style= styles##title> {ReasonReact . string(title)} </Text >
4646 </View >
47- {
48- switch (onBack) {
49- | None => ReasonReact . null
50- | Some (onBack ) =>
51- <View style= styles##headerLeft>
52- <Button title= "Back" onPress= onBack />
53- </View >
54- }
55- }
47+ {switch (onBack) {
48+ | None => ReasonReact . null
49+ | Some (onBack ) =>
50+ <View style= styles##headerLeft>
51+ <Button title= "Back" onPress= onBack />
52+ </View >
53+ }}
5654 </View >;
5755
5856type action =
@@ -89,40 +87,35 @@ let make = _children => {
8987 render: ({state, send}) => {
9088 let components = ExampleList . components;
9189 <SafeAreaView style= styles##appContainer>
92- {
93- switch (state. currentExample) {
94- | None =>
95- <View style= styles##exampleContainer>
96- {header(~title= "ReasonRNTester" , () )}
97- <RNTesterExampleList
98- components
99- onPress= (
100- item =>
101- switch (state. currentExample) {
102- | None => send(ChangeCurrentExample (Some (item)))
103- | Some (_ ) => send(ChangeCurrentExample (None ))
104- }
105- )
106- />
107- </View >
108- | Some (example ) when example. exampleType === FullScreen =>
109- example. examples[ 0 ] .render()
110- | Some (example ) =>
111- <View style= styles##exampleContainer>
112- {
113- header(
114- ~title= example. title,
115- ~onBack= _event => send(ChangeCurrentExample (None )),
116- () ,
117- )
118- }
119- <RNTesterExampleContainer example />
120- </View >
121- }
122- }
90+ {switch (state. currentExample) {
91+ | None =>
92+ <View style= styles##exampleContainer>
93+ {header(~title= "ReasonRNTester" , () )}
94+ <RNTesterExampleList
95+ components
96+ onPress= {item =>
97+ switch (state. currentExample) {
98+ | None => send(ChangeCurrentExample (Some (item)))
99+ | Some (_ ) => send(ChangeCurrentExample (None ))
100+ }
101+ }
102+ />
103+ </View >
104+ | Some (example ) when example. exampleType === FullScreen =>
105+ example. examples[ 0 ] .render()
106+ | Some (example ) =>
107+ <View style= styles##exampleContainer>
108+ {header(
109+ ~title= example. title,
110+ ~onBack= _event => send(ChangeCurrentExample (None )),
111+ () ,
112+ )}
113+ <RNTesterExampleContainer example />
114+ </View >
115+ }}
123116 </SafeAreaView >;
124117 },
125118};
126119
127- let reactClass =
120+ let reactComponentForJs =
128121 ReasonReact . wrapReasonForJs(~component, _jsProps => make([||] ));
0 commit comments