feat: add CustomModal component#1
Open
nilesh-simform wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a reusable CustomModal React Native component and supporting theme utilities so the app can present consistent, theme-aware modal UI.
Changes:
- Introduces
app/components/custom-modal/*(component, styles, types, local index export). - Extends
app/theme/Metrics.tsxto exposescreenWidth/screenHeightderived fromDimensions.get('screen'). - Adds
react-native-modaldependency and minor JSDoc clarification inTaskListingScreen.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds react-native-modal dependency and reorders entries. |
| app/theme/Metrics.tsx | Adds getScreenDimensions() and exports screenWidth/screenHeight. |
| app/modules/task-listing/TaskListingScreen.tsx | Improves props documentation for onTaskPress. |
| app/components/custom-modal/index.ts | Exposes CustomModal from the component folder. |
| app/components/custom-modal/CustomModalTypes.ts | Defines modal props interface. |
| app/components/custom-modal/CustomModalStyles.ts | Adds theme-aware modal/container styles. |
| app/components/custom-modal/CustomModal.tsx | Implements wrapper around react-native-modal with theming and styling hooks. |
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+35
to
+37
| style={StyleSheet.flatten([styles.modalStyle, modalStyle])} | ||
| onBackdropPress={onBackdropPress} | ||
| {...rest} |
| "react-native-gesture-handler": "2.28.0", | ||
| "react-native-localize": "3.5.2", | ||
| "react-native-mmkv": "3.3.3", | ||
| "react-native-modal": "^14.0.0-rc.1", |
| @@ -0,0 +1 @@ | |||
| export { default as CustomModal } from './CustomModal'; | |||
Comment on lines
+33
to
+35
| isVisible={isVisible} | ||
| deviceHeight={screenHeight} | ||
| style={StyleSheet.flatten([styles.modalStyle, modalStyle])} |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a reusable custom modal component to the codebase, along with its associated styles and types, and updates the theme utilities to support modal layout. It also adds the necessary dependency for modal support and makes minor improvements to documentation and package configuration.
New Custom Modal Component:
CustomModalcomponent inapp/components/custom-modal/CustomModal.tsxthat provides a reusable modal with customizable styles, content container, and backdrop handling.CustomModalStyles.tsfor theme-aware modal styling andCustomModalTypes.tsfor type definitions.Theme and Layout Enhancements:
app/theme/Metrics.tsxto addgetScreenDimensions, and exportedscreenWidthandscreenHeightfor better device layout handling, used by the modal component.Dependency and Documentation Updates:
react-native-modalas a dependency inpackage.jsonto enable modal functionality.TaskListingScreen.tsxfor props clarity.