react-native-sheet2 6.1.16 → 6.1.18

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.
Files changed (2) hide show
  1. package/ios/SheetView.mm +17 -12
  2. package/package.json +1 -1
package/ios/SheetView.mm CHANGED
@@ -7,7 +7,12 @@
7
7
  #import <React/RCTConversions.h>
8
8
 
9
9
  #import "RCTFabricComponentsPlugins.h"
10
+
11
+ #if __has_include("Sheet-Swift.h")
12
+ #import "Sheet-Swift.h"
13
+ #else
10
14
  #import <Sheet/Sheet-Swift.h>
15
+ #endif
11
16
 
12
17
  using namespace facebook::react;
13
18
 
@@ -37,12 +42,12 @@ using namespace facebook::react;
37
42
  if (self = [super initWithFrame:frame]) {
38
43
  static const auto defaultProps = std::make_shared<const SheetViewProps>();
39
44
  _props = defaultProps;
40
-
45
+
41
46
  _view = [[UIView alloc] init];
42
47
  _view2 = [[HostFittedSheet alloc] init];
43
-
44
-
45
-
48
+
49
+
50
+
46
51
  __weak SheetView *weakSelf = self;
47
52
  _view2.onSheetDismiss = ^{
48
53
  NSLog(@"😀 ---- onSheetDismiss");
@@ -51,10 +56,10 @@ using namespace facebook::react;
51
56
  eventEmitter->onSheetDismiss({});
52
57
  }
53
58
  };
54
-
59
+
55
60
  self.contentView = _view2;
56
61
  }
57
-
62
+
58
63
  return self;
59
64
  }
60
65
 
@@ -63,7 +68,7 @@ using namespace facebook::react;
63
68
  NSLog(@"😀 updateProps");
64
69
  const auto &oldViewProps = *std::static_pointer_cast<SheetViewProps const>(_props);
65
70
  const auto &newViewProps = *std::static_pointer_cast<SheetViewProps const>(props);
66
-
71
+
67
72
  if (oldViewProps.maxWidth != newViewProps.maxWidth || oldViewProps.dismissable != newViewProps.dismissable || oldViewProps.topLeftRightCornerRadius != newViewProps.topLeftRightCornerRadius) {
68
73
  [_view2 setFittedSheetParams:@{
69
74
  @"maxWidth": @(newViewProps.maxWidth),
@@ -74,16 +79,16 @@ using namespace facebook::react;
74
79
 
75
80
  auto color = RCTUIColorFromSharedColor(newViewProps.sheetBackgroundColor);
76
81
  [_view2 setSheetBackgroundColor:color];
77
-
82
+
78
83
  if (oldViewProps.passScrollViewReactTag != newViewProps.passScrollViewReactTag) {
79
84
  [_view2 setPassScrollViewReactTag];
80
85
  }
81
-
82
-
86
+
87
+
83
88
  NSLog(@"----- %f", newViewProps.calculatedHeight);
84
89
  [_view2 setCalculatedHeight:newViewProps.calculatedHeight];
85
-
86
-
90
+
91
+
87
92
  [super updateProps:props oldProps:oldProps];
88
93
  }
89
94
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-sheet2",
3
- "version": "6.1.16",
3
+ "version": "6.1.18",
4
4
  "description": "Native implementation of Bottom sheet",
5
5
  "main": "src/index.tsx",
6
6
  "module": "src/index",