This repository has been archived by the owner on Nov 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Admin.re
54 lines (50 loc) · 1.57 KB
/
Admin.re
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
open Rebolt;
let component = ReasonReact.statelessComponent("Admin");
module Styles = {
open Style;
let container =
style([flex(1.), justifyContent(Center), alignItems(Center)]);
let button = color =>
style([
flex(1.),
justifyContent(Center),
paddingHorizontal(Pt(20.)),
maxHeight(Pt(40.)),
marginTop(Pt(16.)),
backgroundColor(String(color)),
borderRadius(20.),
width(Pt(100.)),
]);
let buttonText = style([textAlign(Center)]);
let title = style([fontSize(Float(20.))]);
};
let renderButtons = (nav: NavigationConfig.StackNavigator.navigation) =>
<View>
<TouchableOpacity
style=(Styles.button("#4cd964"))
onPress=(_e => nav.push(NavigationConfig.Config.Home))>
<Text style=Styles.buttonText> (ReasonReact.string("Push")) </Text>
</TouchableOpacity>
<TouchableOpacity
style=(Styles.button("#ff9500")) onPress=(_e => nav.pop())>
<Text style=Styles.buttonText> (ReasonReact.string("Pop")) </Text>
</TouchableOpacity>
</View>;
let make = (~navigation, _children) => {
...component,
render: _self =>
<NavigationConfig.StackNavigator.Screen
headerTitle="Admindkasldkasldkdasdas"
navigation
headerStyle=Style.(style([backgroundColor(String("#FFF"))]))>
...(
() =>
<View style=Styles.container>
<Text style=Styles.title>
(ReasonReact.string("Admin screen"))
</Text>
(renderButtons(navigation))
</View>
)
</NavigationConfig.StackNavigator.Screen>,
};