Skip to content

Commit bc81d02

Browse files
paufaupaufau
authored andcommitted
Merge with develop
2 parents f14a2ad + 011efdd commit bc81d02

File tree

5 files changed

+38
-15
lines changed

5 files changed

+38
-15
lines changed

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# react-native-multiple-modals
22

3-
The main goal of this library is to provide a component that allows to display multiple modals at the same time.
4-
5-
No additional props to manage StatusBar or SafeArea. I try to make the ModalView component as lightweight as possible. It solves one problem - shows a modal. Everything else is the task of other components.
3+
Native Modal implementation which allows to display multiple Modals simultaneously.
64

75
## ✨ Features
86

97
- 📱 iOS & Android
108
- 🚀 Performant Native Implementation
119
- ✅ Accessibility Support
1210
- 💯 Compatible with Expo
11+
- 💥 New Architecture
12+
- 🛠️ iOS - Migration Started
13+
- ⌛ Android - Planned
1314

1415
## Installation
1516

@@ -48,7 +49,7 @@ const YourComponent = () => {
4849

4950
### `contentContainerStyle?: ViewStyle`
5051

51-
Styles of the content wrapper.
52+
Styles of the content wrapper. Use it for aligning your content view.
5253

5354
---
5455

@@ -73,7 +74,3 @@ When backdropProps are no longer enough.
7374
> _**NOTE**_: While rendering custom backdrop `onRequestClose` is not called, so you should handle backdrop press by yourself
7475
7576
---
76-
77-
## Roadmap
78-
79-
[ ] New Architecture support

ios/Library/ModalView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ final class ModalView: UIView {
3131

3232
if (atIndex == 0) {
3333
self.modalViewController?.addReactSubview(subview)
34+
UIAccessibility.post(notification: .screenChanged, argument: subview)
3435
}
3536
}
3637

@@ -59,6 +60,7 @@ final class ModalView: UIView {
5960
self.modalViewController?.dismiss()
6061
self.modalViewController = nil
6162
self.isMounted = false
63+
UIAccessibility.post(notification: .screenChanged, argument: null)
6264
}
6365

6466
func update() {

ios/RNTModal.xcodeproj/project.pbxproj

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
/* Begin PBXBuildFile section */
1010
AF43775E2CB5A09C00334A86 /* RNTModalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF43775C2CB5A09C00334A86 /* RNTModalView.swift */; };
1111
AF43775F2CB5A09C00334A86 /* RNTModalViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = AF43775D2CB5A09C00334A86 /* RNTModalViewManager.m */; };
12+
AFEFC13A2CC7F0210008863D /* ModalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFEFC1372CC7F0210008863D /* ModalView.swift */; };
13+
AFEFC13B2CC7F0210008863D /* ModalShadowVIew.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFEFC1362CC7F0210008863D /* ModalShadowVIew.swift */; };
14+
AFEFC13C2CC7F0210008863D /* ModalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFEFC1382CC7F0210008863D /* ModalViewController.swift */; };
1215
/* End PBXBuildFile section */
1316

1417
/* Begin PBXCopyFilesBuildPhase section */
@@ -24,10 +27,13 @@
2427
/* End PBXCopyFilesBuildPhase section */
2528

2629
/* Begin PBXFileReference section */
27-
AF43774B2CB59EF500334A86 /* libRNTModal.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; name = libRNTModal.a; path = "/Users/pavelpakseev/code/react_native_multiple_modals_app/modules/react-native-multiple-modals/ios/build/Debug-iphoneos/libRNTModal.a"; sourceTree = "<absolute>"; };
2830
AF43775C2CB5A09C00334A86 /* RNTModalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNTModalView.swift; sourceTree = "<group>"; };
2931
AF43775D2CB5A09C00334A86 /* RNTModalViewManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNTModalViewManager.m; sourceTree = "<group>"; };
3032
AF4377602CB5A09D00334A86 /* RNTModal-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RNTModal-Bridging-Header.h"; sourceTree = "<group>"; };
33+
AFEFC1352CC7F0140008863D /* libRNTModal.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNTModal.a; sourceTree = BUILT_PRODUCTS_DIR; };
34+
AFEFC1362CC7F0210008863D /* ModalShadowVIew.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalShadowVIew.swift; sourceTree = "<group>"; };
35+
AFEFC1372CC7F0210008863D /* ModalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalView.swift; sourceTree = "<group>"; };
36+
AFEFC1382CC7F0210008863D /* ModalViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalViewController.swift; sourceTree = "<group>"; };
3137
/* End PBXFileReference section */
3238

3339
/* Begin PBXFrameworksBuildPhase section */
@@ -44,12 +50,24 @@
4450
AF4377422CB59EF500334A86 = {
4551
isa = PBXGroup;
4652
children = (
53+
AFEFC1392CC7F0210008863D /* Library */,
4754
AF43775C2CB5A09C00334A86 /* RNTModalView.swift */,
4855
AF43775D2CB5A09C00334A86 /* RNTModalViewManager.m */,
4956
AF4377602CB5A09D00334A86 /* RNTModal-Bridging-Header.h */,
57+
AFEFC1352CC7F0140008863D /* libRNTModal.a */,
5058
);
5159
sourceTree = "<group>";
5260
};
61+
AFEFC1392CC7F0210008863D /* Library */ = {
62+
isa = PBXGroup;
63+
children = (
64+
AFEFC1362CC7F0210008863D /* ModalShadowVIew.swift */,
65+
AFEFC1372CC7F0210008863D /* ModalView.swift */,
66+
AFEFC1382CC7F0210008863D /* ModalViewController.swift */,
67+
);
68+
path = Library;
69+
sourceTree = "<group>";
70+
};
5371
/* End PBXGroup section */
5472

5573
/* Begin PBXNativeTarget section */
@@ -69,7 +87,7 @@
6987
packageProductDependencies = (
7088
);
7189
productName = RNTModal;
72-
productReference = AF43774B2CB59EF500334A86 /* libRNTModal.a */;
90+
productReference = AFEFC1352CC7F0140008863D /* libRNTModal.a */;
7391
productType = "com.apple.product-type.library.static";
7492
};
7593
/* End PBXNativeTarget section */
@@ -114,6 +132,9 @@
114132
files = (
115133
AF43775E2CB5A09C00334A86 /* RNTModalView.swift in Sources */,
116134
AF43775F2CB5A09C00334A86 /* RNTModalViewManager.m in Sources */,
135+
AFEFC13A2CC7F0210008863D /* ModalView.swift in Sources */,
136+
AFEFC13B2CC7F0210008863D /* ModalShadowVIew.swift in Sources */,
137+
AFEFC13C2CC7F0210008863D /* ModalViewController.swift in Sources */,
117138
);
118139
runOnlyForDeploymentPostprocessing = 0;
119140
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-multiple-modals",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "Native implementation with the ability to display multiple Modals",
55
"author": "Pavel Pakseev <[email protected]> (https://github.com/paufau)",
66
"license": "MIT",

src/ModalView.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { RNTModalView } from './RNTModalView';
1414
import { ScrollContextResetter } from './ScrollContextResetter';
1515

1616
export type BackdropProps = Omit<PressableProps, 'onPress' | 'style'> & {
17-
style: StyleProp<ViewStyle>;
17+
style?: StyleProp<ViewStyle>;
1818
};
1919

2020
export enum DismissalSource {
@@ -30,6 +30,9 @@ export type ModalViewProps = {
3030
backdropProps?: BackdropProps;
3131
};
3232

33+
const backdropAccessibilityLabel = 'Backdrop';
34+
const backdropAccessibilityHint = 'Double-tap to close the modal';
35+
3336
export const ModalView: FC<ModalViewProps> = ({
3437
children,
3538
renderBackdrop,
@@ -53,10 +56,10 @@ export const ModalView: FC<ModalViewProps> = ({
5356
renderBackdrop()
5457
) : (
5558
<Pressable
56-
onPress={() => onRequestDismiss?.(DismissalSource.Backdrop)}
57-
accessible
58-
accessibilityLabel='Backdrop'
59+
accessibilityLabel={backdropAccessibilityLabel}
60+
accessibilityHint={backdropAccessibilityHint}
5961
{...backdropProps}
62+
onPress={() => onRequestDismiss?.(DismissalSource.Backdrop)}
6063
style={[styles.defaultBackdrop, backdropProps?.style]}
6164
/>
6265
)}

0 commit comments

Comments
 (0)