-
Notifications
You must be signed in to change notification settings - Fork 75
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
Create reusable util for adjusting internal icon scale used within a component #7765
Comments
Sweet! this will be nice to have |
Hi @jcfranco I have reviewed the issue and I'd like to contribute by creating the reusable utility for adjusting internal |
@alhridoy sounds great. Feel free to take it on! Let us know if you have any questions. |
@alhridoy Awesome! Thanks for taking this on. 🎉 I've assigned the issue, updated labels and assigned to the October release. |
…7973) # Adopted #7935 cc @alhridoy --- **Related Issue:** #7765 ## Summary This pull request extracts the logic for adjusting internal icon scales into a separate utility function. This function is now used across all components, making the code DRYer and easier to maintain. ## Changes - Created a new utility function `adjustIconScale` in `iconScaleAdjuster.ts`. - Replaced inline logic for adjusting icon scales with calls to `adjustIconScale` in all relevant components. ## Testing - All unit tests pass. - Manual testing in the browser confirms that icons still display correctly at all scales. This change stems from issue #7755 and is expected to make the codebase easier to maintain by reducing repetition of this logic. --------- Co-authored-by: Al-Iqram Elahee <hridoy@Al-Iqrams-MacBook-Pro.local>
Installed and assigned for verification. |
Thanks again @alhridoy for helping out with this! 🏆 |
This looks fantastic! ✨ @jcfranco Follow-up on if we'd also want to include the calcite-design-system/packages/calcite-components/src/components/functional/XButton.tsx Line 36 in f7ecc6c
|
Great catch! 🎣 Yes, we we should update it as well. |
**Related Issue:** #7765 ## Summary Finalizes up the above issue by tackling the `XButton.tsx` (functional component) discussed in #7765 (comment) and #7765 (comment). cc: @jcfranco and related PR #7973
Verified across components. 🎉 |
Description
Stems from #7755.
The logic to adjust internal icon scales (see
calcite-design-system/packages/calcite-components/src/components/alert/alert.tsx
Line 289 in d05c794
cc @driskull @ashetland @SkyeSeitz
Proposed Advantages
DRYer code by having component use this util to get the effective internal icon scale.
Which Component
accordion-item.tsx
action.tsx
alert.tsx
button.tsx
chip.tsx
color-picker-hex-input.tsx
color-picker.tsx
combobox-item.tsx
date-picker-month-header.tsx
dropdown-item.tsx
input-date-picker.tsx
input-number.tsx
input-text.tsx
input.tsx
modal.tsx
notice.tsx
pagination.tsx
popover.tsx
select.tsx
tab-title.tsx
table-header.tsx
table-row.tsx
time-picker.tsx
tree-item.tsx
XButton.tsx
Relevant Info
No response
Calcite package
The text was updated successfully, but these errors were encountered: