You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+8-18Lines changed: 8 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,24 +6,15 @@ We want this community to be friendly and respectful to each other. Please follo
6
6
7
7
## Development workflow
8
8
9
-
This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages:
10
-
11
-
- The library package in the root directory.
12
-
- An example app in the `example/` directory.
13
-
14
9
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
15
10
16
11
```sh
17
12
yarn
18
13
```
19
14
20
-
> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.
21
-
22
-
The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.
15
+
> While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development.
23
16
24
-
It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app.
25
-
26
-
You can use various commands from the root directory to work with the project.
17
+
While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.
27
18
28
19
To start the packager:
29
20
@@ -43,12 +34,6 @@ To run the example app on iOS:
43
34
yarn example ios
44
35
```
45
36
46
-
To run the example app on Web:
47
-
48
-
```sh
49
-
yarn example web
50
-
```
51
-
52
37
Make sure your code passes TypeScript and ESLint. Run the following to verify:
53
38
54
39
```sh
@@ -68,6 +53,11 @@ Remember to add tests for your change if possible. Run the unit tests by:
68
53
yarn test
69
54
```
70
55
56
+
To edit the Objective-C or Swift files, open `example/ios/ReactNativeMaterialComponentsExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > @computools/react-native-material-components`.
57
+
58
+
To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `computools-react-native-material-components` under `Android`.
59
+
60
+
71
61
### Commit message convention
72
62
73
63
We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
@@ -103,7 +93,7 @@ yarn release
103
93
104
94
The `package.json` file contains various scripts for common tasks:
105
95
106
-
-`yarn`: setup project by installing dependencies.
96
+
-`yarn bootstrap`: setup project by installing all dependencies and pods.
107
97
-`yarn typecheck`: type-check files with TypeScript.
**Note:** If you want to use scrollable components as children of Bottom Sheet you need to import them from react-native-gesture-handler. Otherwise they won't scroll on Android.
393
+
394
+

395
+
</details>
396
+
<details><summary>Side Sheet</summary>
397
+
398
+
**Properties**
399
+
400
+
| name | description | type | default |
401
+
| ------ | ------ | ------ | ---- |
402
+
| children | - | ReactNode | - |
403
+
| stickySide | - | 'right' or 'left | 'right' |
404
+
| modalWidthCoeff | up to 1 | number | 0.85 |
405
+
| animationDuration | - | number | 300 |
406
+
| overlayStyle | - | ViewStyle | - |
407
+
408
+
### Usage
409
+
410
+
1. Create a ref for a side sheet of the SideSheetRef interface.
411
+
2. Pass the side sheet ref as ref prop to ```SideSheet```.
412
+
3. Call ```toggle()``` method from ```ref.current``` to open/close the Side Sheet.
326
413
414
+
See the example:
415
+
416
+
```
417
+
import {SideSheet, type SideSheetRef} from '@computools/react-native-material-components';
<Text onPress={toggleSideSheet}>TOGGLE SIDE SHEET</Text>
428
+
</View>
429
+
<SideSheet ref={ref}>
430
+
{/* Side sheet content here */}
431
+
</SideSheet>
432
+
</>
433
+
);
434
+
}
435
+
```
436
+
437
+
**Note:** If you want to use scrollable components as children of Side Sheet you need to import them from react-native-gesture-handler. Otherwise they won't scroll on Android.
438
+
439
+

440
+

0 commit comments