Force use of latn numberingSystem throughout the UI

Fixes https://gitlab.com/soapbox-pub/soapbox/-/issues/1580
environments/review-latn-e24c1r/deployments/4186
Alex Gleason 2023-10-15 13:08:15 -05:00
rodzic 374f99405e
commit 20a63d2915
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
3 zmienionych plików z 13 dodań i 2 usunięć

Wyświetl plik

@ -38,7 +38,9 @@ const AnimatedNumber: React.FC<IAnimatedNumber> = ({ value, obfuscate }) => {
const willLeave = () => ({ y: spring(1 * direction, { damping: 35, stiffness: 400 }) });
if (reduceMotion) {
return obfuscate ? <>{obfuscatedCount(displayedValue)}</> : <FormattedNumber value={displayedValue} />;
return obfuscate
? <>{obfuscatedCount(displayedValue)}</>
: <FormattedNumber value={displayedValue} numberingSystem='latn' />;
}
const styles = [{
@ -52,7 +54,14 @@ const AnimatedNumber: React.FC<IAnimatedNumber> = ({ value, obfuscate }) => {
{items => (
<span className='relative inline-flex flex-col items-stretch overflow-hidden'>
{items.map(({ key, data, style }) => (
<span key={key} style={{ position: (direction * style.y) > 0 ? 'absolute' : 'static', transform: `translateY(${style.y * 100}%)` }}>{obfuscate ? obfuscatedCount(data) : <FormattedNumber value={data} />}</span>
<span
key={key}
style={{ position: (direction * style.y) > 0 ? 'absolute' : 'static', transform: `translateY(${style.y * 100}%)` }}
>
{obfuscate
? obfuscatedCount(data)
: <FormattedNumber value={data} numberingSystem='latn' />}
</span>
))}
</span>
)}

Wyświetl plik

@ -29,6 +29,7 @@ const DashCounter: React.FC<IDashCounter> = ({ count, label, to = '#', percent =
value={count}
style={percent ? 'unit' : undefined}
unit={percent ? 'percent' : undefined}
numberingSystem='latn'
/>
</Text>
<Text align='center'>

Wyświetl plik

@ -44,6 +44,7 @@ export const shortNumberFormat = (number: any, max?: number): React.ReactNode =>
maximumFractionDigits={0}
minimumFractionDigits={0}
maximumSignificantDigits={3}
numberingSystem='latn'
style='decimal'
/>
{factor}