Skip to content

Commit 665fc86

Browse files
vnovickczystyl
authored andcommitted
Docs/migrating components docs from rebolt (rescript-react-native#285)
Finalising components docs migration from rebolt to bs-react-native issue rescript-react-native#267
1 parent 68febd1 commit 665fc86

29 files changed

Lines changed: 1917 additions & 151 deletions

docs/css/custom.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@ dt#type-calculated {
55
}
66

77
#module-type-FlatListComponent,
8+
#module-type-ViewComponent,
9+
#module-type-Impl,
810
#module-type-ImageComponent,
11+
#module-type-ScrollViewComponent,
912
#module-CreateComponent,
13+
#module-type-TextComponent,
14+
#type-renderBag,
15+
#type-t,
16+
#type-renderAccessory,
17+
#type-viewToken,
1018
#module-CreateComponent ~ article summary,
1119
#module-CreateComponent ~ div summary
1220
{

docs/pages/page-status.mld

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Please find the list of available components and APIs below.
1414
- {{:KeyboardAvoidingView-BsReactNative} [KeyboardAvoidingView]}
1515
- {!ListView}
1616
- {!MapView}
17+
- {{:MaskedViewIOS-BsReactNative} [MaskedViewIOS]}
1718
- {{:Modal-BsReactNative} [Modal]}
1819
- {{:Picker-BsReactNative} [Picker]}
1920
- {{:PickerIOS-BsReactNative} [PickerIOS]}
@@ -33,7 +34,7 @@ Please find the list of available components and APIs below.
3334
- {{:TextInput-BsReactNative} [TextInput]}
3435
- {!ToolbarAndroid}
3536
- {{:TouchableHighlight-BsReactNative} [TouchableHighlight]}
36-
- {{:TouchableWithoutFeedback-BsReactNative} [TouchableNativeFeedback]}
37+
- {{:TouchableNativeFeedback-BsReactNative} [TouchableNativeFeedback]}
3738
- {{:TouchableOpacity-BsReactNative} [TouchableOpacity]}
3839
- {{:TouchableWithoutFeedback-BsReactNative} [TouchableWithoutFeedback]}
3940
- {{:View-BsReactNative} [View]}

lib/js/src/components/statusBar.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/js/src/components/tabBarIOS.js

Lines changed: 50 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/js/src/components/textInput.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/js/src/components/touchableNativeFeedback.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/js/src/components/viewPagerAndroid.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/imageBackground.rei

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
/**
2-
[ImageBackground] component has the same props as {{:\BsReactNative/Image-BsReactNative} [Image] component}
3-
You can read more on ImageBackground component usage in official docs: {{:https://facebook.github.io/react-native/docs/images}}
4-
*/
1+
52

63
module Event: {
74
type error;
@@ -11,6 +8,11 @@ module Event: {
118
};
129
};
1310

11+
/**
12+
[ImageBackground] component has the same props as {{:\BsReactNative/Image-BsReactNative} [Image] component}
13+
You can read more on ImageBackground component usage in official docs: {{:https://facebook.github.io/react-native/docs/images}}
14+
*/
15+
1416
let make:
1517
(
1618
~onError: Event.error => unit=?,

src/components/maskedViewIOS.rei

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,55 @@
1+
/**
2+
Renders the child view with a mask specified in the [maskElement] prop
3+
4+
{3 Example of use}
5+
The following example demonstrates rendering a View with red background behind a mask, defined as a [Basic mask] string.
6+
{[
7+
let component = ReasonReact.statelessComponent("MyComponent");
8+
9+
let make = _children => {
10+
...component,
11+
render: _self =>
12+
<MaskedViewIOS
13+
maskElement={
14+
<View
15+
style=Style.(
16+
style([
17+
flex(1.),
18+
justifyContent(Center),
19+
alignItems(Center),
20+
backgroundColor(String("transparent")),
21+
])
22+
)>
23+
<Text
24+
style=Style.(
25+
style([
26+
fontSize(Float(50.0)),
27+
color(String("black")),
28+
fontWeight(`_700),
29+
])
30+
)>
31+
(ReasonReact.string("Basic mask"))
32+
</Text>
33+
</View>
34+
}>
35+
<View
36+
style=Style.(style([flex(1.), backgroundColor(String("red"))]))
37+
/>
38+
</MaskedViewIOS>,
39+
};
40+
]}
41+
42+
You can read more on MaskedViewIOS component usage in official docs: {{:https://facebook.github.io/react-native/docs/maskedviewios}}
43+
44+
{4 Props}
45+
46+
All {{:\BsReactNative/View-BsReactNative} [View] props} are accepted.
47+
48+
{4 maskElement}
49+
{[~maskElement: ReasonReact.reactElement]}
50+
51+
*/
52+
153
let make:
254
(
355
~maskElement: ReasonReact.reactElement,
@@ -54,4 +106,4 @@ let make:
54106
ReasonReact.stateless,
55107
ReasonReact.noRetainedProps,
56108
ReasonReact.actionless,
57-
);
109+
);

src/components/refreshControl.rei

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1+
/**
2+
{3 Example of use}
3+
You can read more on RefreshControl component usage in official docs: {{:https://facebook.github.io/react-native/docs/refreshcontrol}}
4+
5+
{3 Props}
6+
{4 onRefresh}
7+
{[
8+
onRefresh: unit => unit=?
9+
]}
10+
{4 refreshing}
11+
{[
12+
~refreshing: bool=?,
13+
]}
14+
{4 colors}
15+
{[
16+
~colors: array(string)=?,
17+
]}
18+
{4 enabled}
19+
{[
20+
~enabled: bool=?,
21+
]}
22+
{4 progressBackgroundColor}
23+
{[
24+
~progressBackgroundColor: string=?,
25+
]}
26+
{4 progressViewOffset}
27+
{[
28+
~progressViewOffset: float=?,
29+
]}
30+
{4 tintColor}
31+
{[
32+
~tintColor: string=?,
33+
]}
34+
{4 title}
35+
{[
36+
~title: string=?,
37+
]}
38+
{4 titleColor}
39+
{[
40+
~titleColor: string=?,
41+
]}
42+
All other {{:\BsReactNative/View-BsReactNative} [View] props}
43+
*/
44+
145
let make:
246
(
347
~onRefresh: unit => unit=?,
@@ -62,4 +106,4 @@ let make:
62106
ReasonReact.stateless,
63107
ReasonReact.noRetainedProps,
64108
unit,
65-
);
109+
);

0 commit comments

Comments
 (0)