Skip to content

Conversation

@ian-zyh
Copy link
Collaborator

@ian-zyh ian-zyh commented Jun 11, 2025

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.)

@ian-zyh ian-zyh added the refactor Restructuring project code label Jun 11, 2025
@ian-zyh ian-zyh linked an issue Jun 11, 2025 that may be closed by this pull request
@ian-zyh ian-zyh requested a review from Copilot June 12, 2025 12:47
Copy link

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

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

@fulformc
Copy link
Collaborator

@ian-zyh please merge main into this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Restructuring project code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Reduce code duplication in Select and MultiSelect

3 participants