refactor: replace deprecated matchMedia listeners with addEventListener#3531
Conversation
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughRefactored the useIsMobile hook to always use Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3531 +/- ##
=======================================
Coverage 85.48% 85.48%
=======================================
Files 461 461
Lines 14240 14240
Branches 1896 1896
=======================================
Hits 12173 12173
Misses 1688 1688
Partials 379 379
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|



Resolves #3515
The useIsMobile hook currently uses addListener and removeListener, which are deprecated in modern browsers. This updates the hook to use the standard addEventListener('change', ...) API, improving code quality.
https://sonarcloud.io/project/issues?open=AZksw2CU_PPcrA-zHUTg&id=OWASP_Nest
Checklist
make check-testlocally: all warnings addressed, tests passed