Skip to content

feat: add CustomModal component#1

Open
nilesh-simform wants to merge 2 commits into
mainfrom
feature/custom_model_component
Open

feat: add CustomModal component#1
nilesh-simform wants to merge 2 commits into
mainfrom
feature/custom_model_component

Conversation

@nilesh-simform
Copy link
Copy Markdown
Owner

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:

  • Added a new CustomModal component in app/components/custom-modal/CustomModal.tsx that provides a reusable modal with customizable styles, content container, and backdrop handling.
  • Created CustomModalStyles.ts for theme-aware modal styling and CustomModalTypes.ts for type definitions.
  • Exported the modal component via the module index for easy import.

Theme and Layout Enhancements:

  • Updated app/theme/Metrics.tsx to add getScreenDimensions, and exported screenWidth and screenHeight for better device layout handling, used by the modal component.

Dependency and Documentation Updates:

  • Added react-native-modal as a dependency in package.json to enable modal functionality.
  • Minor improvements to documentation in TaskListingScreen.tsx for props clarity.
  • Cleaned up and reordered package dependencies and devDependencies for consistency.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.tsx to expose screenWidth/screenHeight derived from Dimensions.get('screen').
  • Adds react-native-modal dependency and minor JSDoc clarification in TaskListingScreen.

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}
Comment thread package.json
"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",
Comment thread app/components/custom-modal/CustomModalTypes.ts Outdated
@@ -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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants