@lodev09/react-native-true-sheet 0.9.2 → 0.9.4
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 +46 -14
- package/lib/commonjs/TrueSheetGrabber.js +9 -11
- package/lib/commonjs/TrueSheetGrabber.js.map +1 -1
- package/lib/module/TrueSheetGrabber.js +9 -11
- package/lib/module/TrueSheetGrabber.js.map +1 -1
- package/lib/typescript/src/TrueSheetGrabber.d.ts +4 -4
- package/lib/typescript/src/TrueSheetGrabber.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/TrueSheetGrabber.tsx +9 -19
package/README.md
CHANGED
|
@@ -12,8 +12,12 @@ The true native bottom sheet 💩
|
|
|
12
12
|
* ✅ Implemented in the native realm.
|
|
13
13
|
* ✅ **_NOT_** your pure JS, (re)animated view (might integrate in the future 👀)
|
|
14
14
|
* ✅ Clean, fast, and lightweight.
|
|
15
|
-
* ✅ Handles your
|
|
16
|
-
* ✅
|
|
15
|
+
* ✅ Handles your _Scrolling_ needs, natively.
|
|
16
|
+
* ✅ Handles your _Footer_ needs, natively.
|
|
17
|
+
* ✅ Handles your _Keyboard_ needs, natively.
|
|
18
|
+
* ✅ Asynchronus `ref` [methods](#methods).
|
|
19
|
+
* ✅ Works with Expo by default.
|
|
20
|
+
* ✅ Bonus! [Blur](#blurtint) support on iOS 😎
|
|
17
21
|
|
|
18
22
|
## Installation
|
|
19
23
|
|
|
@@ -34,8 +38,9 @@ import { TrueSheet } from "@lodev09/react-native-true-sheet"
|
|
|
34
38
|
|
|
35
39
|
const sheet = useRef<TrueSheet>(null)
|
|
36
40
|
|
|
37
|
-
const openSheet = () => {
|
|
38
|
-
sheet.current?.present()
|
|
41
|
+
const openSheet = async () => {
|
|
42
|
+
await sheet.current?.present()
|
|
43
|
+
console.log('horray! sheet has been presented 💩')
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
return (
|
|
@@ -59,17 +64,17 @@ Extends `ViewProps`
|
|
|
59
64
|
|
|
60
65
|
| Prop | Type | Default | Description | 🍎 | 🤖 |
|
|
61
66
|
| - | - | - | - | - | - |
|
|
62
|
-
| sizes | [`SheetSize`](#sheetsize) | `[
|
|
63
|
-
| backgroundColor | `ColorValue` | `white` |
|
|
67
|
+
| sizes | [`SheetSize[]`](#sheetsize) | `["medium", "large"]` | Array of sizes you want the sheet to support. Maximum of _**3 sizes**_ only! **_collapsed_**, **_half-expanded_**, and **_expanded_**. Example: `size={["auto", "60%", "large"]}`| ✅ | ✅ |
|
|
68
|
+
| backgroundColor | `ColorValue` | `"white"` | The sheet's background color. | ✅ | ✅ |
|
|
64
69
|
| cornerRadius | `number` | - | the sheet corner radius. | ✅ | ✅ |
|
|
65
|
-
| maxHeight | `number` | - | Overrides `large` or `100
|
|
70
|
+
| maxHeight | `number` | - | Overrides `"large"` or `"100%"` height. | ✅ | ✅ |
|
|
66
71
|
| contentContainerStyle | `StyleProp<ViewStyle>` | - | Optional content container styles. | ✅ | ✅ |
|
|
67
|
-
| FooterComponent | `ComponentType<...>
|
|
72
|
+
| FooterComponent | `ComponentType<...> \| ReactElement` | - | A component that floats at the bottom of the sheet. Accepts a functional `Component` or `ReactElement`. | ✅ | ✅ |
|
|
68
73
|
| dismissible | `boolean` | `true` | If set to `false`, the sheet will prevent interactive dismissal via dragging or clicking outside of it. | ✅ | ✅ |
|
|
69
74
|
| grabber | `boolean` | `true` | Shows a grabber (or handle). Native on IOS and styled `View` on Android. | ✅ | ✅ |
|
|
70
75
|
| grabberProps | [`TrueSheetGrabberProps`](#truesheetgrabberprops) | - | Overrides the grabber props for android. | | ✅ |
|
|
71
|
-
| blurTint | [`BlurTint`](#
|
|
72
|
-
| scrollRef | `RefObject<...>` | - | The main scrollable ref that
|
|
76
|
+
| blurTint | [`BlurTint`](#blurtint) | - | The blur effect style on iOS. Overrides `backgroundColor` if set. Example: `"light"`, `"dark"`, etc. | ✅ | |
|
|
77
|
+
| scrollRef | `RefObject<...>` | - | The main scrollable ref that the sheet should handle on iOS. | ✅ | |
|
|
73
78
|
|
|
74
79
|
## Methods
|
|
75
80
|
|
|
@@ -153,9 +158,9 @@ Grabber props to be used for android grabber or handle.
|
|
|
153
158
|
| - | - | - | - |
|
|
154
159
|
| visible | `boolean` | `true` | Is grabber visible. |
|
|
155
160
|
| color | `ColorValue` | `"rgba(73,69,79,0.4)"` | Grabber color according to M3 specs. |
|
|
156
|
-
| height | `
|
|
157
|
-
| width | `
|
|
158
|
-
| topOffset | `
|
|
161
|
+
| height | `number` | `4` | Grabber height according to M3 specs. |
|
|
162
|
+
| width | `number` | `32` | Grabber width according to M3 specs. |
|
|
163
|
+
| topOffset | `number` | `0` | Grabber top position offset. |
|
|
159
164
|
|
|
160
165
|
### `BlurTint`
|
|
161
166
|
|
|
@@ -207,11 +212,38 @@ Blur tint that is mapped into native values in iOS.
|
|
|
207
212
|
| index | `number` | The size index from the provided sizes. See `sizes` prop. |
|
|
208
213
|
| value | `number` | The actual height value of the size. |
|
|
209
214
|
|
|
215
|
+
## Troubleshooting
|
|
216
|
+
|
|
217
|
+
### Integrating `@react-navigation/native` on iOS
|
|
218
|
+
|
|
219
|
+
On iOS, navigating to a [React Navigation](https://reactnavigation.org) screen from within the Sheet can cause issues. To resolve this, dismiss the sheet before navigating!
|
|
220
|
+
|
|
221
|
+
Example:
|
|
222
|
+
```ts
|
|
223
|
+
const sheet = useRef<TrueSheet>(null)
|
|
224
|
+
|
|
225
|
+
const navigate = async () => {
|
|
226
|
+
await sheet.current?.dismiss() // wait for the sheet to dismiss ✅
|
|
227
|
+
navigation.navigate('SomeScreen') // navigate to the screen 🎉
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return (
|
|
231
|
+
<TrueSheet ref={sheet}>
|
|
232
|
+
<Button onPress={navigate} title="Navigate to SomeScreen" />
|
|
233
|
+
// ...
|
|
234
|
+
</TrueSheet>
|
|
235
|
+
)
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Weird layout render
|
|
239
|
+
|
|
240
|
+
The sheet does not have control over how React Native renders components and may lead to rendering issues. To resolve this, try to minimize the use of `flex=1` in your content styles. Instead, use fixed `height` or employ `flexGrow`, `flexBasis`, etc., to manage your layout requirements.
|
|
241
|
+
|
|
210
242
|
## v1 Roadmap
|
|
211
243
|
|
|
212
244
|
- [ ] Inline sheet
|
|
245
|
+
- [ ] Test with RN new architecture
|
|
213
246
|
- [ ] Reanimated integration(?)
|
|
214
|
-
- [ ] Any ideas?
|
|
215
247
|
|
|
216
248
|
## Contributing
|
|
217
249
|
|
|
@@ -7,10 +7,8 @@ exports.TrueSheetGrabber = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
const GRABBER_WRAPPER_HEIGHT = 24;
|
|
11
10
|
const GRABBER_DEFAULT_HEIGHT = 4;
|
|
12
11
|
const GRABBER_DEFAULT_WIDTH = 32;
|
|
13
|
-
const GRABBER_DEFAULT_TOP_OFFSET = 6;
|
|
14
12
|
|
|
15
13
|
// M3 spec: #49454F 0.4 alpha
|
|
16
14
|
const GRABBER_DEFAULT_COLOR = 'rgba(73,69,79,0.4)';
|
|
@@ -24,30 +22,30 @@ const TrueSheetGrabber = props => {
|
|
|
24
22
|
color = GRABBER_DEFAULT_COLOR,
|
|
25
23
|
width = GRABBER_DEFAULT_WIDTH,
|
|
26
24
|
height = GRABBER_DEFAULT_HEIGHT,
|
|
27
|
-
topOffset =
|
|
25
|
+
topOffset = 0,
|
|
28
26
|
style
|
|
29
27
|
} = props;
|
|
30
28
|
if (!visible) return null;
|
|
31
29
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
32
|
-
style: $wrapper
|
|
30
|
+
style: [$wrapper, style, {
|
|
31
|
+
height: GRABBER_DEFAULT_HEIGHT * 4,
|
|
32
|
+
top: topOffset
|
|
33
|
+
}]
|
|
33
34
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
34
35
|
style: [$grabber, {
|
|
35
36
|
height,
|
|
36
37
|
width,
|
|
37
|
-
backgroundColor: color
|
|
38
|
-
|
|
39
|
-
}, style]
|
|
38
|
+
backgroundColor: color
|
|
39
|
+
}]
|
|
40
40
|
}));
|
|
41
41
|
};
|
|
42
42
|
exports.TrueSheetGrabber = TrueSheetGrabber;
|
|
43
43
|
const $wrapper = {
|
|
44
44
|
position: 'absolute',
|
|
45
|
-
top: 0,
|
|
46
|
-
left: 0,
|
|
47
|
-
right: 0,
|
|
48
45
|
alignSelf: 'center',
|
|
49
|
-
|
|
46
|
+
paddingHorizontal: 12,
|
|
50
47
|
alignItems: 'center',
|
|
48
|
+
justifyContent: 'center',
|
|
51
49
|
zIndex: 9999
|
|
52
50
|
};
|
|
53
51
|
const $grabber = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","obj","__esModule","default","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","obj","__esModule","default","GRABBER_DEFAULT_HEIGHT","GRABBER_DEFAULT_WIDTH","GRABBER_DEFAULT_COLOR","TrueSheetGrabber","props","visible","color","width","height","topOffset","style","createElement","View","$wrapper","top","$grabber","backgroundColor","exports","position","alignSelf","paddingHorizontal","alignItems","justifyContent","zIndex","borderRadius"],"sourceRoot":"../../src","sources":["TrueSheetGrabber.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAoF,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEpF,MAAMG,sBAAsB,GAAG,CAAC;AAChC,MAAMC,qBAAqB,GAAG,EAAE;;AAEhC;AACA,MAAMC,qBAAqB,GAAG,oBAAoB;AAwClD;AACA;AACA;AACA;AACO,MAAMC,gBAAgB,GAAIC,KAA4B,IAAK;EAChE,MAAM;IACJC,OAAO,GAAG,IAAI;IACdC,KAAK,GAAGJ,qBAAqB;IAC7BK,KAAK,GAAGN,qBAAqB;IAC7BO,MAAM,GAAGR,sBAAsB;IAC/BS,SAAS,GAAG,CAAC;IACbC;EACF,CAAC,GAAGN,KAAK;EAET,IAAI,CAACC,OAAO,EAAE,OAAO,IAAI;EAEzB,oBACEZ,MAAA,CAAAM,OAAA,CAAAY,aAAA,CAACf,YAAA,CAAAgB,IAAI;IAACF,KAAK,EAAE,CAACG,QAAQ,EAAEH,KAAK,EAAE;MAAEF,MAAM,EAAER,sBAAsB,GAAG,CAAC;MAAEc,GAAG,EAAEL;IAAU,CAAC;EAAE,gBACrFhB,MAAA,CAAAM,OAAA,CAAAY,aAAA,CAACf,YAAA,CAAAgB,IAAI;IAACF,KAAK,EAAE,CAACK,QAAQ,EAAE;MAAEP,MAAM;MAAED,KAAK;MAAES,eAAe,EAAEV;IAAM,CAAC;EAAE,CAAE,CACjE,CAAC;AAEX,CAAC;AAAAW,OAAA,CAAAd,gBAAA,GAAAA,gBAAA;AAED,MAAMU,QAAmB,GAAG;EAC1BK,QAAQ,EAAE,UAAU;EACpBC,SAAS,EAAE,QAAQ;EACnBC,iBAAiB,EAAE,EAAE;EACrBC,UAAU,EAAE,QAAQ;EACpBC,cAAc,EAAE,QAAQ;EACxBC,MAAM,EAAE;AACV,CAAC;AAED,MAAMR,QAAmB,GAAG;EAC1BS,YAAY,EAAExB,sBAAsB,GAAG;AACzC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
-
const GRABBER_WRAPPER_HEIGHT = 24;
|
|
4
3
|
const GRABBER_DEFAULT_HEIGHT = 4;
|
|
5
4
|
const GRABBER_DEFAULT_WIDTH = 32;
|
|
6
|
-
const GRABBER_DEFAULT_TOP_OFFSET = 6;
|
|
7
5
|
|
|
8
6
|
// M3 spec: #49454F 0.4 alpha
|
|
9
7
|
const GRABBER_DEFAULT_COLOR = 'rgba(73,69,79,0.4)';
|
|
@@ -17,29 +15,29 @@ export const TrueSheetGrabber = props => {
|
|
|
17
15
|
color = GRABBER_DEFAULT_COLOR,
|
|
18
16
|
width = GRABBER_DEFAULT_WIDTH,
|
|
19
17
|
height = GRABBER_DEFAULT_HEIGHT,
|
|
20
|
-
topOffset =
|
|
18
|
+
topOffset = 0,
|
|
21
19
|
style
|
|
22
20
|
} = props;
|
|
23
21
|
if (!visible) return null;
|
|
24
22
|
return /*#__PURE__*/React.createElement(View, {
|
|
25
|
-
style: $wrapper
|
|
23
|
+
style: [$wrapper, style, {
|
|
24
|
+
height: GRABBER_DEFAULT_HEIGHT * 4,
|
|
25
|
+
top: topOffset
|
|
26
|
+
}]
|
|
26
27
|
}, /*#__PURE__*/React.createElement(View, {
|
|
27
28
|
style: [$grabber, {
|
|
28
29
|
height,
|
|
29
30
|
width,
|
|
30
|
-
backgroundColor: color
|
|
31
|
-
|
|
32
|
-
}, style]
|
|
31
|
+
backgroundColor: color
|
|
32
|
+
}]
|
|
33
33
|
}));
|
|
34
34
|
};
|
|
35
35
|
const $wrapper = {
|
|
36
36
|
position: 'absolute',
|
|
37
|
-
top: 0,
|
|
38
|
-
left: 0,
|
|
39
|
-
right: 0,
|
|
40
37
|
alignSelf: 'center',
|
|
41
|
-
|
|
38
|
+
paddingHorizontal: 12,
|
|
42
39
|
alignItems: 'center',
|
|
40
|
+
justifyContent: 'center',
|
|
43
41
|
zIndex: 9999
|
|
44
42
|
};
|
|
45
43
|
const $grabber = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","
|
|
1
|
+
{"version":3,"names":["React","View","GRABBER_DEFAULT_HEIGHT","GRABBER_DEFAULT_WIDTH","GRABBER_DEFAULT_COLOR","TrueSheetGrabber","props","visible","color","width","height","topOffset","style","createElement","$wrapper","top","$grabber","backgroundColor","position","alignSelf","paddingHorizontal","alignItems","justifyContent","zIndex","borderRadius"],"sourceRoot":"../../src","sources":["TrueSheetGrabber.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAyD,cAAc;AAEpF,MAAMC,sBAAsB,GAAG,CAAC;AAChC,MAAMC,qBAAqB,GAAG,EAAE;;AAEhC;AACA,MAAMC,qBAAqB,GAAG,oBAAoB;AAwClD;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAIC,KAA4B,IAAK;EAChE,MAAM;IACJC,OAAO,GAAG,IAAI;IACdC,KAAK,GAAGJ,qBAAqB;IAC7BK,KAAK,GAAGN,qBAAqB;IAC7BO,MAAM,GAAGR,sBAAsB;IAC/BS,SAAS,GAAG,CAAC;IACbC;EACF,CAAC,GAAGN,KAAK;EAET,IAAI,CAACC,OAAO,EAAE,OAAO,IAAI;EAEzB,oBACEP,KAAA,CAAAa,aAAA,CAACZ,IAAI;IAACW,KAAK,EAAE,CAACE,QAAQ,EAAEF,KAAK,EAAE;MAAEF,MAAM,EAAER,sBAAsB,GAAG,CAAC;MAAEa,GAAG,EAAEJ;IAAU,CAAC;EAAE,gBACrFX,KAAA,CAAAa,aAAA,CAACZ,IAAI;IAACW,KAAK,EAAE,CAACI,QAAQ,EAAE;MAAEN,MAAM;MAAED,KAAK;MAAEQ,eAAe,EAAET;IAAM,CAAC;EAAE,CAAE,CACjE,CAAC;AAEX,CAAC;AAED,MAAMM,QAAmB,GAAG;EAC1BI,QAAQ,EAAE,UAAU;EACpBC,SAAS,EAAE,QAAQ;EACnBC,iBAAiB,EAAE,EAAE;EACrBC,UAAU,EAAE,QAAQ;EACpBC,cAAc,EAAE,QAAQ;EACxBC,MAAM,EAAE;AACV,CAAC;AAED,MAAMP,QAAmB,GAAG;EAC1BQ,YAAY,EAAEtB,sBAAsB,GAAG;AACzC,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type ColorValue, type ViewStyle, type
|
|
2
|
+
import { type ColorValue, type ViewStyle, type StyleProp } from 'react-native';
|
|
3
3
|
export interface TrueSheetGrabberProps {
|
|
4
4
|
/**
|
|
5
5
|
* Is grabber visible.
|
|
@@ -19,18 +19,18 @@ export interface TrueSheetGrabberProps {
|
|
|
19
19
|
* Grabber height according to M3 specs.
|
|
20
20
|
* @default 4
|
|
21
21
|
*/
|
|
22
|
-
height?:
|
|
22
|
+
height?: number;
|
|
23
23
|
/**
|
|
24
24
|
* Grabber top position offset.
|
|
25
25
|
*
|
|
26
26
|
* @default 6
|
|
27
27
|
*/
|
|
28
|
-
topOffset?:
|
|
28
|
+
topOffset?: number;
|
|
29
29
|
/**
|
|
30
30
|
* Grabber width according to M3 specs.
|
|
31
31
|
* @default 32
|
|
32
32
|
*/
|
|
33
|
-
width?:
|
|
33
|
+
width?: number;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* Grabber component.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrueSheetGrabber.d.ts","sourceRoot":"","sources":["../../../src/TrueSheetGrabber.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,
|
|
1
|
+
{"version":3,"file":"TrueSheetGrabber.d.ts","sourceRoot":"","sources":["../../../src/TrueSheetGrabber.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAQ,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAQpF,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAE5B;;;OAGG;IACH,KAAK,CAAC,EAAE,UAAU,CAAA;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UAAW,qBAAqB,6BAiB5D,CAAA"}
|
package/package.json
CHANGED
package/src/TrueSheetGrabber.tsx
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
type ColorValue,
|
|
5
|
-
type ViewStyle,
|
|
6
|
-
type DimensionValue,
|
|
7
|
-
type StyleProp,
|
|
8
|
-
} from 'react-native'
|
|
2
|
+
import { View, type ColorValue, type ViewStyle, type StyleProp } from 'react-native'
|
|
9
3
|
|
|
10
|
-
const GRABBER_WRAPPER_HEIGHT = 24
|
|
11
4
|
const GRABBER_DEFAULT_HEIGHT = 4
|
|
12
5
|
const GRABBER_DEFAULT_WIDTH = 32
|
|
13
|
-
const GRABBER_DEFAULT_TOP_OFFSET = 6
|
|
14
6
|
|
|
15
7
|
// M3 spec: #49454F 0.4 alpha
|
|
16
8
|
const GRABBER_DEFAULT_COLOR = 'rgba(73,69,79,0.4)'
|
|
@@ -37,20 +29,20 @@ export interface TrueSheetGrabberProps {
|
|
|
37
29
|
* Grabber height according to M3 specs.
|
|
38
30
|
* @default 4
|
|
39
31
|
*/
|
|
40
|
-
height?:
|
|
32
|
+
height?: number
|
|
41
33
|
|
|
42
34
|
/**
|
|
43
35
|
* Grabber top position offset.
|
|
44
36
|
*
|
|
45
37
|
* @default 6
|
|
46
38
|
*/
|
|
47
|
-
topOffset?:
|
|
39
|
+
topOffset?: number
|
|
48
40
|
|
|
49
41
|
/**
|
|
50
42
|
* Grabber width according to M3 specs.
|
|
51
43
|
* @default 32
|
|
52
44
|
*/
|
|
53
|
-
width?:
|
|
45
|
+
width?: number
|
|
54
46
|
}
|
|
55
47
|
|
|
56
48
|
/**
|
|
@@ -63,27 +55,25 @@ export const TrueSheetGrabber = (props: TrueSheetGrabberProps) => {
|
|
|
63
55
|
color = GRABBER_DEFAULT_COLOR,
|
|
64
56
|
width = GRABBER_DEFAULT_WIDTH,
|
|
65
57
|
height = GRABBER_DEFAULT_HEIGHT,
|
|
66
|
-
topOffset =
|
|
58
|
+
topOffset = 0,
|
|
67
59
|
style,
|
|
68
60
|
} = props
|
|
69
61
|
|
|
70
62
|
if (!visible) return null
|
|
71
63
|
|
|
72
64
|
return (
|
|
73
|
-
<View style={$wrapper}>
|
|
74
|
-
<View style={[$grabber, { height, width, backgroundColor: color
|
|
65
|
+
<View style={[$wrapper, style, { height: GRABBER_DEFAULT_HEIGHT * 4, top: topOffset }]}>
|
|
66
|
+
<View style={[$grabber, { height, width, backgroundColor: color }]} />
|
|
75
67
|
</View>
|
|
76
68
|
)
|
|
77
69
|
}
|
|
78
70
|
|
|
79
71
|
const $wrapper: ViewStyle = {
|
|
80
72
|
position: 'absolute',
|
|
81
|
-
top: 0,
|
|
82
|
-
left: 0,
|
|
83
|
-
right: 0,
|
|
84
73
|
alignSelf: 'center',
|
|
85
|
-
|
|
74
|
+
paddingHorizontal: 12,
|
|
86
75
|
alignItems: 'center',
|
|
76
|
+
justifyContent: 'center',
|
|
87
77
|
zIndex: 9999,
|
|
88
78
|
}
|
|
89
79
|
|