-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: optimize TableEntry component and CSS adjustments
This commit brings several optimizations and code structure improvements to the `TableEntry.jsx` component, alongside minor CSS adjustments to ensure consistent text color across light and dark themes. ### Optimizations and Adjustments: - Ensured consistent use of semicolons and removed unused imports. - Introduced `BINARY_KEYS`, `TRUE_KEYS`, and `FALSE_KEYS` constants for clearer handling of binary values within `TableEntry`. - Simplified and consolidated event handler functions (`handleEditClick`, `handleDeleteClick`, `handleSaveClick`, `handleCancelClick`) for cleaner, more readable code. - Utilized `useEffect` to set keys based on the current table name, refining the component's reactivity to prop changes. - Streamlined conditional rendering within the Actions component to improve readability. - Adjusted `select` CSS in `index.css` to ensure text color is explicitly set to black in light mode, addressing an inconsistency in theme styling. ### Code Cleanup: - Removed unnecessary checks and verbose conditions, adopting more straightforward logic for state management and event handling. - Simplified the mapping and rendering of `keys` by directly integrating conditional rendering checks into the JSX returned by `map`, improving performance and readability. - Removed redundant code segments and consolidated duplicate logic for handling binary value conditions within form inputs. These changes aim to enhance the maintainability of the codebase, improve the component's performance, and ensure a consistent user experience across different themes.
- Loading branch information
1 parent
f12a634
commit 8a76782
Showing
2 changed files
with
71 additions
and
134 deletions.
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