@@ -25,17 +25,36 @@ const BottomSheetComponent = props => {
25
25
} ;
26
26
27
27
class BottomSheetModal extends React . Component {
28
+ // Store mock data passed via present
29
+ data = null ;
30
+
28
31
snapToIndex ( ) { }
29
32
snapToPosition ( ) { }
30
33
expand ( ) { }
31
34
collapse ( ) { }
32
- close ( ) { }
33
- forceClose ( ) { }
34
- present ( ) { }
35
- dismiss ( ) { }
35
+ close ( ) {
36
+ this . data = null ;
37
+ }
38
+ forceClose ( ) {
39
+ this . data = null ;
40
+ }
41
+ present ( data ) {
42
+ // Store data passed to present
43
+ this . data = data ;
44
+ // Need to trigger a re-render somehow if component depends on this state,
45
+ // but for basic mock, just storing is often enough.
46
+ }
47
+ dismiss ( ) {
48
+ this . data = null ;
49
+ }
36
50
37
51
render ( ) {
38
- return this . props . children ;
52
+ const { children : Content } = this . props ;
53
+ return typeof Content === 'function' ? (
54
+ < Content data = { this . data } />
55
+ ) : (
56
+ Content
57
+ ) ;
39
58
}
40
59
}
41
60
@@ -103,6 +122,85 @@ const useBottomSheetDynamicSnapPoints = () => ({
103
122
handleContentLayout : NOOP ,
104
123
} ) ;
105
124
125
+ const GESTURE_SOURCE = {
126
+ UNDETERMINED : 0 ,
127
+ SCROLLABLE : 1 ,
128
+ HANDLE : 2 ,
129
+ CONTENT : 3 ,
130
+ } ;
131
+
132
+ const SHEET_STATE = {
133
+ CLOSED : 0 ,
134
+ OPENED : 1 ,
135
+ EXTENDED : 2 ,
136
+ OVER_EXTENDED : 3 ,
137
+ FILL_PARENT : 4 ,
138
+ } ;
139
+
140
+ const SCROLLABLE_STATE = {
141
+ LOCKED : 0 ,
142
+ UNLOCKED : 1 ,
143
+ UNDETERMINED : 2 ,
144
+ } ;
145
+
146
+ const SCROLLABLE_TYPE = {
147
+ UNDETERMINED : 0 ,
148
+ VIEW : 1 ,
149
+ FLATLIST : 2 ,
150
+ SCROLLVIEW : 3 ,
151
+ SECTIONLIST : 4 ,
152
+ VIRTUALIZEDLIST : 5 ,
153
+ } ;
154
+
155
+ const ANIMATION_STATE = {
156
+ UNDETERMINED : 0 ,
157
+ RUNNING : 1 ,
158
+ STOPPED : 2 ,
159
+ INTERRUPTED : 3 ,
160
+ } ;
161
+
162
+ const ANIMATION_SOURCE = {
163
+ NONE : 0 ,
164
+ MOUNT : 1 ,
165
+ GESTURE : 2 ,
166
+ USER : 3 ,
167
+ CONTAINER_RESIZE : 4 ,
168
+ SNAP_POINT_CHANGE : 5 ,
169
+ KEYBOARD : 6 ,
170
+ } ;
171
+
172
+ const ANIMATION_METHOD = {
173
+ TIMING : 0 ,
174
+ SPRING : 1 ,
175
+ } ;
176
+
177
+ const KEYBOARD_STATE = {
178
+ UNDETERMINED : 0 ,
179
+ SHOWN : 1 ,
180
+ HIDDEN : 2 ,
181
+ } ;
182
+
183
+ const SNAP_POINT_TYPE = {
184
+ PROVIDED : 0 ,
185
+ DYNAMIC : 1 ,
186
+ } ;
187
+
188
+ const ENUMS = {
189
+ GESTURE_SOURCE ,
190
+ SHEET_STATE ,
191
+ SCROLLABLE_STATE ,
192
+ SCROLLABLE_TYPE ,
193
+ ANIMATION_STATE ,
194
+ ANIMATION_SOURCE ,
195
+ ANIMATION_METHOD ,
196
+ KEYBOARD_STATE ,
197
+ SNAP_POINT_TYPE ,
198
+ } ;
199
+
200
+ const createBottomSheetScrollableComponent = ( _type , ScrollableComponent ) => {
201
+ return ScrollableComponent ;
202
+ } ;
203
+
106
204
module . exports = {
107
205
BottomSheetView : BottomSheetComponent ,
108
206
BottomSheetTextInput : ReactNative . TextInput ,
@@ -129,4 +227,7 @@ module.exports = {
129
227
useBottomSheetInternal,
130
228
useBottomSheetModalInternal,
131
229
useBottomSheetDynamicSnapPoints,
230
+
231
+ ...ENUMS ,
232
+ createBottomSheetScrollableComponent,
132
233
} ;
0 commit comments