Skip to content

Commit

Permalink
chore: add FullWindowOverlay to Fabric JS
Browse files Browse the repository at this point in the history
  • Loading branch information
kkafar committed Jun 28, 2022
1 parent 0433b38 commit 30269fc
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/fabric/FullWindowOverlay.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import FullWindowOverlayNativeComponent from './FullWindowOverlayNativeComponent';

function FullWindowOverlay(props) {
return (
<FullWindowOverlayNativeComponent
{...props}
style={[{ flex: 1 }, props.style]}
/>
);
}

export default FullWindowOverlay;
19 changes: 19 additions & 0 deletions src/fabric/FullWindowOverlayNativeComponent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @flow strict-local
* @format
*/
/* eslint-disable */
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ViewProps } from 'react-native/Libraries/Components/View/ViewPropTypes';
import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';

type NativeProps = $ReadOnly<{|
...ViewProps,
|}>;

type ComponentType = HostComponent<NativeProps>;

export default (codegenNativeComponent<NativeProps>(
'RNSFullWindowOverlay',
{}
): ComponentType);
4 changes: 3 additions & 1 deletion src/index.native.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ const ScreensNativeModules = {

get NativeFullWindowOverlay() {
NativeFullWindowOverlay =
NativeFullWindowOverlay || requireNativeComponent('RNSFullWindowOverlay');
NativeFullWindowOverlay ||
FabricComponents.FullWindowOverlay ||
requireNativeComponent('RNSFullWindowOverlay');
return NativeFullWindowOverlay;
},
};
Expand Down

0 comments on commit 30269fc

Please sign in to comment.