Skip to content

Commit a5e94e7

Browse files
committed
New website
1 parent d78b033 commit a5e94e7

File tree

161 files changed

+4695
-6217
lines changed

Some content is hidden

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

161 files changed

+4695
-6217
lines changed

.gitattributes

Lines changed: 0 additions & 3 deletions
This file was deleted.

.gitignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ node_modules
99
# npm unused lock file (we use yarn.lock)
1010
package-lock.json
1111

12-
# ReScript / Reason / Ocaml artifacts
12+
# ReScript artifacts
1313
*.bs.js
1414
.bsb.lock
1515
**/lib/bs
1616
**/lib/ocaml
1717
**/.merlin
1818

19-
# website build artifacts
20-
build
21-
dist
19+
# Docusaurus
20+
# Production
21+
/build
22+
23+
# Generated files
24+
.docusaurus
25+
.cache-loader

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 @reason-react-native
3+
Copyright (c) 2019 @rescript-react-native
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,47 @@
1-
# reason-react-native.github.io
1+
# rescript-react-native.github.io
22

3-
Website for reason-react-native
3+
Website for rescript-react-native
44

5-
---
5+
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
66

7-
## Contribute
7+
## Installation
8+
9+
```console
10+
yarn install
11+
```
12+
13+
## Local Development
14+
15+
```console
16+
yarn start
17+
```
818

9-
Read the [contribution guidelines](https://github.com/reason-react-native/.github/blob/master/CONTRIBUTING.md) before contributing.
19+
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
1020

21+
## Build
1122

12-
## Required to run
23+
```console
24+
yarn build
25+
```
1326

14-
- install [nodejs](https://nodejs.org/en/)
15-
- install [yarn](https://yarnpkg.com/)
27+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
1628

29+
## Deployment
1730

18-
## How to run site
31+
```console
32+
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
33+
```
1934

20-
- install dependencies using yarn `yarn`
21-
- run build with this command `yarn build`
22-
- run server to test with this command `yarn start`
35+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
36+
37+
---
38+
39+
## Contribute
2340

41+
Read the [contribution guidelines](https://github.com/rescript-react-native/.github/blob/master/CONTRIBUTING.md) before contributing.
2442

2543
## Code of Conduct
2644

2745
We want this community to be friendly and respectful to each other. Please read
28-
[our full code of conduct](https://github.com/reason-react-native/.github/blob/master/CODE_OF_CONDUCT.md) so that you can understand what
46+
[our full code of conduct](https://github.com/rescript-react-native/.github/blob/master/CODE_OF_CONDUCT.md) so that you can understand what
2947
actions will and will not be tolerated.

ReScriptReactNative.sketch

228 KB
Binary file not shown.

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

blog/2019-06-17-hello-reason-react-native.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
---
2-
id: 2019-06-17-hello-reason-react-native
2+
slug: 2019-06-17-hello-reason-react-native
33
title: Hello Reason React Native
44
author: MoOx
5+
author_title: ReScript React Native Core Team
6+
author_url: https://github.com/MoOx
7+
author_image_url: https://avatars.githubusercontent.com/u/157534?v=4
8+
tags: [hello, reason]
59
---
610

711
Today is a big day for the ReasonML community as we are releasing the fruits of
@@ -63,7 +67,7 @@ offering 2 packages to say goodbye to `bs-react-native` without pain.
6367

6468
- `bs-react-native-jsx3-compat` (0.11.1)
6569
- `reason-react-native`
66-
([0.60.0](/en/docs/install/#note-about-reason-react-native-version-number))
70+
([0.60.0](/docs/install/#note-about-reason-react-native-version-number))
6771

6872
## Wait, what is `bs-react-native-jsx3-compat` ?
6973

@@ -97,7 +101,7 @@ to use hooks and directly benefit of (almost) zero-cost bindings!
97101
And since we care about you and don't want you to upgrade from JSX 2 to 3 by
98102
hand, we got you covered with a script made with love to help you with that.
99103

100-
[You will find all the required instructions to migrate from `bs-react-native` to `bs-react-native-jsx3-compat` in our documentation](/en/docs/migration/jsx3/).
104+
[You will find all the required instructions to migrate from `bs-react-native` to `bs-react-native-jsx3-compat` in our documentation](https://reason-react-native.github.io/en/docs/migration/jsx3/).
101105

102106
## tl;dr
103107

@@ -106,7 +110,7 @@ hand, we got you covered with a script made with love to help you with that.
106110
`bs-react-native` with `reason-react` 0.7.0 and JSX 3
107111
- `reason-react-native` package contains the new bindings for React Native, that
108112
offers more accessible APIs and that is almost zero-cost
109-
- [We offer you an easy and smooth migration plan so you can start using `reason-react-native` and slowly say bye to `bs-react-native`](/en/docs/migration/jsx3/).
113+
- [We offer you an easy and smooth migration plan so you can start using `reason-react-native` and slowly say bye to `bs-react-native`](https://reason-react-native.github.io/en/docs/migration/jsx3/).
110114

111115
## Thanks
112116

@@ -136,4 +140,4 @@ Components need to be documented. We really want to offer the best developer
136140
experience possible and that's definitely part of it.
137141

138142
👉Now it's time for you to check our
139-
[Getting Started with Reason React Native documentation](/en/docs/)
143+
[Getting Started with Reason React Native documentation](/docs/)

bsconfig.json

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/usr/bin/env bash
22
GIT_DEPLOY_REPO=${GIT_DEPLOY_REPO:-$(node -e 'process.stdout.write(require("./package.json").repository)')}
33

4-
cd dist && \
4+
cd build && \
55
rm -rf .git && \
66
git init && \
7+
git checkout -b main && \
78
git add . -A && \
89
git commit -m "Deploy to GitHub Pages" && \
9-
git push --force "${GIT_DEPLOY_REPO}" master:master
10+
git push --force "${GIT_DEPLOY_REPO}" main:main

docs/accessibilityinfo.md

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
---
2+
id: accessibilityinfo
3+
title: AccessibilityInfo
4+
officialDoc: https://reactnative.dev/docs/accessibilityinfo
5+
---
6+
7+
## Types
8+
9+
### `announcementResult`
10+
11+
Passed to the handler of the `` `announcementFinished `` event.
12+
13+
```rescript
14+
type announcementResult = {
15+
announcement: string,
16+
success: bool,
17+
}
18+
```
19+
20+
where `announcement` is the string announced by the screen reader and `success`
21+
is a `bool` indicating whether the announcement was successfully made.
22+
23+
## Methods
24+
25+
### `isBoldTextEnabled`
26+
27+
_iOS only_
28+
29+
To query whether bold text is currently enabled. Promise resolves to `true` when
30+
bold text is enabled and `false` otherwise.
31+
32+
```rescript
33+
isBoldTextEnabled: unit => Js.Promise.t(bool)
34+
```
35+
36+
### `isGrayscaleEnabled`
37+
38+
_iOS only_
39+
40+
To query whether grayscale is currently enabled. Promise resolves to `true` when
41+
grayscale is enabled and `false` otherwise.
42+
43+
```rescript
44+
isGrayscaleEnabled: unit => Js.Promise.t(bool)
45+
```
46+
47+
### `isInvertColorsEnabled`
48+
49+
_iOS only_
50+
51+
To query whether invert colors is currently enabled. Promise resolves to `true`
52+
when invert colors is enabled and `false` otherwise.
53+
54+
```rescript
55+
isInvertColorsEnabled: unit => Js.Promise.t(bool)
56+
```
57+
58+
### `isReduceMotionEnabled`
59+
60+
To query whether reduce motion is currently enabled. Promise resolves to `true`
61+
when reduce motion is enabled and `false` otherwise.
62+
63+
```rescript
64+
isReduceMotionEnabled: unit => Js.Promise.t(bool)
65+
```
66+
67+
### `isReduceTransparencyEnabled`
68+
69+
_iOS only_
70+
71+
To query whether reduce transparency is currently enabled. Promise resolves to
72+
`true` when reduce transparency is enabled and `false` otherwise.
73+
74+
```rescript
75+
isReduceTransparencyEnabled: unit => Js.Promise.t(bool)
76+
```
77+
78+
### `isScreenReaderEnabled`
79+
80+
To query whether screen reader is currently enabled. Promise resolves to `true`
81+
when screen reader is enabled and `false` otherwise.
82+
83+
```rescript
84+
isScreenReaderEnabled: unit => Js.Promise.t(bool)
85+
```
86+
87+
### `setAccessibilityFocus`
88+
89+
To set accessibility focus to a React component, identified by its `nodeHandle`.
90+
On Android, this is equivalent to
91+
`UIManager.sendAccessibilityEvent(reactTag, UIManager.AccessibilityEventTypes.typeViewFocused)`;
92+
93+
```rescript
94+
setAccessibilityFocus: NativeTypes.nodeHandle => unit
95+
```
96+
97+
### `announceForAccessibility`
98+
99+
To post a string to be announced by the screen reader.
100+
101+
```rescript
102+
announceForAccessibility: string => unit
103+
```
104+
105+
### `addEventListener`
106+
107+
Add an event handler.
108+
109+
```rescript
110+
addEventListener: [
111+
| #boldTextChanged(bool => unit)
112+
| #grayscaleChanged(bool => unit)
113+
| #invertColorsChanged(bool => unit)
114+
| #reduceMotionChanged(bool => unit)
115+
| #screenReaderChanged(bool => unit)
116+
| #reduceTransparencyChanged(bool => unit)
117+
| #announcementFinished(announcementResult => unit)
118+
] => unit
119+
```
120+
121+
Supported events:
122+
123+
- `boldTextChanged(bool => unit)`: _iOS only_. Fires when state of the bold text
124+
toggle changes. The argument to the event handler is a `bool` which is `true`
125+
when bold text is enabled and `false` otherwise.
126+
- `grayscaleChanged(bool => unit)`: _iOS only_. Fires when state of the gray
127+
scale toggle changes. The argument to the event handler is a `bool` which is
128+
`true` when gray scale is enabled and `false` otherwise.
129+
- `invertColorsChanged(bool => unit)`: _iOS only_. Fires when state of the
130+
invert colors toggle changes. The argument to the event handler is a `bool`
131+
which is `true` when invert colors is enabled and `false` otherwise.
132+
- `reduceMotionChanged(bool => unit)`: Fires when state of the reduce motion
133+
toggle changes. The argument to the event handler is a `bool` which is `true`
134+
when reduce motion is enabled (or when "Transition Animation Scale" in
135+
"Developer options" is "Animation off") and `false` otherwise.
136+
- `screenReaderChanged(bool => unit)`: Fires when state of the screen reader
137+
changes. The argument to the event handler is a `bool` which is `true` when a
138+
screen reader is enabled and `false` otherwise.
139+
- `reduceTransparencyChanged(bool => unit)`: _iOS only_. Fires when state of the
140+
reduce transparency toggle changes. The argument to the event handler is a
141+
`bool` which is `true` when reduce transparency is enabled and `false`
142+
otherwise.
143+
- `announcementFinished(announcementResult => unit)`: _iOS only_. Fires when the
144+
screen reader has finished making an announcement. The argument to the event
145+
handler is of type [`announcementResult`](#announcementResult).
146+
147+
### `removeEventListener`
148+
149+
To remove an event handler.
150+
151+
See [`addEventListener`](#addEventListener) for more details on supported
152+
events.

docs/actionsheetios.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
id: actionsheetios
3+
title: ActionSheetIOS
4+
wip: true
5+
---

docs/activityindicator.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
id: activityindicator
3+
title: ActivityIndicator
4+
wip: true
5+
---

docs/alert.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
id: alert
3+
title: Alert
4+
wip: true
5+
---
6+
7+
## Methods
8+
9+
### `alert`
10+
11+
Launches an alert dialog with the specified `title` and `message`. Optionally,
12+
an array of `buttons` can be provided: on Android the maximum is 3, on iOS any
13+
number is okay.
14+
15+
On Android, the dialog can be dismissed by tapping outside of the alert box.
16+
This triggers the `onDismiss` callback available in the `options`. With the
17+
`cancelable` option, this behavior can be deactivated altogether.
18+
19+
#### `alert` Example
20+
21+
```rescript
22+
open ReactNative
23+
24+
Alert.alert(
25+
~title="Do you really want to quit?",
26+
~message="We miss you already.",
27+
~buttons=[
28+
Alert.button(
29+
~text="OK",
30+
~style=#destructive,
31+
~onPress=() => Js.log("Bye!"),
32+
(),
33+
),
34+
Alert.button(~text="Cancel", ~style=#cancel, ()),
35+
],
36+
~options=Alert.options(
37+
~cancelable=true,
38+
~onDismiss=_ => Js.log("Dismissed."),
39+
(),
40+
),
41+
(),
42+
)
43+
44+
```

0 commit comments

Comments
 (0)