Skip to content

Commit 7ca9452

Browse files
committed
Remove button component view
1 parent 921a9b2 commit 7ca9452

File tree

3 files changed

+40
-81
lines changed

3 files changed

+40
-81
lines changed

apple/RNGestureHandlerButton.m renamed to apple/RNGestureHandlerButton.mm

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@
1212
#import <UIKit/UIKit.h>
1313
#endif
1414

15+
#ifdef RCT_NEW_ARCH_ENABLED
16+
#import <React/RCTConversions.h>
17+
#import <React/RCTFabricComponentsPlugins.h>
18+
#import <React/RCTViewComponentView.h>
19+
20+
#import <react/renderer/components/rngesturehandler_codegen/ComponentDescriptors.h>
21+
#import <react/renderer/components/rngesturehandler_codegen/EventEmitters.h>
22+
#import <react/renderer/components/rngesturehandler_codegen/Props.h>
23+
#import <react/renderer/components/rngesturehandler_codegen/RCTComponentViewHelpers.h>
24+
25+
using namespace facebook::react;
26+
#endif // RCT_NEW_ARCH_ENABLED
27+
1528
/**
1629
* Gesture Handler Button components overrides standard mechanism used by RN
1730
* to determine touch target, which normally would reurn the UIView that is placed
@@ -82,4 +95,31 @@ - (RNGHUIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
8295
}
8396
#endif
8497

98+
#ifdef RCT_NEW_ARCH_ENABLED
99+
+ (ComponentDescriptorProvider)componentDescriptorProvider
100+
{
101+
return concreteComponentDescriptorProvider<RNGestureHandlerButtonComponentDescriptor>();
102+
}
103+
104+
- (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &)oldProps
105+
{
106+
const auto &newProps = *std::static_pointer_cast<const RNGestureHandlerButtonProps>(props);
107+
108+
self.userEnabled = newProps.enabled;
109+
#if !TARGET_OS_TV
110+
self.exclusiveTouch = newProps.exclusive;
111+
#endif
112+
self.hitTestEdgeInsets = UIEdgeInsetsMake(
113+
-newProps.hitSlop.top, -newProps.hitSlop.left, -newProps.hitSlop.bottom, -newProps.hitSlop.right);
114+
115+
[super updateProps:props oldProps:oldProps];
116+
}
117+
118+
Class<RCTComponentViewProtocol> RNGestureHandlerButtonCls(void)
119+
{
120+
return RNGestureHandlerButton.class;
121+
}
122+
123+
#endif // RCT_NEW_ARCH_ENABLED
124+
85125
@end

apple/RNGestureHandlerButtonComponentView.h

Lines changed: 0 additions & 17 deletions
This file was deleted.

apple/RNGestureHandlerButtonComponentView.mm

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)