-
Notifications
You must be signed in to change notification settings - Fork 0
Issue 39: Reduce code duplication #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses issue #39 by reducing code duplication for selector components. Key changes include the extraction of common selector utility functions into SelectorUtils.tsx, updating Select.tsx and MultiSelect.tsx to use these new utilities, and replacing plain text icons with SVGs in SelectionList.tsx.
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/SelectorUtils.tsx | Introduces shared utility functions for measuring component dimensions and rendering arrows. |
| src/components/SelectionList.tsx | Replaces text clear icon with an SVG version for better styling consistency. |
| src/components/Select.tsx | Refactors inline functions to use the new shared utilities from SelectorUtils.tsx. |
| src/components/MultiSelect.tsx | Similar refactor as in Select.tsx, leveraging the shared utilities. |
| package.json | Adds react-native-svg as a dependency. |
| example/package.json | Updates dependency configuration to reference react-native-svg correctly. |
Files not reviewed (1)
- example/package-lock.json: Language not supported
|
@ian-zyh please merge |
… add refRectYOffset to replace hardcode
This PR aimed to solve issue #39
Added a file named "SelectorUtils.tsx" under folder "utils", all the repeated methods of Select.tsx and MultiSelect.tsx were moved here.
(This branch is merged from rhit-zhuy17/113-change-dropdown-icons-format, so the icons are already in svg format.)