From 3f8e4aa683c15d48e7e8ebc9caccade40df31b0b Mon Sep 17 00:00:00 2001 From: Wojciech Lewicki Date: Wed, 8 Sep 2021 15:10:33 +0200 Subject: [PATCH] feat: move `react-native-window-view` to screens package (#1096) Moved the `WindowView` to this repo and renamed it to `RNSFullWindowOverlay`. Removed the necessity of adding changes to `AppDelegate.m` by providing an extension of `UIWindow` in the package. --- TestsExample/App.js | 1 + TestsExample/src/Test1096.tsx | 89 ++++++++++++++++++++++++++++ ios/RNSFullWindowOverlay.h | 15 +++++ ios/RNSFullWindowOverlay.m | 105 ++++++++++++++++++++++++++++++++++ ios/UIWindow+RNScreens.h | 9 +++ ios/UIWindow+RNScreens.m | 17 ++++++ src/index.native.tsx | 15 +++++ src/index.tsx | 2 + 8 files changed, 253 insertions(+) create mode 100644 TestsExample/src/Test1096.tsx create mode 100644 ios/RNSFullWindowOverlay.h create mode 100644 ios/RNSFullWindowOverlay.m create mode 100644 ios/UIWindow+RNScreens.h create mode 100644 ios/UIWindow+RNScreens.m diff --git a/TestsExample/App.js b/TestsExample/App.js index 95ee260478..3f8627a318 100644 --- a/TestsExample/App.js +++ b/TestsExample/App.js @@ -57,6 +57,7 @@ import Test1032 from './src/Test1032'; import Test1036 from './src/Test1036'; import Test1072 from './src/Test1072'; import Test1084 from './src/Test1084'; +import Test1096 from './src/Test1096'; export default function App() { return ( diff --git a/TestsExample/src/Test1096.tsx b/TestsExample/src/Test1096.tsx new file mode 100644 index 0000000000..6e6bb1753e --- /dev/null +++ b/TestsExample/src/Test1096.tsx @@ -0,0 +1,89 @@ +import * as React from 'react'; + +import { Button, StyleSheet, View, Modal } from 'react-native'; +import {FullWindowOverlay} from 'react-native-screens'; +import { + createNativeStackNavigator, + NativeStackNavigationProp, +} from 'react-native-screens/native-stack'; +import { NavigationContainer, ParamListBase } from '@react-navigation/native'; + +function Home({ + navigation, +}: { + navigation: NativeStackNavigationProp; +}) { + const [isShowModal, setIsShowModal] = React.useState(false); + + return ( + +