@sdcx/bottom-sheet 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # BottomSheet
2
2
 
3
- `BottomSheet` 是位于屏幕底部的可拖拽的组件,支持嵌套滚动,可以和可滚动视图(FlatList, FlashList, WebView 等等)一起使用。
3
+ `BottomSheet` 是一个 React Native 原生 UI 组件。
4
+
5
+ 它位于屏幕底部,可拖拽,支持嵌套滚动,可以和可滚动视图(`FlatList`, `FlashList`, `WebView` 等等)一起使用。
4
6
 
5
7
  ## Installation
6
8
 
@@ -159,7 +159,7 @@
159
159
  }
160
160
 
161
161
  if (pan.state == UIGestureRecognizerStateEnded) {
162
- if (self.lastDragDistance > 10) {
162
+ if (self.lastDragDistance > 1) {
163
163
  if (self.target && self.target.contentOffset.y <= 0) {
164
164
  //如果是类似轻扫的那种
165
165
  [self settleToState:@"collapsed"];
@@ -169,7 +169,7 @@
169
169
  //如果是类似轻扫的那种
170
170
  [self settleToState:@"collapsed"];
171
171
  }
172
- } else if (self.lastDragDistance < -10) {
172
+ } else if (self.lastDragDistance < -1) {
173
173
  //如果是类似轻扫的那种
174
174
  [self settleToState:@"expanded"];
175
175
  } else {
@@ -232,7 +232,7 @@
232
232
  }
233
233
 
234
234
  - (void)setState:(NSString *)state {
235
- if ([_state isEqualToString:@"state"]) {
235
+ if ([_state isEqualToString:state]) {
236
236
  return;
237
237
  }
238
238
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sdcx/bottom-sheet",
3
- "description": "A react-native bottom sheet component",
4
- "version": "0.1.0",
3
+ "description": "A react-native BottomSheet component.",
4
+ "version": "0.3.0",
5
5
  "main": "./lib/index.js",
6
6
  "typings": "./lib/index.d.ts",
7
7
  "react-native": "src/index",
@@ -17,7 +17,8 @@
17
17
  "!**/__tests__"
18
18
  ],
19
19
  "repository": "https://github.com/sdcxtech/react-native-troika",
20
- "homepage": "https://github.com/sdcxtech/react-native-troika#readme",
20
+ "homepage": "https://github.com/sdcxtech/react-native-troika/tree/master/packages/bottom-sheet/README.md",
21
+ "author": "sdcx",
21
22
  "license": "MIT",
22
23
  "keywords": [
23
24
  "react-native",
@@ -38,12 +39,12 @@
38
39
  "@babel/core": "^7.13.10",
39
40
  "@babel/runtime": "^7.13.10",
40
41
  "@react-native-community/eslint-config": "^3.0.0",
41
- "@types/jest": "^26.0.21",
42
+ "@types/jest": "^27.0.1",
42
43
  "@types/react": "^17.0.2",
43
44
  "@types/react-native": "^0.67.0",
44
45
  "@types/react-test-renderer": "17.0.2",
45
- "babel-jest": "^26.6.3",
46
- "jest": "^26.6.3",
46
+ "babel-jest": "^27.0.6",
47
+ "jest": "^27.0.6",
47
48
  "metro-react-native-babel-preset": "^0.66.2",
48
49
  "react": "17.0.2",
49
50
  "react-native": "^0.67.4",