Skip to content

Commit

Permalink
Docs/migrating components docs from rebolt (facebook#285)
Browse files Browse the repository at this point in the history
Finalising components docs migration from rebolt to bs-react-native

issue facebook#267
  • Loading branch information
vnovick authored and czystyl committed Oct 31, 2018
1 parent 68febd1 commit 665fc86
Show file tree
Hide file tree
Showing 29 changed files with 1,917 additions and 151 deletions.
8 changes: 8 additions & 0 deletions docs/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ dt#type-calculated {
}

#module-type-FlatListComponent,
#module-type-ViewComponent,
#module-type-Impl,
#module-type-ImageComponent,
#module-type-ScrollViewComponent,
#module-CreateComponent,
#module-type-TextComponent,
#type-renderBag,
#type-t,
#type-renderAccessory,
#type-viewToken,
#module-CreateComponent ~ article summary,
#module-CreateComponent ~ div summary
{
Expand Down
3 changes: 2 additions & 1 deletion docs/pages/page-status.mld
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Please find the list of available components and APIs below.
- {{:KeyboardAvoidingView-BsReactNative} [KeyboardAvoidingView]}
- {!ListView}
- {!MapView}
- {{:MaskedViewIOS-BsReactNative} [MaskedViewIOS]}
- {{:Modal-BsReactNative} [Modal]}
- {{:Picker-BsReactNative} [Picker]}
- {{:PickerIOS-BsReactNative} [PickerIOS]}
Expand All @@ -33,7 +34,7 @@ Please find the list of available components and APIs below.
- {{:TextInput-BsReactNative} [TextInput]}
- {!ToolbarAndroid}
- {{:TouchableHighlight-BsReactNative} [TouchableHighlight]}
- {{:TouchableWithoutFeedback-BsReactNative} [TouchableNativeFeedback]}
- {{:TouchableNativeFeedback-BsReactNative} [TouchableNativeFeedback]}
- {{:TouchableOpacity-BsReactNative} [TouchableOpacity]}
- {{:TouchableWithoutFeedback-BsReactNative} [TouchableWithoutFeedback]}
- {{:View-BsReactNative} [View]}
Expand Down
2 changes: 1 addition & 1 deletion lib/js/src/components/statusBar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 50 additions & 6 deletions lib/js/src/components/tabBarIOS.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/js/src/components/textInput.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/js/src/components/touchableNativeFeedback.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/js/src/components/viewPagerAndroid.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions src/components/imageBackground.rei
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
/**
[ImageBackground] component has the same props as {{:\BsReactNative/Image-BsReactNative} [Image] component}
You can read more on ImageBackground component usage in official docs: {{:https://facebook.github.io/react-native/docs/images}}
*/


module Event: {
type error;
Expand All @@ -11,6 +8,11 @@ module Event: {
};
};

/**
[ImageBackground] component has the same props as {{:\BsReactNative/Image-BsReactNative} [Image] component}
You can read more on ImageBackground component usage in official docs: {{:https://facebook.github.io/react-native/docs/images}}
*/

let make:
(
~onError: Event.error => unit=?,
Expand Down
54 changes: 53 additions & 1 deletion src/components/maskedViewIOS.rei
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
/**
Renders the child view with a mask specified in the [maskElement] prop
{3 Example of use}
The following example demonstrates rendering a View with red background behind a mask, defined as a [Basic mask] string.
{[
let component = ReasonReact.statelessComponent("MyComponent");
let make = _children => {
...component,
render: _self =>
<MaskedViewIOS
maskElement={
<View
style=Style.(
style([
flex(1.),
justifyContent(Center),
alignItems(Center),
backgroundColor(String("transparent")),
])
)>
<Text
style=Style.(
style([
fontSize(Float(50.0)),
color(String("black")),
fontWeight(`_700),
])
)>
(ReasonReact.string("Basic mask"))
</Text>
</View>
}>
<View
style=Style.(style([flex(1.), backgroundColor(String("red"))]))
/>
</MaskedViewIOS>,
};
]}
You can read more on MaskedViewIOS component usage in official docs: {{:https://facebook.github.io/react-native/docs/maskedviewios}}
{4 Props}
All {{:\BsReactNative/View-BsReactNative} [View] props} are accepted.
{4 maskElement}
{[~maskElement: ReasonReact.reactElement]}
*/

let make:
(
~maskElement: ReasonReact.reactElement,
Expand Down Expand Up @@ -54,4 +106,4 @@ let make:
ReasonReact.stateless,
ReasonReact.noRetainedProps,
ReasonReact.actionless,
);
);
46 changes: 45 additions & 1 deletion src/components/refreshControl.rei
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
/**
{3 Example of use}
You can read more on RefreshControl component usage in official docs: {{:https://facebook.github.io/react-native/docs/refreshcontrol}}
{3 Props}
{4 onRefresh}
{[
onRefresh: unit => unit=?
]}
{4 refreshing}
{[
~refreshing: bool=?,
]}
{4 colors}
{[
~colors: array(string)=?,
]}
{4 enabled}
{[
~enabled: bool=?,
]}
{4 progressBackgroundColor}
{[
~progressBackgroundColor: string=?,
]}
{4 progressViewOffset}
{[
~progressViewOffset: float=?,
]}
{4 tintColor}
{[
~tintColor: string=?,
]}
{4 title}
{[
~title: string=?,
]}
{4 titleColor}
{[
~titleColor: string=?,
]}
All other {{:\BsReactNative/View-BsReactNative} [View] props}
*/

let make:
(
~onRefresh: unit => unit=?,
Expand Down Expand Up @@ -62,4 +106,4 @@ let make:
ReasonReact.stateless,
ReasonReact.noRetainedProps,
unit,
);
);
10 changes: 9 additions & 1 deletion src/components/safeAreaView.rei
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
include View.ViewComponent;
/**
The purpose of [SafeAreaView] is to render content within the safe area boundaries of a device. It is currently only applicable to iOS devices with iOS version 11 or later.
[SafeAreaView] renders nested content and automatically applies paddings to reflect the portion of the view that is not covered by navigation bars, tab bars, toolbars, and other ancestor views. Moreover, and most importantly,Safe Area's paddings reflect the physical limitation of the screen, such as rounded corners or camera notches (i.e. the sensor housing area on iPhone X).
You can read more on SafeAreaView component usage in official docs: {{:https://facebook.github.io/react-native/docs/maskedviewios}}
{{:\BsReactNative/View-BsReactNative} [View] props}
*/
include View.ViewComponent;
Loading

0 comments on commit 665fc86

Please sign in to comment.