react-native-screens 3.13.1 → 3.14.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 +2 -2
- package/RNScreens.podspec +5 -4
- package/android/build.gradle +18 -1
- package/android/src/main/java/com/swmansion/rnscreens/ScreenStack.kt +8 -4
- package/android/src/main/java/com/swmansion/rnscreens/ScreenViewManager.kt +24 -6
- package/android/src/main/java/com/swmansion/rnscreens/ScreenWindowTraits.kt +14 -18
- package/android/src/main/jni/Android.mk +1 -2
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerDelegate.java +39 -14
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenManagerInterface.java +15 -6
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerDelegate.java +3 -3
- package/android/src/paper/java/com/facebook/react/viewmanagers/RNSScreenStackHeaderConfigManagerInterface.java +1 -1
- package/common/cpp/Android.mk +1 -2
- package/createNativeStackNavigator/README.md +4 -0
- package/ios/RNSConvert.h +30 -0
- package/ios/RNSConvert.mm +120 -0
- package/ios/RNSEnums.h +59 -0
- package/ios/RNSFullWindowOverlay.h +17 -2
- package/ios/RNSFullWindowOverlay.mm +199 -0
- package/ios/RNSScreen.h +70 -79
- package/ios/{RNSScreen.m → RNSScreen.mm} +679 -302
- package/ios/RNSScreenContainer.h +15 -1
- package/ios/{RNSScreenContainer.m → RNSScreenContainer.mm} +99 -8
- package/ios/{RNSScreenNavigationContainer.m → RNSScreenNavigationContainer.mm} +22 -0
- package/ios/RNSScreenStack.h +19 -3
- package/ios/{RNSScreenStack.m → RNSScreenStack.mm} +377 -126
- package/ios/{RNSScreenStackAnimator.m → RNSScreenStackAnimator.mm} +19 -14
- package/ios/RNSScreenStackHeaderConfig.h +20 -21
- package/ios/{RNSScreenStackHeaderConfig.m → RNSScreenStackHeaderConfig.mm} +232 -117
- package/ios/RNSScreenStackHeaderSubview.h +45 -0
- package/ios/RNSScreenStackHeaderSubview.mm +137 -0
- package/ios/RNSScreenViewEvent.h +12 -0
- package/ios/RNSScreenViewEvent.mm +59 -0
- package/ios/{RNSScreenWindowTraits.m → RNSScreenWindowTraits.mm} +3 -2
- package/ios/RNSSearchBar.h +14 -1
- package/ios/RNSSearchBar.mm +351 -0
- package/ios/{UIViewController+RNScreens.m → UIViewController+RNScreens.mm} +0 -0
- package/ios/{UIWindow+RNScreens.m → UIWindow+RNScreens.mm} +0 -0
- package/lib/commonjs/fabric/FullWindowOverlay.js +26 -0
- package/lib/commonjs/fabric/FullWindowOverlay.js.map +1 -0
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js +21 -0
- package/lib/commonjs/fabric/FullWindowOverlayNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenContainer.js +28 -0
- package/lib/commonjs/fabric/ScreenContainer.js.map +1 -0
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js +21 -0
- package/lib/commonjs/fabric/ScreenContainerNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenNavigationContainer.js +28 -0
- package/lib/commonjs/fabric/ScreenNavigationContainer.js.map +1 -0
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js +21 -0
- package/lib/commonjs/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/commonjs/fabric/SearchBar.js +37 -0
- package/lib/commonjs/fabric/SearchBar.js.map +1 -0
- package/lib/commonjs/fabric/SearchBarNativeComponent.js +25 -0
- package/lib/commonjs/fabric/SearchBarNativeComponent.js.map +1 -0
- package/lib/commonjs/fabric/index.js +32 -0
- package/lib/commonjs/fabric/index.js.map +1 -1
- package/lib/commonjs/index.native.js +5 -18
- package/lib/commonjs/index.native.js.map +1 -1
- package/lib/commonjs/native-stack/views/NativeStackView.js +30 -0
- package/lib/commonjs/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js +8 -2
- package/lib/commonjs/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/module/fabric/FullWindowOverlay.js +15 -0
- package/lib/module/fabric/FullWindowOverlay.js.map +1 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js +9 -0
- package/lib/module/fabric/FullWindowOverlayNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenContainer.js +17 -0
- package/lib/module/fabric/ScreenContainer.js.map +1 -0
- package/lib/module/fabric/ScreenContainerNativeComponent.js +9 -0
- package/lib/module/fabric/ScreenContainerNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenNavigationContainer.js +17 -0
- package/lib/module/fabric/ScreenNavigationContainer.js.map +1 -0
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js +9 -0
- package/lib/module/fabric/ScreenNavigationContainerNativeComponent.js.map +1 -0
- package/lib/module/fabric/ScreenStackHeaderConfigNativeComponent.js.map +1 -1
- package/lib/module/fabric/ScreenStackNativeComponent.js.map +1 -1
- package/lib/module/fabric/SearchBar.js +24 -0
- package/lib/module/fabric/SearchBar.js.map +1 -0
- package/lib/module/fabric/SearchBarNativeComponent.js +11 -0
- package/lib/module/fabric/SearchBarNativeComponent.js.map +1 -0
- package/lib/module/fabric/index.js +5 -1
- package/lib/module/fabric/index.js.map +1 -1
- package/lib/module/index.native.js +6 -20
- package/lib/module/index.native.js.map +1 -1
- package/lib/module/native-stack/views/NativeStackView.js +30 -0
- package/lib/module/native-stack/views/NativeStackView.js.map +1 -1
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js +7 -2
- package/lib/module/reanimated/ReanimatedNativeStackScreen.js.map +1 -1
- package/lib/typescript/native-stack/types.d.ts +12 -0
- package/lib/typescript/reanimated/ReanimatedNativeStackScreen.d.ts +1 -1
- package/lib/typescript/reanimated/ReanimatedScreen.d.ts +1 -1
- package/lib/typescript/types.d.ts +24 -0
- package/native-stack/README.md +21 -0
- package/package.json +2 -2
- package/src/fabric/FullWindowOverlay.js +13 -0
- package/src/fabric/FullWindowOverlayNativeComponent.js +19 -0
- package/src/fabric/ScreenContainer.js +16 -0
- package/src/fabric/ScreenContainerNativeComponent.js +19 -0
- package/src/fabric/ScreenNativeComponent.js +41 -8
- package/src/fabric/ScreenNavigationContainer.js +16 -0
- package/src/fabric/ScreenNavigationContainerNativeComponent.js +19 -0
- package/src/fabric/ScreenStackHeaderConfigNativeComponent.js +1 -1
- package/src/fabric/ScreenStackNativeComponent.js +4 -0
- package/src/fabric/SearchBar.js +20 -0
- package/src/fabric/SearchBarNativeComponent.js +62 -0
- package/src/fabric/index.js +8 -0
- package/src/index.native.tsx +13 -19
- package/src/native-stack/types.tsx +12 -0
- package/src/native-stack/views/NativeStackView.tsx +27 -0
- package/src/reanimated/ReanimatedNativeStackScreen.tsx +6 -0
- package/src/types.tsx +25 -0
- package/ios/RNSFullWindowOverlay.m +0 -105
- package/ios/RNSScreenComponentView.h +0 -23
- package/ios/RNSScreenComponentView.mm +0 -159
- package/ios/RNSScreenController.h +0 -10
- package/ios/RNSScreenController.mm +0 -79
- package/ios/RNSScreenStackComponentView.h +0 -15
- package/ios/RNSScreenStackComponentView.mm +0 -295
- package/ios/RNSScreenStackHeaderConfigComponentView.h +0 -42
- package/ios/RNSScreenStackHeaderConfigComponentView.mm +0 -662
- package/ios/RNSScreenStackHeaderSubviewComponentView.h +0 -14
- package/ios/RNSScreenStackHeaderSubviewComponentView.mm +0 -77
- package/ios/RNSSearchBar.m +0 -198
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
#import "RNSScreenStackHeaderSubview.h"
|
|
2
|
+
#import "RNSConvert.h"
|
|
3
|
+
|
|
4
|
+
#ifdef RN_FABRIC_ENABLED
|
|
5
|
+
#import <react/renderer/components/rnscreens/ComponentDescriptors.h>
|
|
6
|
+
#import <react/renderer/components/rnscreens/EventEmitters.h>
|
|
7
|
+
#import <react/renderer/components/rnscreens/RCTComponentViewHelpers.h>
|
|
8
|
+
|
|
9
|
+
#import <React/RCTConversions.h>
|
|
10
|
+
#import "RCTFabricComponentsPlugins.h"
|
|
11
|
+
#endif
|
|
12
|
+
|
|
13
|
+
@implementation RNSScreenStackHeaderSubview
|
|
14
|
+
|
|
15
|
+
#pragma mark - Common
|
|
16
|
+
|
|
17
|
+
#ifdef RN_FABRIC_ENABLED
|
|
18
|
+
|
|
19
|
+
#pragma mark - Fabric specific
|
|
20
|
+
|
|
21
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
22
|
+
{
|
|
23
|
+
if (self = [super initWithFrame:frame]) {
|
|
24
|
+
static const auto defaultProps = std::make_shared<const facebook::react::RNSScreenStackHeaderSubviewProps>();
|
|
25
|
+
_props = defaultProps;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return self;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#pragma mark - RCTComponentViewProtocol
|
|
32
|
+
|
|
33
|
+
- (void)prepareForRecycle
|
|
34
|
+
{
|
|
35
|
+
[super prepareForRecycle];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
- (void)updateProps:(facebook::react::Props::Shared const &)props
|
|
39
|
+
oldProps:(facebook::react::Props::Shared const &)oldProps
|
|
40
|
+
{
|
|
41
|
+
const auto &newHeaderSubviewProps =
|
|
42
|
+
*std::static_pointer_cast<const facebook::react::RNSScreenStackHeaderSubviewProps>(props);
|
|
43
|
+
const auto &oldHeaderSubviewProps =
|
|
44
|
+
*std::static_pointer_cast<const facebook::react::RNSScreenStackHeaderSubviewProps>(_props);
|
|
45
|
+
|
|
46
|
+
if (newHeaderSubviewProps.type != oldHeaderSubviewProps.type) {
|
|
47
|
+
_type = [RNSConvert RNSScreenStackHeaderSubviewTypeFromCppEquivalent:newHeaderSubviewProps.type];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
[super updateProps:props oldProps:oldProps];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
+ (facebook::react::ComponentDescriptorProvider)componentDescriptorProvider
|
|
54
|
+
{
|
|
55
|
+
return facebook::react::concreteComponentDescriptorProvider<
|
|
56
|
+
facebook::react::RNSScreenStackHeaderSubviewComponentDescriptor>();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
- (void)updateLayoutMetrics:(const facebook::react::LayoutMetrics &)layoutMetrics
|
|
60
|
+
oldLayoutMetrics:(const facebook::react::LayoutMetrics &)oldLayoutMetrics
|
|
61
|
+
{
|
|
62
|
+
CGRect frame = RCTCGRectFromRect(layoutMetrics.frame);
|
|
63
|
+
// CALayer will crash if we pass NaN or Inf values.
|
|
64
|
+
// It's unclear how to detect this case on cross-platform manner holistically, so we have to do it on the mounting
|
|
65
|
+
// layer as well. NaN/Inf is a kinda valid result of some math operations. Even if we can (and should) detect (and
|
|
66
|
+
// report early) incorrect (NaN and Inf) values which come from JavaScript side, we sometimes cannot backtrace the
|
|
67
|
+
// sources of a calculation that produced an incorrect/useless result.
|
|
68
|
+
if (!std::isfinite(frame.size.width) || !std::isfinite(frame.size.height)) {
|
|
69
|
+
RCTLogWarn(
|
|
70
|
+
@"-[UIView(ComponentViewProtocol) updateLayoutMetrics:oldLayoutMetrics:]: Received invalid layout metrics (%@) for a view (%@).",
|
|
71
|
+
NSStringFromCGRect(frame),
|
|
72
|
+
self);
|
|
73
|
+
} else {
|
|
74
|
+
self.bounds = CGRect{CGPointZero, frame.size};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
#else
|
|
79
|
+
#pragma mark - Paper specific
|
|
80
|
+
|
|
81
|
+
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
82
|
+
{
|
|
83
|
+
if (self = [super init]) {
|
|
84
|
+
_bridge = bridge;
|
|
85
|
+
}
|
|
86
|
+
return self;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
- (void)reactSetFrame:(CGRect)frame
|
|
90
|
+
{
|
|
91
|
+
// Block any attempt to set coordinates on RNSScreenStackHeaderSubview. This
|
|
92
|
+
// makes UINavigationBar the only one to control the position of header content.
|
|
93
|
+
[super reactSetFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
#endif // RN_FABRIC_ENABLED
|
|
97
|
+
@end
|
|
98
|
+
|
|
99
|
+
@implementation RNSScreenStackHeaderSubviewManager
|
|
100
|
+
|
|
101
|
+
RCT_EXPORT_MODULE()
|
|
102
|
+
|
|
103
|
+
RCT_EXPORT_VIEW_PROPERTY(type, RNSScreenStackHeaderSubviewType)
|
|
104
|
+
|
|
105
|
+
#ifdef RN_FABRIC_ENABLED
|
|
106
|
+
#else
|
|
107
|
+
- (UIView *)view
|
|
108
|
+
{
|
|
109
|
+
return [[RNSScreenStackHeaderSubview alloc] initWithBridge:self.bridge];
|
|
110
|
+
}
|
|
111
|
+
#endif
|
|
112
|
+
|
|
113
|
+
@end
|
|
114
|
+
|
|
115
|
+
#ifdef RN_FABRIC_ENABLED
|
|
116
|
+
Class<RCTComponentViewProtocol> RNSScreenStackHeaderSubviewCls(void)
|
|
117
|
+
{
|
|
118
|
+
return RNSScreenStackHeaderSubview.class;
|
|
119
|
+
}
|
|
120
|
+
#endif
|
|
121
|
+
|
|
122
|
+
@implementation RCTConvert (RNSScreenStackHeaderSubview)
|
|
123
|
+
|
|
124
|
+
RCT_ENUM_CONVERTER(
|
|
125
|
+
RNSScreenStackHeaderSubviewType,
|
|
126
|
+
(@{
|
|
127
|
+
@"back" : @(RNSScreenStackHeaderSubviewTypeBackButton),
|
|
128
|
+
@"left" : @(RNSScreenStackHeaderSubviewTypeLeft),
|
|
129
|
+
@"right" : @(RNSScreenStackHeaderSubviewTypeRight),
|
|
130
|
+
@"title" : @(RNSScreenStackHeaderSubviewTypeTitle),
|
|
131
|
+
@"center" : @(RNSScreenStackHeaderSubviewTypeCenter),
|
|
132
|
+
@"searchBar" : @(RNSScreenStackHeaderSubviewTypeSearchBar),
|
|
133
|
+
}),
|
|
134
|
+
RNSScreenStackHeaderSubviewTypeTitle,
|
|
135
|
+
integerValue)
|
|
136
|
+
|
|
137
|
+
@end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#import <React/RCTBridge+Private.h>
|
|
2
|
+
#import <React/RCTEventDispatcherProtocol.h>
|
|
3
|
+
|
|
4
|
+
@interface RNSScreenViewEvent : NSObject <RCTEvent>
|
|
5
|
+
|
|
6
|
+
- (instancetype)initWithEventName:(NSString *)eventName
|
|
7
|
+
reactTag:(NSNumber *)reactTag
|
|
8
|
+
progress:(double)progress
|
|
9
|
+
closing:(int)closing
|
|
10
|
+
goingForward:(int)goingForward;
|
|
11
|
+
|
|
12
|
+
@end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#import "RNSScreenViewEvent.h"
|
|
2
|
+
#import <React/RCTAssert.h>
|
|
3
|
+
|
|
4
|
+
@implementation RNSScreenViewEvent {
|
|
5
|
+
double _progress;
|
|
6
|
+
int _closing;
|
|
7
|
+
int _goingForward;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@synthesize viewTag = _viewTag;
|
|
11
|
+
@synthesize eventName = _eventName;
|
|
12
|
+
|
|
13
|
+
- (instancetype)initWithEventName:(NSString *)eventName
|
|
14
|
+
reactTag:(NSNumber *)reactTag
|
|
15
|
+
progress:(double)progress
|
|
16
|
+
closing:(int)closing
|
|
17
|
+
goingForward:(int)goingForward
|
|
18
|
+
{
|
|
19
|
+
RCTAssertParam(reactTag);
|
|
20
|
+
|
|
21
|
+
if ((self = [super init])) {
|
|
22
|
+
_eventName = [eventName copy];
|
|
23
|
+
_viewTag = reactTag;
|
|
24
|
+
_progress = progress;
|
|
25
|
+
_closing = closing;
|
|
26
|
+
_goingForward = goingForward;
|
|
27
|
+
}
|
|
28
|
+
return self;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
|
32
|
+
|
|
33
|
+
- (NSDictionary *)body
|
|
34
|
+
{
|
|
35
|
+
NSDictionary *body = @{
|
|
36
|
+
@"progress" : @(_progress),
|
|
37
|
+
@"closing" : @(_closing ? 1 : 0),
|
|
38
|
+
@"goingForward" : @(_goingForward ? 1 : 0),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return body;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
- (BOOL)canCoalesce
|
|
45
|
+
{
|
|
46
|
+
return NO;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
+ (NSString *)moduleDotMethod
|
|
50
|
+
{
|
|
51
|
+
return @"RCTEventEmitter.receiveEvent";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
- (NSArray *)arguments
|
|
55
|
+
{
|
|
56
|
+
return @[ self.viewTag, RCTNormalizeInputEventName(self.eventName), [self body] ];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@end
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#import "RNSScreenWindowTraits.h"
|
|
2
|
-
#import "RNSScreen.h"
|
|
3
2
|
#import "RNSScreenContainer.h"
|
|
4
3
|
#import "RNSScreenStack.h"
|
|
5
4
|
|
|
@@ -56,7 +55,9 @@
|
|
|
56
55
|
} else
|
|
57
56
|
#endif
|
|
58
57
|
{
|
|
59
|
-
|
|
58
|
+
if (@available(iOS 11.0, *)) {
|
|
59
|
+
[UIApplication.sharedApplication.keyWindow.rootViewController setNeedsUpdateOfHomeIndicatorAutoHidden];
|
|
60
|
+
}
|
|
60
61
|
}
|
|
61
62
|
#endif
|
|
62
63
|
}
|
package/ios/RNSSearchBar.h
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
#import <UIKit/UIKit.h>
|
|
2
2
|
|
|
3
|
+
#ifdef RN_FABRIC_ENABLED
|
|
4
|
+
#import <React/RCTViewComponentView.h>
|
|
5
|
+
#endif
|
|
6
|
+
|
|
3
7
|
#import <React/RCTBridge.h>
|
|
4
8
|
#import <React/RCTComponent.h>
|
|
5
9
|
#import <React/RCTViewManager.h>
|
|
6
10
|
|
|
7
|
-
@interface RNSSearchBar :
|
|
11
|
+
@interface RNSSearchBar :
|
|
12
|
+
#ifdef RN_FABRIC_ENABLED
|
|
13
|
+
RCTViewComponentView <UISearchBarDelegate>
|
|
14
|
+
#else
|
|
15
|
+
UIView <UISearchBarDelegate>
|
|
16
|
+
#endif
|
|
8
17
|
|
|
9
18
|
@property (nonatomic) BOOL hideWhenScrolling;
|
|
10
19
|
|
|
11
20
|
@property (nonatomic, retain) UISearchController *controller;
|
|
21
|
+
|
|
22
|
+
#ifdef RN_FABRIC_ENABLED
|
|
23
|
+
#else
|
|
12
24
|
@property (nonatomic, copy) RCTBubblingEventBlock onChangeText;
|
|
13
25
|
@property (nonatomic, copy) RCTBubblingEventBlock onCancelButtonPress;
|
|
14
26
|
@property (nonatomic, copy) RCTBubblingEventBlock onSearchButtonPress;
|
|
15
27
|
@property (nonatomic, copy) RCTBubblingEventBlock onFocus;
|
|
16
28
|
@property (nonatomic, copy) RCTBubblingEventBlock onBlur;
|
|
29
|
+
#endif
|
|
17
30
|
|
|
18
31
|
@end
|
|
19
32
|
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
|
|
3
|
+
#import "RNSSearchBar.h"
|
|
4
|
+
|
|
5
|
+
#import <React/RCTBridge.h>
|
|
6
|
+
#import <React/RCTComponent.h>
|
|
7
|
+
#import <React/RCTUIManager.h>
|
|
8
|
+
|
|
9
|
+
#ifdef RN_FABRIC_ENABLED
|
|
10
|
+
#import <React/RCTConversions.h>
|
|
11
|
+
#import <react/renderer/components/rnscreens/ComponentDescriptors.h>
|
|
12
|
+
#import <react/renderer/components/rnscreens/EventEmitters.h>
|
|
13
|
+
#import <react/renderer/components/rnscreens/Props.h>
|
|
14
|
+
#import <react/renderer/components/rnscreens/RCTComponentViewHelpers.h>
|
|
15
|
+
#import "RCTFabricComponentsPlugins.h"
|
|
16
|
+
#import "RNSConvert.h"
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
@implementation RNSSearchBar {
|
|
20
|
+
__weak RCTBridge *_bridge;
|
|
21
|
+
UISearchController *_controller;
|
|
22
|
+
UIColor *_textColor;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@synthesize controller = _controller;
|
|
26
|
+
|
|
27
|
+
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
28
|
+
{
|
|
29
|
+
if (self = [super init]) {
|
|
30
|
+
_bridge = bridge;
|
|
31
|
+
[self initCommonProps];
|
|
32
|
+
}
|
|
33
|
+
return self;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
#ifdef RN_FABRIC_ENABLED
|
|
37
|
+
- (instancetype)init
|
|
38
|
+
{
|
|
39
|
+
if (self = [super init]) {
|
|
40
|
+
static const auto defaultProps = std::make_shared<const facebook::react::RNSSearchBarProps>();
|
|
41
|
+
_props = defaultProps;
|
|
42
|
+
[self initCommonProps];
|
|
43
|
+
}
|
|
44
|
+
return self;
|
|
45
|
+
}
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
- (void)initCommonProps
|
|
49
|
+
{
|
|
50
|
+
_controller = [[UISearchController alloc] initWithSearchResultsController:nil];
|
|
51
|
+
_controller.searchBar.delegate = self;
|
|
52
|
+
_hideWhenScrolling = YES;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
- (void)emitOnFocusEvent
|
|
56
|
+
{
|
|
57
|
+
#ifdef RN_FABRIC_ENABLED
|
|
58
|
+
if (_eventEmitter != nullptr) {
|
|
59
|
+
std::dynamic_pointer_cast<const facebook::react::RNSSearchBarEventEmitter>(_eventEmitter)
|
|
60
|
+
->onFocus(facebook::react::RNSSearchBarEventEmitter::OnFocus{});
|
|
61
|
+
}
|
|
62
|
+
#else
|
|
63
|
+
if (self.onFocus) {
|
|
64
|
+
self.onFocus(@{});
|
|
65
|
+
}
|
|
66
|
+
#endif
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
- (void)emitOnBlurEvent
|
|
70
|
+
{
|
|
71
|
+
#ifdef RN_FABRIC_ENABLED
|
|
72
|
+
if (_eventEmitter != nullptr) {
|
|
73
|
+
std::dynamic_pointer_cast<const facebook::react::RNSSearchBarEventEmitter>(_eventEmitter)
|
|
74
|
+
->onBlur(facebook::react::RNSSearchBarEventEmitter::OnBlur{});
|
|
75
|
+
}
|
|
76
|
+
#else
|
|
77
|
+
if (self.onBlur) {
|
|
78
|
+
self.onBlur(@{});
|
|
79
|
+
}
|
|
80
|
+
#endif
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
- (void)emitOnSearchButtonPressEventWithText:(NSString *)text
|
|
84
|
+
{
|
|
85
|
+
#ifdef RN_FABRIC_ENABLED
|
|
86
|
+
if (_eventEmitter != nullptr) {
|
|
87
|
+
std::dynamic_pointer_cast<const facebook::react::RNSSearchBarEventEmitter>(_eventEmitter)
|
|
88
|
+
->onSearchButtonPress(
|
|
89
|
+
facebook::react::RNSSearchBarEventEmitter::OnSearchButtonPress{.text = RCTStringFromNSString(text)});
|
|
90
|
+
}
|
|
91
|
+
#else
|
|
92
|
+
if (self.onSearchButtonPress) {
|
|
93
|
+
self.onSearchButtonPress(@{
|
|
94
|
+
@"text" : text,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
#endif
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
- (void)emitOnCancelButtonPressEvent
|
|
101
|
+
{
|
|
102
|
+
#ifdef RN_FABRIC_ENABLED
|
|
103
|
+
if (_eventEmitter != nullptr) {
|
|
104
|
+
std::dynamic_pointer_cast<const facebook::react::RNSSearchBarEventEmitter>(_eventEmitter)
|
|
105
|
+
->onCancelButtonPress(facebook::react::RNSSearchBarEventEmitter::OnCancelButtonPress{});
|
|
106
|
+
}
|
|
107
|
+
#else
|
|
108
|
+
if (self.onCancelButtonPress) {
|
|
109
|
+
self.onCancelButtonPress(@{});
|
|
110
|
+
}
|
|
111
|
+
#endif
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
- (void)emitOnChangeTextEventWithText:(NSString *)text
|
|
115
|
+
{
|
|
116
|
+
#ifdef RN_FABRIC_ENABLED
|
|
117
|
+
if (_eventEmitter != nullptr) {
|
|
118
|
+
std::dynamic_pointer_cast<const facebook::react::RNSSearchBarEventEmitter>(_eventEmitter)
|
|
119
|
+
->onChangeText(facebook::react::RNSSearchBarEventEmitter::OnChangeText{.text = RCTStringFromNSString(text)});
|
|
120
|
+
}
|
|
121
|
+
#else
|
|
122
|
+
if (self.onChangeText) {
|
|
123
|
+
self.onChangeText(@{
|
|
124
|
+
@"text" : text,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
#endif
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
- (void)setObscureBackground:(BOOL)obscureBackground
|
|
131
|
+
{
|
|
132
|
+
if (@available(iOS 9.1, *)) {
|
|
133
|
+
[_controller setObscuresBackgroundDuringPresentation:obscureBackground];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
- (void)setHideNavigationBar:(BOOL)hideNavigationBar
|
|
138
|
+
{
|
|
139
|
+
[_controller setHidesNavigationBarDuringPresentation:hideNavigationBar];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
- (void)setHideWhenScrolling:(BOOL)hideWhenScrolling
|
|
143
|
+
{
|
|
144
|
+
_hideWhenScrolling = hideWhenScrolling;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
- (void)setAutoCapitalize:(UITextAutocapitalizationType)autoCapitalize
|
|
148
|
+
{
|
|
149
|
+
[_controller.searchBar setAutocapitalizationType:autoCapitalize];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
- (void)setPlaceholder:(NSString *)placeholder
|
|
153
|
+
{
|
|
154
|
+
[_controller.searchBar setPlaceholder:placeholder];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
- (void)setBarTintColor:(UIColor *)barTintColor
|
|
158
|
+
{
|
|
159
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
|
|
160
|
+
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0 && !TARGET_OS_TV
|
|
161
|
+
if (@available(iOS 13.0, *)) {
|
|
162
|
+
[_controller.searchBar.searchTextField setBackgroundColor:barTintColor];
|
|
163
|
+
}
|
|
164
|
+
#endif
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
- (void)setTintColor:(UIColor *)tintColor
|
|
168
|
+
{
|
|
169
|
+
[_controller.searchBar setTintColor:tintColor];
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
- (void)setTextColor:(UIColor *)textColor
|
|
173
|
+
{
|
|
174
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
|
|
175
|
+
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0 && !TARGET_OS_TV
|
|
176
|
+
_textColor = textColor;
|
|
177
|
+
if (@available(iOS 13.0, *)) {
|
|
178
|
+
[_controller.searchBar.searchTextField setTextColor:_textColor];
|
|
179
|
+
}
|
|
180
|
+
#endif
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
- (void)setCancelButtonText:(NSString *)text
|
|
184
|
+
{
|
|
185
|
+
[_controller.searchBar setValue:text forKey:@"cancelButtonText"];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
- (void)hideCancelButton
|
|
189
|
+
{
|
|
190
|
+
#if !TARGET_OS_TV
|
|
191
|
+
if (@available(iOS 13, *)) {
|
|
192
|
+
// On iOS 13+ UISearchController automatically shows/hides cancel button
|
|
193
|
+
// https://developer.apple.com/documentation/uikit/uisearchcontroller/3152926-automaticallyshowscancelbutton?language=objc
|
|
194
|
+
} else {
|
|
195
|
+
[_controller.searchBar setShowsCancelButton:NO animated:YES];
|
|
196
|
+
}
|
|
197
|
+
#endif
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
- (void)showCancelButton
|
|
201
|
+
{
|
|
202
|
+
#if !TARGET_OS_TV
|
|
203
|
+
if (@available(iOS 13, *)) {
|
|
204
|
+
// On iOS 13+ UISearchController automatically shows/hides cancel button
|
|
205
|
+
// https://developer.apple.com/documentation/uikit/uisearchcontroller/3152926-automaticallyshowscancelbutton?language=objc
|
|
206
|
+
} else {
|
|
207
|
+
[_controller.searchBar setShowsCancelButton:YES animated:YES];
|
|
208
|
+
}
|
|
209
|
+
#endif
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
#pragma mark delegate methods
|
|
213
|
+
|
|
214
|
+
- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar
|
|
215
|
+
{
|
|
216
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && defined(__IPHONE_13_0) && \
|
|
217
|
+
__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0 && !TARGET_OS_TV
|
|
218
|
+
if (@available(iOS 13.0, *)) {
|
|
219
|
+
// for some reason, the color does not change when set at the beginning,
|
|
220
|
+
// so we apply it again here
|
|
221
|
+
if (_textColor != nil) {
|
|
222
|
+
[_controller.searchBar.searchTextField setTextColor:_textColor];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
#endif
|
|
226
|
+
|
|
227
|
+
[self showCancelButton];
|
|
228
|
+
[self becomeFirstResponder];
|
|
229
|
+
[self emitOnFocusEvent];
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
- (void)searchBarTextDidEndEditing:(UISearchBar *)searchBar
|
|
233
|
+
{
|
|
234
|
+
[self emitOnBlurEvent];
|
|
235
|
+
[self hideCancelButton];
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
|
|
239
|
+
{
|
|
240
|
+
[self emitOnChangeTextEventWithText:_controller.searchBar.text];
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
|
|
244
|
+
{
|
|
245
|
+
[self emitOnSearchButtonPressEventWithText:_controller.searchBar.text];
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
#if !TARGET_OS_TV
|
|
249
|
+
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
|
|
250
|
+
{
|
|
251
|
+
_controller.searchBar.text = @"";
|
|
252
|
+
[self resignFirstResponder];
|
|
253
|
+
[self hideCancelButton];
|
|
254
|
+
|
|
255
|
+
[self emitOnCancelButtonPressEvent];
|
|
256
|
+
[self emitOnChangeTextEventWithText:_controller.searchBar.text];
|
|
257
|
+
}
|
|
258
|
+
#endif // !TARGET_OS_TV
|
|
259
|
+
|
|
260
|
+
#pragma mark-- Fabric specific
|
|
261
|
+
|
|
262
|
+
#ifdef RN_FABRIC_ENABLED
|
|
263
|
+
- (void)updateProps:(facebook::react::Props::Shared const &)props
|
|
264
|
+
oldProps:(facebook::react::Props::Shared const &)oldProps
|
|
265
|
+
{
|
|
266
|
+
const auto &oldScreenProps = *std::static_pointer_cast<const facebook::react::RNSSearchBarProps>(_props);
|
|
267
|
+
const auto &newScreenProps = *std::static_pointer_cast<const facebook::react::RNSSearchBarProps>(props);
|
|
268
|
+
|
|
269
|
+
[self setHideWhenScrolling:newScreenProps.hideWhenScrolling];
|
|
270
|
+
|
|
271
|
+
if (oldScreenProps.cancelButtonText != newScreenProps.cancelButtonText) {
|
|
272
|
+
[self setCancelButtonText:RCTNSStringFromStringNilIfEmpty(newScreenProps.cancelButtonText)];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (oldScreenProps.obscureBackground != newScreenProps.obscureBackground) {
|
|
276
|
+
[self setObscureBackground:newScreenProps.obscureBackground];
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (oldScreenProps.hideNavigationBar != newScreenProps.hideNavigationBar) {
|
|
280
|
+
[self setHideNavigationBar:newScreenProps.hideNavigationBar];
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (oldScreenProps.placeholder != newScreenProps.placeholder) {
|
|
284
|
+
[self setPlaceholder:RCTNSStringFromStringNilIfEmpty(newScreenProps.placeholder)];
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (oldScreenProps.autoCapitalize != newScreenProps.autoCapitalize) {
|
|
288
|
+
[self setAutoCapitalize:[RNSConvert UITextAutocapitalizationTypeFromCppEquivalent:newScreenProps.autoCapitalize]];
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if (oldScreenProps.tintColor != newScreenProps.tintColor) {
|
|
292
|
+
[self setTintColor:RCTUIColorFromSharedColor(newScreenProps.tintColor)];
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
if (oldScreenProps.barTintColor != newScreenProps.barTintColor) {
|
|
296
|
+
[self setBarTintColor:RCTUIColorFromSharedColor(newScreenProps.barTintColor)];
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
if (oldScreenProps.textColor != newScreenProps.textColor) {
|
|
300
|
+
[self setTextColor:RCTUIColorFromSharedColor(newScreenProps.textColor)];
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
[super updateProps:props oldProps:oldProps];
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
+ (facebook::react::ComponentDescriptorProvider)componentDescriptorProvider
|
|
307
|
+
{
|
|
308
|
+
return facebook::react::concreteComponentDescriptorProvider<facebook::react::RNSSearchBarComponentDescriptor>();
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
#else
|
|
312
|
+
#endif
|
|
313
|
+
|
|
314
|
+
@end
|
|
315
|
+
|
|
316
|
+
#ifdef RN_FABRIC_ENABLED
|
|
317
|
+
Class<RCTComponentViewProtocol> RNSSearchBarCls(void)
|
|
318
|
+
{
|
|
319
|
+
return RNSSearchBar.class;
|
|
320
|
+
}
|
|
321
|
+
#endif
|
|
322
|
+
|
|
323
|
+
@implementation RNSSearchBarManager
|
|
324
|
+
|
|
325
|
+
RCT_EXPORT_MODULE()
|
|
326
|
+
|
|
327
|
+
#ifdef RN_FABRIC_ENABLED
|
|
328
|
+
#else
|
|
329
|
+
- (UIView *)view
|
|
330
|
+
{
|
|
331
|
+
return [[RNSSearchBar alloc] initWithBridge:self.bridge];
|
|
332
|
+
}
|
|
333
|
+
#endif
|
|
334
|
+
|
|
335
|
+
RCT_EXPORT_VIEW_PROPERTY(obscureBackground, BOOL)
|
|
336
|
+
RCT_EXPORT_VIEW_PROPERTY(hideNavigationBar, BOOL)
|
|
337
|
+
RCT_EXPORT_VIEW_PROPERTY(hideWhenScrolling, BOOL)
|
|
338
|
+
RCT_EXPORT_VIEW_PROPERTY(autoCapitalize, UITextAutocapitalizationType)
|
|
339
|
+
RCT_EXPORT_VIEW_PROPERTY(placeholder, NSString)
|
|
340
|
+
RCT_EXPORT_VIEW_PROPERTY(barTintColor, UIColor)
|
|
341
|
+
RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor)
|
|
342
|
+
RCT_EXPORT_VIEW_PROPERTY(textColor, UIColor)
|
|
343
|
+
RCT_EXPORT_VIEW_PROPERTY(cancelButtonText, NSString)
|
|
344
|
+
|
|
345
|
+
RCT_EXPORT_VIEW_PROPERTY(onChangeText, RCTBubblingEventBlock)
|
|
346
|
+
RCT_EXPORT_VIEW_PROPERTY(onCancelButtonPress, RCTBubblingEventBlock)
|
|
347
|
+
RCT_EXPORT_VIEW_PROPERTY(onSearchButtonPress, RCTBubblingEventBlock)
|
|
348
|
+
RCT_EXPORT_VIEW_PROPERTY(onFocus, RCTBubblingEventBlock)
|
|
349
|
+
RCT_EXPORT_VIEW_PROPERTY(onBlur, RCTBubblingEventBlock)
|
|
350
|
+
|
|
351
|
+
@end
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _FullWindowOverlayNativeComponent = _interopRequireDefault(require("./FullWindowOverlayNativeComponent"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
+
|
|
16
|
+
function FullWindowOverlay(props) {
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement(_FullWindowOverlayNativeComponent.default, _extends({}, props, {
|
|
18
|
+
style: [{
|
|
19
|
+
flex: 1
|
|
20
|
+
}, props.style]
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var _default = FullWindowOverlay;
|
|
25
|
+
exports.default = _default;
|
|
26
|
+
//# sourceMappingURL=FullWindowOverlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["FullWindowOverlay.js"],"names":["FullWindowOverlay","props","flex","style"],"mappings":";;;;;;;AAAA;;AACA;;;;;;AAEA,SAASA,iBAAT,CAA2BC,KAA3B,EAAkC;AAChC,sBACE,6BAAC,yCAAD,eACMA,KADN;AAEE,IAAA,KAAK,EAAE,CAAC;AAAEC,MAAAA,IAAI,EAAE;AAAR,KAAD,EAAcD,KAAK,CAACE,KAApB;AAFT,KADF;AAMD;;eAEcH,iB","sourcesContent":["import React from 'react';\nimport FullWindowOverlayNativeComponent from './FullWindowOverlayNativeComponent';\n\nfunction FullWindowOverlay(props) {\n return (\n <FullWindowOverlayNativeComponent\n {...props}\n style={[{ flex: 1 }, props.style]}\n />\n );\n}\n\nexport default FullWindowOverlay;\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _codegenNativeComponent = _interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @format
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/* eslint-disable */
|
|
18
|
+
var _default = (0, _codegenNativeComponent.default)('RNSFullWindowOverlay', {});
|
|
19
|
+
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
//# sourceMappingURL=FullWindowOverlayNativeComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["FullWindowOverlayNativeComponent.js"],"names":[],"mappings":";;;;;;;AAKA;;;;AALA;AACA;AACA;AACA;;AACA;eAWgB,qCACd,sBADc,EAEd,EAFc,C","sourcesContent":["/**\n * @flow strict-local\n * @format\n */\n/* eslint-disable */\nimport codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';\nimport type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';\nimport type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';\n\ntype NativeProps = $ReadOnly<{|\n ...ViewProps,\n|}>;\n\ntype ComponentType = HostComponent<NativeProps>;\n\nexport default (codegenNativeComponent<NativeProps>(\n 'RNSFullWindowOverlay',\n {}\n): ComponentType);\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _ScreenContainerNativeComponent = _interopRequireDefault(require("./ScreenContainerNativeComponent"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
+
|
|
16
|
+
function ScreenContainer(props) {
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement(_ScreenContainerNativeComponent.default, _extends({}, props, {
|
|
18
|
+
style: [{
|
|
19
|
+
flex: 1,
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
justifyContent: 'center'
|
|
22
|
+
}, props.style]
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var _default = ScreenContainer;
|
|
27
|
+
exports.default = _default;
|
|
28
|
+
//# sourceMappingURL=ScreenContainer.js.map
|