-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add overlayColor prop to modal component for customisable backg…
…round overlay (#46322) Summary: Solves these issues: - #18398 - #12478 Solves this proposal: react-native-community/discussions-and-proposals#774 ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [GENERAL] [ADDED] - added overlayColor prop to modal component for customisable background overlay **Motivation:** Currently, the React Native Modal component only allows the background to be set to either `transparent` or `white`. This limits the ability to dim the background or apply custom colors, which is essential for creating a more polished and user-friendly interface. **Change Log:** Modal Component Enhancements: - Introduced a new optional prop `overlayColor` to the Modal component. - Updated the background color logic to prioritize `overlayColor` when transparent is `false`. - Ensured backward compatibility by defaulting to `white` when `overlayColor` is not provided. Pull Request resolved: #46322 Test Plan: - Test the changes on both iOS and Android devices/emulators to ensure consistent behavior. - Added example in **rn-tester** app **Sample screenshot with custom overlayColor passed as 'red'.** ![simulator_screenshot_4F112217-7AD5-4030-8A18-6260AD32988A](https://github.com/user-attachments/assets/52f16ef2-874b-487c-908b-1aa2a1b8fafb) Reviewed By: cipolleschi Differential Revision: D62201559 Pulled By: alanleedev fbshipit-source-id: e990d7f18f5edf61f0107026ea899c5f22d47bfd
- Loading branch information
1 parent
b4c41ec
commit 4e1d701
Showing
4 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
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