Skip to content

Commit 3ac5e00

Browse files
committed
Merge branch 'master' into geolocation-bindings
2 parents 698d5c7 + 32a6f6e commit 3ac5e00

File tree

120 files changed

+1302
-1078
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+1302
-1078
lines changed

RNTester/.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ buck-out/
4949
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
5050
# screenshots whenever they are needed.
5151
# For more information about the recommended setup visit:
52-
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
52+
# https://docs.fastlane.tools/best-practices/source-control/
5353

54-
fastlane/report.xml
55-
fastlane/Preview.html
56-
fastlane/screenshots
54+
*/fastlane/report.xml
55+
*/fastlane/Preview.html
56+
*/fastlane/screenshots

RNTester/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
},
1313
"dependencies": {
1414
"react": "^16.2.0",
15-
"react-native": "^0.52.2"
15+
"react-native": "^0.53.3"
1616
},
1717
"devDependencies": {
18-
"babel-jest": "20.0.0",
19-
"babel-preset-react-native": "1.9.1"
18+
"babel-jest": "22.4.1",
19+
"babel-preset-react-native": "4.0.0"
2020
},
2121
"jest": {
2222
"preset": "react-native"

RNTester/src/RNTesterApp.re

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ let styles =
88
style([
99
height(Pt(60.)),
1010
borderBottomWidth(StyleSheet.hairlineWidth),
11-
borderBottomColor("#96969A"),
12-
backgroundColor("#F5F5F6"),
11+
borderBottomColor(String("#96969A")),
12+
backgroundColor(String("#F5F5F6")),
1313
flexDirection(Row),
14-
paddingTop(Pt(20.))
14+
paddingTop(Pt(20.)),
1515
]),
1616
"headerLeft": style([]),
1717
"headerCenter":
@@ -20,13 +20,17 @@ let styles =
2020
position(Absolute),
2121
top(Pt(27.)),
2222
left(Pt(0.)),
23-
right(Pt(0.))
23+
right(Pt(0.)),
2424
]),
2525
"title":
26-
style([fontSize(Float(19.)), fontWeight(`_600), textAlign(Center)]),
27-
"exampleContainer": style([flex(1.0)])
26+
style([
27+
fontSize(Float(19.)),
28+
fontWeight(`_600),
29+
textAlign(Center),
30+
]),
31+
"exampleContainer": style([flex(1.0)]),
2832
}
29-
)
33+
),
3034
);
3135

3236
let header = (~onBack=?, ~title, ()) =>
@@ -35,7 +39,7 @@ let header = (~onBack=?, ~title, ()) =>
3539
<Text style=styles##title> (ReasonReact.stringToElement(title)) </Text>
3640
</View>
3741
(
38-
switch onBack {
42+
switch (onBack) {
3943
| None => ReasonReact.nullElement
4044
| Some(onBack) =>
4145
<View style=styles##headerLeft>
@@ -56,20 +60,20 @@ let make = _children => {
5660
...component,
5761
initialState: () => {currentExample: None},
5862
reducer: (action, _state) =>
59-
switch action {
63+
switch (action) {
6064
| ChangeCurrentExample(example) => Update({currentExample: example})
6165
},
6266
render: ({state, send}) => {
6367
let components = ExampleList.components;
64-
switch state.currentExample {
68+
switch (state.currentExample) {
6569
| None =>
6670
<View style=styles##exampleContainer>
6771
(header(~title="ReasonRNTester", ()))
6872
<RNTesterExampleList
6973
components
7074
onPress=(
7175
item =>
72-
switch state.currentExample {
76+
switch (state.currentExample) {
7377
| None => send(ChangeCurrentExample(Some(item)))
7478
| Some(_) => send(ChangeCurrentExample(None))
7579
}
@@ -82,14 +86,14 @@ let make = _children => {
8286
header(
8387
~title=example.title,
8488
~onBack=_event => send(ChangeCurrentExample(None)),
85-
()
89+
(),
8690
)
8791
)
8892
<RNTesterExampleContainer example />
8993
</View>
9094
};
91-
}
95+
},
9296
};
9397

9498
let reactClass =
95-
ReasonReact.wrapReasonForJs(~component, _jsProps => make([||]));
99+
ReasonReact.wrapReasonForJs(~component, _jsProps => make([||]));

RNTester/src/RNTesterBlock.re

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,57 @@ let styles =
88
style([
99
borderRadius(3.),
1010
borderWidth(1.),
11-
borderColor("#d6d7da"),
12-
backgroundColor("#ffffff"),
11+
borderColor(String("#d6d7da")),
12+
backgroundColor(String("#ffffff")),
1313
margin(Pt(10.)),
1414
marginVertical(Pt(5.)),
15-
overflow(Hidden)
15+
overflow(Hidden),
1616
]),
1717
"titleContainer":
1818
style([
1919
borderBottomWidth(1.),
2020
borderTopLeftRadius(3.),
2121
borderTopRightRadius(3.),
22-
borderBottomColor("#d6d7da"),
23-
backgroundColor("#f6f7f8"),
22+
borderBottomColor(String("#d6d7da")),
23+
backgroundColor(String("#f6f7f8")),
2424
paddingHorizontal(Pt(10.)),
25-
paddingVertical(Pt(5.))
25+
paddingVertical(Pt(5.)),
2626
]),
2727
"titleText": style([fontSize(Float(14.)), fontWeight(`_500)]),
2828
"descriptionText": style([fontSize(Float(14.))]),
29-
"disclosure": style([position(Absolute), top(Pt(0.)), right(Pt(0.)), padding(Pt(10.))]),
29+
"disclosure":
30+
style([
31+
position(Absolute),
32+
top(Pt(0.)),
33+
right(Pt(0.)),
34+
padding(Pt(10.)),
35+
]),
3036
"disclosureIcon": style([width(Pt(12.)), height(Pt(8.))]),
31-
"children": style([margin(Pt(10.))])
37+
"children": style([margin(Pt(10.))]),
3238
}
33-
)
39+
),
3440
);
3541

3642
let comp = ReasonReact.statelessComponent("RNTesterBlock");
3743

3844
let make = (~description, ~title, children) => {
3945
...comp,
40-
render: (_self) =>
46+
render: _self =>
4147
<View style=styles##container>
4248
<View style=styles##titleContainer>
43-
<Text style=styles##titleText> (ReasonReact.stringToElement(title)) </Text>
49+
<Text style=styles##titleText>
50+
(ReasonReact.stringToElement(title))
51+
</Text>
4452
(
45-
switch description {
53+
switch (description) {
4654
| Some(description) =>
47-
<Text style=styles##descriptionText> (ReasonReact.stringToElement(description)) </Text>
55+
<Text style=styles##descriptionText>
56+
(ReasonReact.stringToElement(description))
57+
</Text>
4858
| None => ReasonReact.nullElement
4959
}
5060
)
5161
</View>
5262
(View.make(~style=styles##children, children) |> ReasonReact.element)
53-
</View>
54-
};
63+
</View>,
64+
};

RNTester/src/RNTesterExampleList.re

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,61 +7,71 @@ let styles =
77
"listContainer": style([flex(1.0)]),
88
"row":
99
style([
10-
backgroundColor("white"),
10+
backgroundColor(String("white")),
1111
justifyContent(Center),
1212
paddingHorizontal(Pt(15.)),
13-
paddingVertical(Pt(8.))
13+
paddingVertical(Pt(8.)),
1414
]),
1515
"rowTitleText": style([fontSize(Float(17.)), fontWeight(`_500)]),
16-
"rowDetailText": style([fontSize(Float(15.)), color("#888888"), lineHeight(20.)]),
16+
"rowDetailText":
17+
style([
18+
fontSize(Float(15.)),
19+
color(String("#888888")),
20+
lineHeight(20.),
21+
]),
1722
"separator":
1823
style([
1924
height(Pt(StyleSheet.hairlineWidth)),
20-
backgroundColor("#bbbbbb"),
21-
marginLeft(Pt(15.))
25+
backgroundColor(String("#bbbbbb")),
26+
marginLeft(Pt(15.)),
2227
]),
2328
"separatorHighlighted":
24-
style([height(Pt(StyleSheet.hairlineWidth)), backgroundColor("rgb(217, 217, 217)")])
29+
style([
30+
height(Pt(StyleSheet.hairlineWidth)),
31+
backgroundColor(String("rgb(217, 217, 217)")),
32+
]),
2533
}
26-
)
34+
),
2735
);
2836

2937
let component = ReasonReact.statelessComponent("RNTesterExampleList");
3038

31-
let renderItem = (onPress) =>
32-
SectionList.renderItem(
33-
({item}) =>
34-
<TouchableHighlight onPress=(() => onPress(item))>
35-
<View style=styles##row>
36-
<Text style=styles##rowTitleText>
37-
(ReasonReact.stringToElement(item.ExampleList.title))
38-
</Text>
39-
<Text style=styles##rowDetailText>
40-
(ReasonReact.stringToElement(item.description))
41-
</Text>
42-
</View>
43-
</TouchableHighlight>
39+
let renderItem = onPress =>
40+
SectionList.renderItem(({item}) =>
41+
<TouchableHighlight onPress=(() => onPress(item))>
42+
<View style=styles##row>
43+
<Text style=styles##rowTitleText>
44+
(ReasonReact.stringToElement(item.ExampleList.title))
45+
</Text>
46+
<Text style=styles##rowDetailText>
47+
(ReasonReact.stringToElement(item.description))
48+
</Text>
49+
</View>
50+
</TouchableHighlight>
4451
);
4552

4653
let itemSeparatorComponent =
47-
SectionList.separatorComponent(
48-
({highlighted}) =>
49-
<View style=(highlighted ? styles##separatorHighlighted : styles##separator) />
54+
SectionList.separatorComponent(({highlighted}) =>
55+
<View
56+
style=(highlighted ? styles##separatorHighlighted : styles##separator)
57+
/>
5058
);
5159

5260
let make = (~components, ~onPress, _children) => {
5361
let sections =
54-
SectionList.sections([|SectionList.section(~data=components, ~key="components", ())|]);
62+
SectionList.sections([|
63+
SectionList.section(~data=components, ~key="components", ()),
64+
|]);
5565
{
5666
...component,
57-
render: (_self) =>
67+
render: _self =>
5868
<View style=styles##listContainer>
5969
<SectionList
6070
sections
6171
renderItem=(renderItem(onPress))
6272
keyExtractor=((item, _) => item.key)
6373
itemSeparatorComponent
6474
/>
65-
</View>
66-
}
67-
};
75+
</View>,
76+
};
77+
};

RNTester/src/RNTesterPage.re

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@ let styles =
44
StyleSheet.create(
55
Style.(
66
{
7-
"container": style([backgroundColor("#e9eaed"), flex(1.0)]),
7+
"container": style([backgroundColor(String("#e9eaed")), flex(1.0)]),
88
"spacer": style([height(Pt(270.))]),
9-
"wrapper": style([flex(1.0), paddingTop(Pt(10.))])
9+
"wrapper": style([flex(1.0), paddingTop(Pt(10.))]),
1010
}
11-
)
11+
),
1212
);
1313

1414
let component = ReasonReact.statelessComponent("RNTesterPage");
1515

1616
let make = (~title=?, ~noScroll=false, ~noSpacer=false, children) => {
1717
let contentWrapper = (children_: array(ReasonReact.reactElement)) =>
1818
if (noScroll) {
19-
<View key="wrapper" style=styles##wrapper> (ReasonReact.arrayToElement(children_)) </View>
19+
<View key="wrapper" style=styles##wrapper>
20+
(ReasonReact.arrayToElement(children_))
21+
</View>;
2022
} else {
2123
let automaticallyAdjustContentInsets =
22-
switch title {
24+
switch (title) {
2325
| Some(_) => true
2426
| None => false
2527
};
@@ -30,26 +32,26 @@ let make = (~title=?, ~noScroll=false, ~noSpacer=false, children) => {
3032
keyboardDismissMode=`interactive
3133
style=styles##wrapper>
3234
(ReasonReact.arrayToElement(children_))
33-
</ScrollView>
35+
</ScrollView>;
3436
};
3537
{
3638
...component,
37-
render: (_self) => {
39+
render: _self => {
3840
let title =
39-
switch title {
41+
switch (title) {
4042
| Some(title) => <RNTesterTitle key="title" title />
4143
| None => ReasonReact.nullElement
4244
};
4345
let spacer =
4446
if (noSpacer) {
45-
ReasonReact.nullElement
47+
ReasonReact.nullElement;
4648
} else {
47-
<View key="spacer" style=styles##spacer />
49+
<View key="spacer" style=styles##spacer />;
4850
};
4951
<View style=styles##container>
5052
title
5153
(contentWrapper(Array.append(children, [|spacer|])))
52-
</View>
53-
}
54-
}
55-
};
54+
</View>;
55+
},
56+
};
57+
};

RNTester/src/RNTesterTitle.re

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ let styles =
88
style([
99
borderRadius(4.),
1010
borderWidth(1.),
11-
borderColor("#d6d7da"),
11+
borderColor(String("#d6d7da")),
1212
margin(Pt(10.)),
1313
marginBottom(Pt(0.)),
1414
height(Pt(45.)),
1515
padding(Pt(10.)),
16-
backgroundColor("white")
16+
backgroundColor(String("white")),
1717
]),
18-
"text": style([fontSize(Float(19.)), fontWeight(`_500)])
18+
"text": style([fontSize(Float(19.)), fontWeight(`_500)]),
1919
}
20-
)
20+
),
2121
);
2222

2323
let component = ReasonReact.statelessComponent("RNTesterTitle");
2424

2525
let make = (~title, _children) => {
2626
...component,
27-
render: (_self) =>
27+
render: _self =>
2828
<View style=styles##container>
2929
<Text style=styles##text> (ReasonReact.stringToElement(title)) </Text>
30-
</View>
31-
};
30+
</View>,
31+
};

0 commit comments

Comments
 (0)