-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
404b930
commit 9e427a1
Showing
14 changed files
with
273 additions
and
115 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// RNIModalView.h | ||
// react-native-ios-modal | ||
// | ||
// Created by Dominic Go on 6/6/24. | ||
// | ||
|
||
#import <react-native-ios-utilities/RNIBaseView.h> | ||
|
||
#if RCT_NEW_ARCH_ENABLED | ||
#import <React/RCTViewComponentView.h> | ||
#else | ||
#import <React/RCTView.h> | ||
#endif | ||
|
||
@protocol RNIContentViewParentDelegate; | ||
@protocol RNIContentViewDelegate; | ||
|
||
@class RCTBridge; | ||
|
||
#if RCT_NEW_ARCH_ENABLED | ||
namespace react = facebook::react; | ||
#endif | ||
|
||
@interface RNIModalView : RNIBaseView | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// | ||
// RNIModalView.mm | ||
// react-native-ios-modal | ||
// | ||
// Created by Dominic Go on 6/6/24. | ||
// | ||
|
||
#import "RNIModalView.h" | ||
|
||
#import "react-native-ios-modal/Swift.h" | ||
#import <react-native-ios-utilities/RNIBaseView.h> | ||
#import <react-native-ios-utilities/RNIContentViewParentDelegate.h> | ||
|
||
#import <react-native-ios-utilities/UIApplication+RNIHelpers.h> | ||
#import <react-native-ios-utilities/RNIObjcUtils.h> | ||
|
||
#if RCT_NEW_ARCH_ENABLED | ||
#include "RNIModalViewComponentDescriptor.h" | ||
|
||
#include <react-native-ios-utilities/RNIBaseViewState.h> | ||
#include <react-native-ios-utilities/RNIBaseViewProps.h> | ||
|
||
#import <React/RCTConversions.h> | ||
#import <React/RCTFabricComponentsPlugins.h> | ||
#import <React/RCTRootComponentView.h> | ||
#import <React/RCTSurfaceTouchHandler.h> | ||
|
||
#include <react/renderer/core/ComponentDescriptor.h> | ||
#include <react/renderer/core/ConcreteComponentDescriptor.h> | ||
#include <react/renderer/graphics/Float.h> | ||
#include <react/renderer/core/graphicsConversions.h> | ||
|
||
#import <react/renderer/components/RNIModalSpec/EventEmitters.h> | ||
#import <react/renderer/components/RNIModalSpec/RCTComponentViewHelpers.h> | ||
#else | ||
#import <React/RCTTouchHandler.h> | ||
#import <React/RCTInvalidating.h> | ||
#endif | ||
|
||
#ifdef RCT_NEW_ARCH_ENABLED | ||
using namespace facebook::react; | ||
#endif | ||
|
||
|
||
@interface RNIModalView () < | ||
RNIContentViewParentDelegate, | ||
#ifdef RCT_NEW_ARCH_ENABLED | ||
RCTRNIModalViewViewProtocol | ||
#else | ||
RCTInvalidating | ||
#endif | ||
> { | ||
// TBA | ||
} | ||
@end | ||
|
||
@implementation RNIModalView { | ||
} | ||
|
||
// MARK: - Init | ||
// ------------ | ||
|
||
- (void)initCommon { | ||
[super initCommon]; | ||
} | ||
|
||
// MARK: - RNIBaseView | ||
// ------------------- | ||
|
||
+ (Class)viewDelegateClass | ||
{ | ||
return nil; | ||
//return [RNIDummyTestViewDelegate class]; | ||
} | ||
|
||
// MARK: - Fabric | ||
// -------------- | ||
|
||
#if RCT_NEW_ARCH_ENABLED | ||
+ (ComponentDescriptorProvider)componentDescriptorProvider | ||
{ | ||
return concreteComponentDescriptorProvider<RNIModalViewComponentDescriptor>(); | ||
} | ||
|
||
Class<RCTComponentViewProtocol> RNIModalViewCls(void) | ||
{ | ||
return RNIModalView.class; | ||
} | ||
#else | ||
|
||
// MARK: - Paper | ||
// ------------- | ||
|
||
- (void)invalidate | ||
{ | ||
// to be impl. | ||
} | ||
|
||
#endif | ||
@end | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// RNIModalViewComponentDescriptor.h | ||
// react-native-ios-modal | ||
// | ||
// Created by Dominic Go on 6/6/24. | ||
// | ||
|
||
#if __cplusplus | ||
#pragma once | ||
|
||
#include "RNIModalViewShadowNode.h" | ||
#include "RNIBaseViewComponentDescriptor.h" | ||
|
||
#include <react-native-ios-utilities/RNIBaseViewState.h> | ||
#include <react/renderer/core/ConcreteComponentDescriptor.h> | ||
|
||
|
||
namespace facebook::react { | ||
|
||
class RNIModalViewComponentDescriptor final | ||
: public RNIBaseViewComponentDescriptor<RNIModalViewShadowNode> { | ||
|
||
public: | ||
using RNIBaseViewComponentDescriptor::RNIBaseViewComponentDescriptor; | ||
}; | ||
|
||
} // namespace facebook::react | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// | ||
// RNIModalViewDelegate.swift | ||
// react-native-ios-modal | ||
// | ||
// Created by Dominic Go on 6/6/24. | ||
// | ||
|
||
import react_native_ios_utilities | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// | ||
// RNIModalViewManager.m | ||
// react-native-ios-modal | ||
// | ||
// Created by Dominic Go on 6/6/24. | ||
// | ||
|
||
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// | ||
// RNIModalViewShadowNode.h | ||
// react-native-ios-modal | ||
// | ||
// Created by Dominic Go on 6/6/24. | ||
// | ||
|
||
#if __cplusplus | ||
#pragma once | ||
|
||
#include <react-native-ios-utilities/RNIBaseViewShadowNode.h> | ||
#include <react-native-ios-utilities/RNIBaseViewProps.h> | ||
#include <react-native-ios-utilities/RNIBaseViewEventEmitter.h> | ||
|
||
#include <react/renderer/components/RNIModalSpec/EventEmitters.h> | ||
#include <react/renderer/components/RNIModalSpec/Props.h> | ||
|
||
#include <react/renderer/components/view/ConcreteViewShadowNode.h> | ||
#include <jsi/jsi.h> | ||
|
||
|
||
namespace facebook::react { | ||
|
||
JSI_EXPORT extern const char RNIModalViewComponentName[] = "RNIModalView"; | ||
|
||
class JSI_EXPORT RNIModalViewShadowNode final : public RNIBaseViewShadowNode< | ||
RNIModalViewComponentName, | ||
RNIBaseViewProps, | ||
RNIBaseViewEventEmitter | ||
> { | ||
|
||
public: | ||
using RNIBaseViewShadowNode::RNIBaseViewShadowNode; | ||
|
||
static RNIBaseViewState initialStateData( | ||
const Props::Shared&r , // props | ||
const ShadowNodeFamily::Shared&, // family | ||
const ComponentDescriptor& // componentDescriptor | ||
) { | ||
return {}; | ||
} | ||
}; | ||
|
||
} // facebook::react | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// | ||
// Swift.h | ||
// react-native-ios-modal | ||
// | ||
// Created by Dominic Go on 6/6/24. | ||
// | ||
|
||
// When `use_frameworks!` is used, the generated Swift header is inside | ||
// the module. | ||
// Otherwise, it's available only locally with double-quoted imports. | ||
#if __has_include(<react_native_ios_modal/react_native_ios_modal-Swift.h>) | ||
#import "<react_native_ios_modal/react_native_ios_modal-Swift.h>" | ||
#else | ||
#import "react_native_ios_modal-Swift.h" | ||
#endif | ||
|
||
|
||
// #import <react-native-ios-utilities/react-native-ios-utilities-Swift.h> | ||
// #import "<react_native_ios_utilities/react_native_ios_utilities-Swift.h>" | ||
// #import <react-native-ios-utilities/react_native_ios_utilities-Swift.h> | ||
// #import <react-native-ios-utilities/react-native-ios-utilities-Swift.h> | ||
// #import <react-native-ios-utilities/react_native_ios_utilities/react_native_ios_utilities-Swift.h> | ||
|
||
|
||
//#import "react_native_ios_utilities-Swift.h" | ||
// #import "react_native_ios_utilities/react_native_ios_utilities-Swift.h" | ||
//#import <react_native_ios_utilities/react-native-ios-utilities-umbrella.h> | ||
//#import <react_native_ios_utilities-Swift.h> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { HostComponent, ViewProps } from 'react-native'; | ||
|
||
import { default as RNIModalViewNativeComponent } from './RNIModalViewNativeComponent'; | ||
import type { SharedViewEvents } from 'react-native-ios-utilities'; | ||
|
||
export interface RNIModalNativeViewBaseProps extends ViewProps { | ||
}; | ||
|
||
export type RNIModalNativeViewProps = | ||
SharedViewEvents | ||
& RNIModalNativeViewBaseProps; | ||
|
||
export const RNIModalNativeView = | ||
RNIModalViewNativeComponent as unknown as HostComponent<RNIModalNativeViewProps>; |
10 changes: 10 additions & 0 deletions
10
src/native_components/RNIModalView/RNIModalViewNativeComponent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; | ||
import type { HostComponent, ViewProps } from 'react-native'; | ||
|
||
interface NativeProps extends ViewProps { | ||
} | ||
|
||
export default codegenNativeComponent<NativeProps>('RNIModalView', { | ||
excludedPlatforms: ['android'], | ||
interfaceOnly: true, | ||
}) as HostComponent<NativeProps>; |
Oops, something went wrong.