@applicaster/quick-brick-core 13.0.0-rc.99 → 14.0.0-alpha.1216545755

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.
@@ -56,6 +56,7 @@ export class DraggableBottomSheet extends Component<Props, ComponentState> {
56
56
  _translateYOffset: Animated.Value;
57
57
  _translateY: Animated.AnimatedAddition;
58
58
  _snapPoints: SnapPoints;
59
+ _prevContentHeight = 0;
59
60
 
60
61
  _callWhenMounted: () => void | null;
61
62
 
@@ -89,6 +90,14 @@ export class DraggableBottomSheet extends Component<Props, ComponentState> {
89
90
  this._lastScrollY
90
91
  );
91
92
 
93
+ const initialSnapPoints = new SnapPoints(props.height, props.sheetHeight);
94
+
95
+ this._translateYOffset = new Animated.Value(
96
+ props.visible ? initialSnapPoints.top : initialSnapPoints.bottom
97
+ );
98
+
99
+ this._prevContentHeight = initialSnapPoints.contentHeight;
100
+
92
101
  this.state = {
93
102
  lastSnap: props.height,
94
103
  dragging: false,
@@ -150,12 +159,25 @@ export class DraggableBottomSheet extends Component<Props, ComponentState> {
150
159
 
151
160
  if (!this._snapPoints) {
152
161
  this._snapPoints = new SnapPoints(windowHeight, totalSheetHeight);
162
+ this._prevContentHeight = totalSheetHeight;
153
163
  } else {
154
164
  this._snapPoints.windowHeight = windowHeight;
155
165
  this._snapPoints.contentHeight = totalSheetHeight;
156
- }
157
166
 
158
- this._translateYOffset = new Animated.Value(this._snapPoints.bottom);
167
+ if (this.props.visible && this._isMounted) {
168
+ Animated.timing(this._translateYOffset, {
169
+ toValue: this._snapPoints.top,
170
+ duration: ANIMATION_DURATION,
171
+ easing: ANIMATION_EASING,
172
+ delay: ANIMATION_DELAY,
173
+ useNativeDriver: USE_NATIVE_DRIVER,
174
+ }).start();
175
+ } else {
176
+ this._translateYOffset.setValue(this._snapPoints.top);
177
+ }
178
+
179
+ this._prevContentHeight = totalSheetHeight;
180
+ }
159
181
 
160
182
  this._translateY = Animated.add(
161
183
  this._translateYOffset,
@@ -254,6 +276,7 @@ export class DraggableBottomSheet extends Component<Props, ComponentState> {
254
276
  getDraggableAreaStyles() {
255
277
  return {
256
278
  width: this.props.maxWidth,
279
+ top: 0,
257
280
  left: (this.props.width - this.props.maxWidth) / 2 || 0,
258
281
  };
259
282
  }
@@ -300,7 +323,6 @@ export class DraggableBottomSheet extends Component<Props, ComponentState> {
300
323
  simultaneousHandlers={this.drawer}
301
324
  >
302
325
  <Animated.ScrollView
303
- style={{ marginBottom: this._snapPoints.top }}
304
326
  bounces={false}
305
327
  onScrollBeginDrag={this._onRegisterLastScroll}
306
328
  scrollEventThrottle={1}
@@ -1,21 +1,33 @@
1
1
  import React from "react";
2
- import { StyleSheet, View } from "react-native";
2
+ import { LayoutChangeEvent, Platform, StyleSheet, View } from "react-native";
3
3
 
4
4
  import { Handle, HandleProps } from "./Handle";
5
5
  import { DraggableBottomSheet } from "./DraggableBottomSheet";
6
+ import {
7
+ SafeAreaView,
8
+ useSafeAreaFrame,
9
+ useSafeAreaInsets,
10
+ } from "react-native-safe-area-context";
11
+ import {
12
+ isAndroidPlatform,
13
+ isAndroidVersionAtLeast,
14
+ platformSelect,
15
+ } from "@applicaster/zapp-react-native-utils/reactUtils";
6
16
 
7
17
  type Props = {
8
18
  children: React.ReactChild;
9
19
  backgroundColor: string;
10
20
  cornerRadius: number;
11
- contentHeight: number;
12
21
  maxHeight: number;
13
22
  maxWidth: number;
14
23
  visible: boolean;
15
24
  handleProps: HandleProps;
16
25
  closeToast: () => void;
17
- dimensions: { width: number; height: number };
18
- paddingBottom: number;
26
+ dimensions: {
27
+ statusBarHeight: any;
28
+ width: number;
29
+ height: number;
30
+ };
19
31
  };
20
32
 
21
33
  const styles = StyleSheet.create({
@@ -25,6 +37,32 @@ const styles = StyleSheet.create({
25
37
  },
26
38
  });
27
39
 
40
+ const defaultBottomOffset = platformSelect({
41
+ ios: 34,
42
+ android: 0,
43
+ });
44
+
45
+ const getSheetHeight = ({ height, bottomOffset, maxHeight }) => {
46
+ return platformSelect({
47
+ ios: height - bottomOffset,
48
+ default:
49
+ (height || maxHeight) -
50
+ (!isAndroidVersionAtLeast(35) && isAndroidPlatform() ? bottomOffset : 0),
51
+ });
52
+ };
53
+
54
+ const useGetSheetHeight = (height, maxHeight) => {
55
+ const { bottom = defaultBottomOffset } = useSafeAreaInsets();
56
+
57
+ const bottomOffset = bottom;
58
+
59
+ return getSheetHeight({
60
+ height,
61
+ bottomOffset,
62
+ maxHeight,
63
+ });
64
+ };
65
+
28
66
  export function ModalBottomSheetFrame(props: Props) {
29
67
  const {
30
68
  children,
@@ -34,31 +72,50 @@ export function ModalBottomSheetFrame(props: Props) {
34
72
  maxWidth,
35
73
  visible,
36
74
  handleProps,
37
- contentHeight,
38
75
  dimensions,
39
- paddingBottom,
40
76
  } = props;
41
77
 
78
+ const safeAreaDims = useSafeAreaFrame();
79
+
42
80
  const extraStyles = {
43
81
  backgroundColor,
44
82
  borderTopLeftRadius: cornerRadius,
45
83
  borderTopRightRadius: cornerRadius,
46
84
  maxHeight,
47
- paddingBottom,
48
- maxWidth: Math.min(Number(maxWidth), dimensions.width),
85
+ maxWidth: Math.min(Number(maxWidth), safeAreaDims.width),
86
+ };
87
+
88
+ const [height, setHeight] = React.useState(0);
89
+
90
+ const onLayout = (event: LayoutChangeEvent) => {
91
+ const { height } = event.nativeEvent.layout;
92
+
93
+ if (height !== 0) {
94
+ setHeight(height);
95
+ }
49
96
  };
50
97
 
98
+ const { bottom = defaultBottomOffset } = useSafeAreaInsets();
99
+
100
+ const sheetHeight = useGetSheetHeight(height, maxHeight);
101
+
51
102
  return (
52
103
  <DraggableBottomSheet
53
- sheetHeight={contentHeight}
54
- visible={visible}
104
+ sheetHeight={sheetHeight}
105
+ visible={height > 0 && visible}
55
106
  dismiss={props.closeToast}
56
107
  hasHeader={handleProps.enabled}
57
108
  header={(dragging) => <Handle {...handleProps} focused={dragging} />}
58
109
  maxWidth={maxWidth}
59
110
  {...dimensions}
111
+ height={safeAreaDims.height - (Platform.OS === "ios" ? bottom : 0)}
60
112
  >
61
- <View style={[styles.toastFrameContainer, extraStyles]}>{children}</View>
113
+ <SafeAreaView
114
+ edges={["left", "right", "bottom"]}
115
+ style={[styles.toastFrameContainer, extraStyles]}
116
+ >
117
+ <View onLayout={onLayout}>{children}</View>
118
+ </SafeAreaView>
62
119
  </DraggableBottomSheet>
63
120
  );
64
121
  }
@@ -1,7 +1,5 @@
1
1
  /// <reference types="@applicaster/applicaster-types" />
2
2
  import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
3
- import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
4
- import { useSafeAreaInsets } from "react-native-safe-area-context";
5
3
 
6
4
  import React, { useCallback, useEffect, useState } from "react";
7
5
  import { Keyboard, StyleSheet, View } from "react-native";
@@ -29,56 +27,39 @@ type Props = {
29
27
  modalBottomSheetContentProps: Record<string, any>;
30
28
  };
31
29
 
32
- const defaultBottomOffset = platformSelect({
33
- ios: 34,
34
- android: 0,
35
- });
36
-
37
30
  export function ModalBottomSheet(props: Props) {
38
31
  const theme = useTheme<BaseThemePropertiesMobile>();
39
32
  const navigator = useNavigation();
40
33
  const dimensions = useDimensions();
41
- const [sheetHeight, setSheetHeight] = useState(0);
42
34
  const [visible, setVisible] = useState(true);
43
- const dismiss = () => setVisible(false);
44
- const { bottom = defaultBottomOffset } = useSafeAreaInsets();
45
-
46
- const bottomOffset = bottom + dimensions.statusBarHeight;
47
35
 
48
36
  const {
49
37
  modal_bottom_sheet_background_color: sheetBackgroundColor,
50
38
  modal_bottom_sheet_overlay_color: sheetOverlayColor,
51
39
  modal_bottom_sheet_top_corner_radius: sheetCornerRadius,
52
- modal_bottom_sheet_max_height: sheetMaxHeight,
53
40
  modal_bottom_sheet_handle: sheetHandleEnabled,
54
41
  modal_bottom_sheet_handle_color: sheetHandleColor,
55
42
  modal_bottom_sheet_handle_focus_color: sheetHandleFocusedColor,
56
43
  modal_bottom_sheet_tablet_max_width: sheetTabletMaxWidth,
57
44
  } = theme;
58
45
 
46
+ const sheetMaxHeight = dimensions.height * 0.75; // Set a default max height
47
+
59
48
  const {
60
49
  ModalBottomSheetContent = ModalComponent,
61
50
  modalBottomSheetContentProps,
62
51
  } = props;
63
52
 
64
- const onLayout = useCallback(({ nativeEvent }) => {
65
- const calculatedHeight = nativeEvent?.layout?.height;
66
-
67
- if (calculatedHeight > 0 && sheetHeight === 0) {
68
- setSheetHeight(Math.min(calculatedHeight, sheetMaxHeight));
69
- }
70
- }, []);
71
-
72
53
  useEffect(() => {
73
54
  Keyboard.dismiss();
74
55
  }, []);
75
56
 
57
+ const dismiss = useCallback(() => setVisible(false), []);
58
+
76
59
  const isTablet = useIsTablet();
77
60
 
78
61
  const maxWidth = isTablet ? sheetTabletMaxWidth : dimensions.width;
79
62
 
80
- const modalVisible = visible && sheetHeight > 0;
81
-
82
63
  return (
83
64
  <View style={styles.container}>
84
65
  <Overlay
@@ -89,12 +70,10 @@ export function ModalBottomSheet(props: Props) {
89
70
  <ModalBottomSheetFrame
90
71
  backgroundColor={sheetBackgroundColor}
91
72
  cornerRadius={sheetCornerRadius}
92
- contentHeight={sheetHeight + bottomOffset}
93
- maxHeight={sheetMaxHeight + bottomOffset}
94
- paddingBottom={bottomOffset}
73
+ maxHeight={sheetMaxHeight}
95
74
  maxWidth={maxWidth}
96
75
  dimensions={dimensions}
97
- visible={modalVisible}
76
+ visible={visible}
98
77
  closeToast={dismiss}
99
78
  handleProps={{
100
79
  enabled: sheetHandleEnabled,
@@ -102,18 +81,15 @@ export function ModalBottomSheet(props: Props) {
102
81
  focusedColor: sheetHandleFocusedColor,
103
82
  }}
104
83
  >
105
- <View onLayout={onLayout}>
106
- <ModalBottomSheetContent
107
- width={
108
- Math.min(sheetTabletMaxWidth, dimensions.width) ||
109
- dimensions.width
110
- }
111
- maxHeight={sheetMaxHeight}
112
- {...modalBottomSheetContentProps}
113
- dismiss={dismiss}
114
- currentRoute={navigator.currentRoute}
115
- />
116
- </View>
84
+ <ModalBottomSheetContent
85
+ width={
86
+ Math.min(sheetTabletMaxWidth, dimensions.width) || dimensions.width
87
+ }
88
+ maxHeight={sheetMaxHeight}
89
+ {...modalBottomSheetContentProps}
90
+ dismiss={dismiss}
91
+ currentRoute={navigator.currentRoute}
92
+ />
117
93
  </ModalBottomSheetFrame>
118
94
  </View>
119
95
  );
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { Modal, ModalProps } from "react-native";
3
3
 
4
- type Props = {
4
+ type Props = ModalProps & {
5
5
  children: React.ReactChild;
6
6
  ModalContainer?: React.FC<ModalProps> | React.ComponentClass<ModalProps>;
7
7
  visible: boolean;
@@ -40,7 +40,11 @@ export function ModalProvider() {
40
40
  return (
41
41
  <PathnameContext.Provider value={pathname}>
42
42
  <ScreenContextProvider pathname={pathname}>
43
- <ModalPresenter visible={shouldShowModal} {...modalState?.options}>
43
+ <ModalPresenter
44
+ visible={shouldShowModal}
45
+ {...modalState?.options}
46
+ statusBarTranslucent
47
+ >
44
48
  <ModalChildrenWrapper>
45
49
  <ModalContent modalScreenProps={modalScreenProps} />
46
50
  </ModalChildrenWrapper>
@@ -44,6 +44,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
44
44
  "supports_offline": false,
45
45
  "type": "general_content",
46
46
  },
47
+ "screenStateStore": [Function],
47
48
  },
48
49
  },
49
50
  "options": {
@@ -79,6 +80,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
79
80
  "supports_offline": false,
80
81
  "type": "general_content",
81
82
  },
83
+ "screenStateStore": undefined,
82
84
  },
83
85
  },
84
86
  ],
@@ -114,6 +116,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
114
116
  "supports_offline": false,
115
117
  "type": "general_content",
116
118
  },
119
+ "screenStateStore": [Function],
117
120
  },
118
121
  },
119
122
  "options": {
@@ -149,6 +152,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
149
152
  "supports_offline": false,
150
153
  "type": "general_content",
151
154
  },
155
+ "screenStateStore": undefined,
152
156
  },
153
157
  },
154
158
  {
@@ -180,6 +184,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
180
184
  "supports_offline": false,
181
185
  "type": "general_content",
182
186
  },
187
+ "screenStateStore": undefined,
183
188
  },
184
189
  },
185
190
  ],
@@ -215,6 +220,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
215
220
  "supports_offline": false,
216
221
  "type": "general_content",
217
222
  },
223
+ "screenStateStore": [Function],
218
224
  },
219
225
  },
220
226
  "options": {
@@ -250,6 +256,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
250
256
  "supports_offline": false,
251
257
  "type": "general_content",
252
258
  },
259
+ "screenStateStore": undefined,
253
260
  },
254
261
  },
255
262
  {
@@ -281,6 +288,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
281
288
  "supports_offline": false,
282
289
  "type": "general_content",
283
290
  },
291
+ "screenStateStore": undefined,
284
292
  },
285
293
  },
286
294
  {
@@ -312,6 +320,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
312
320
  "supports_offline": false,
313
321
  "type": "general_content",
314
322
  },
323
+ "screenStateStore": undefined,
315
324
  },
316
325
  },
317
326
  ],
@@ -348,6 +357,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
348
357
  "supports_offline": false,
349
358
  "type": "general_content",
350
359
  },
360
+ "screenStateStore": undefined,
351
361
  },
352
362
  },
353
363
  "options": {
@@ -383,6 +393,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
383
393
  "supports_offline": false,
384
394
  "type": "general_content",
385
395
  },
396
+ "screenStateStore": undefined,
386
397
  },
387
398
  },
388
399
  {
@@ -414,6 +425,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
414
425
  "supports_offline": false,
415
426
  "type": "general_content",
416
427
  },
428
+ "screenStateStore": undefined,
417
429
  },
418
430
  },
419
431
  ],
@@ -449,6 +461,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
449
461
  "supports_offline": false,
450
462
  "type": "general_content",
451
463
  },
464
+ "screenStateStore": [Function],
452
465
  },
453
466
  },
454
467
  "options": {
@@ -484,6 +497,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
484
497
  "supports_offline": false,
485
498
  "type": "general_content",
486
499
  },
500
+ "screenStateStore": undefined,
487
501
  },
488
502
  },
489
503
  {
@@ -515,6 +529,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
515
529
  "supports_offline": false,
516
530
  "type": "general_content",
517
531
  },
532
+ "screenStateStore": undefined,
518
533
  },
519
534
  },
520
535
  {
@@ -546,6 +561,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
546
561
  "supports_offline": false,
547
562
  "type": "general_content",
548
563
  },
564
+ "screenStateStore": undefined,
549
565
  },
550
566
  },
551
567
  ],
@@ -582,6 +598,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
582
598
  "supports_offline": false,
583
599
  "type": "general_content",
584
600
  },
601
+ "screenStateStore": undefined,
585
602
  },
586
603
  },
587
604
  "options": {
@@ -617,6 +634,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
617
634
  "supports_offline": false,
618
635
  "type": "general_content",
619
636
  },
637
+ "screenStateStore": undefined,
620
638
  },
621
639
  },
622
640
  {
@@ -648,6 +666,7 @@ exports[`reducer when a back action is dispatched push, back, push, back does wh
648
666
  "supports_offline": false,
649
667
  "type": "general_content",
650
668
  },
669
+ "screenStateStore": undefined,
651
670
  },
652
671
  },
653
672
  ],
@@ -5,6 +5,7 @@ import {
5
5
  firstStackEntriesSelector,
6
6
  previousStackEntriesSelector,
7
7
  } from "./selectors";
8
+ import { create, StoreApi, UseBoundStore } from "zustand";
8
9
 
9
10
  /* initial state */
10
11
 
@@ -120,12 +121,12 @@ export const setNestedContent = (
120
121
 
121
122
  const navigationEntry = (
122
123
  type: ActionValues,
123
- { route, screen, entry, key, options }: AnyRecord
124
+ { route, screen, entry, key, options, screenStateStore }: AnyRecord
124
125
  ) => ({
125
126
  key,
126
127
  action: type,
127
128
  route,
128
- state: { screen, entry, options },
129
+ state: { screen, entry, options, screenStateStore },
129
130
  });
130
131
 
131
132
  function updatePopActions(state) {
@@ -274,6 +275,25 @@ function locationReducer(
274
275
  ) {
275
276
  const { route, key, screen, entry, options } = payload;
276
277
 
278
+ const screenStateStore: UseBoundStore<StoreApi<ScreenStateStore>> =
279
+ create<ScreenStateStore>((set) => ({
280
+ data: {},
281
+ setValue: (key, value) =>
282
+ set((state) => ({
283
+ data: {
284
+ ...state.data,
285
+ [key]: value,
286
+ },
287
+ })),
288
+ removeValue: (key) =>
289
+ set((state) => {
290
+ const newData = { ...state.data };
291
+ delete newData[key];
292
+
293
+ return { data: newData };
294
+ }),
295
+ }));
296
+
277
297
  switch (type) {
278
298
  case ACTIONS.BACK:
279
299
  // eslint-disable-next-line no-case-declarations
@@ -294,14 +314,18 @@ function locationReducer(
294
314
  case ACTIONS.REPLACE:
295
315
  case ACTIONS.REPLACE_TOP:
296
316
  case ACTIONS.BACK_PLAYER_NESTED_CONTENT:
297
- return { pathname: route, state: { screen, entry, options }, key };
317
+ return {
318
+ pathname: route,
319
+ state: { screen, entry, options, screenStateStore },
320
+ key,
321
+ };
298
322
 
299
323
  case ACTIONS.SET_NESTED_CONTENT:
300
324
  // eslint-disable-next-line no-case-declarations
301
- const nestedEntry = navigationEntry(
302
- ACTIONS.REPLACE,
303
- payload as AnyRecord
304
- );
325
+ const nestedEntry = navigationEntry(ACTIONS.REPLACE, {
326
+ ...payload,
327
+ screenStateStore,
328
+ } as AnyRecord);
305
329
 
306
330
  return R.assocPath(["state", "nested"], nestedEntry.state, state);
307
331
  default:
package/README.md CHANGED
@@ -74,7 +74,7 @@ This function allows to quickly create a QuickBrick app by providing the require
74
74
 
75
75
  ## NavigationProvider
76
76
 
77
- This module provides routing, navigation and navBar control to the QuickBrick applications. The Navigator provider is constructed using NavigationContext and navigator object, which are exposed to the user by `withNavigator` Decorator and `useNavigation` hook. For keeping routing history Navigation Provider is using 3rd party library react-router that is used internally by the navigator.
77
+ This module provides routing, navigation and navBar control to the QuickBrick applications. The Navigator provider is constructed using NavigationContext and navigator object, which are exposed to the user by `withNavigator` Decorator and `useNavigation` hook.
78
78
 
79
79
  The app is already decorated with the Navigation Provider Context so the only thing, to use navigation in your screen/component`is to use`withNavigator`decorator or`useNavigationHook` directly
80
80
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/quick-brick-core",
3
- "version": "13.0.0-rc.99",
3
+ "version": "14.0.0-alpha.1216545755",
4
4
  "description": "Core package for Applicaster's Quick Brick App",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -28,13 +28,13 @@
28
28
  },
29
29
  "homepage": "https://github.com/applicaster/quickbrick#readme",
30
30
  "dependencies": {
31
- "@applicaster/applicaster-types": "13.0.0-rc.99",
32
- "@applicaster/quick-brick-core-plugins": "13.0.0-rc.99",
33
- "@applicaster/zapp-pipes-v2-client": "13.0.0-rc.99",
34
- "@applicaster/zapp-react-native-bridge": "13.0.0-rc.99",
35
- "@applicaster/zapp-react-native-redux": "13.0.0-rc.99",
36
- "@applicaster/zapp-react-native-ui-components": "13.0.0-rc.99",
37
- "@applicaster/zapp-react-native-utils": "13.0.0-rc.99",
31
+ "@applicaster/applicaster-types": "14.0.0-alpha.1216545755",
32
+ "@applicaster/quick-brick-core-plugins": "14.0.0-alpha.1216545755",
33
+ "@applicaster/zapp-pipes-v2-client": "14.0.0-alpha.1216545755",
34
+ "@applicaster/zapp-react-native-bridge": "14.0.0-alpha.1216545755",
35
+ "@applicaster/zapp-react-native-redux": "14.0.0-alpha.1216545755",
36
+ "@applicaster/zapp-react-native-ui-components": "14.0.0-alpha.1216545755",
37
+ "@applicaster/zapp-react-native-utils": "14.0.0-alpha.1216545755",
38
38
  "atob": "^2.1.2",
39
39
  "axios": "^0.28.0",
40
40
  "btoa": "^1.2.1",
@@ -1 +0,0 @@
1
- export { Fragment as ModalChildrenWrapper } from "react";