Open hurshore opened 2 days ago
The latest updates on your projects. Learn more about Vercel for Git βοΈ
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
rnr-docs | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Nov 23, 2024 10:19pm |
rnr-showcase | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Nov 23, 2024 10:19pm |
Pull Request Template
Description:
This PR introduces a new
useFontScale
hook to address text scaling issues in buttons and inputs on iOS and Android. Currently, when users increase their device's font size settings, text can get cut off in UI elements since they don't scale accordingly.The hook provides utilities to dynamically adjust component heights based on the system font scale, ensuring text remains visible and properly contained within UI elements. It uses React Native's
useWindowDimensions
to reactively update when system font settings change.Fixes #219
Tested Platforms:
Affected Apps/Packages:
Screenshots:
Input/button with default font scale
Input/button with increased font scale
Notes:
fontScale
: current system font scale factorgetScaledSize
: scales any size value according to system font scalegetScaledHeight
: calculates appropriate container height based on font sizeExample usage in components: