Merge branch 'latn' into 'main'
Force use of latn numberingSystem throughout the UI Closes #1580 See merge request soapbox-pub/soapbox!2821
This commit is contained in:
commit
eed328552f
3 changed files with 13 additions and 2 deletions
|
@ -38,7 +38,9 @@ const AnimatedNumber: React.FC<IAnimatedNumber> = ({ value, obfuscate }) => {
|
||||||
const willLeave = () => ({ y: spring(1 * direction, { damping: 35, stiffness: 400 }) });
|
const willLeave = () => ({ y: spring(1 * direction, { damping: 35, stiffness: 400 }) });
|
||||||
|
|
||||||
if (reduceMotion) {
|
if (reduceMotion) {
|
||||||
return obfuscate ? <>{obfuscatedCount(displayedValue)}</> : <FormattedNumber value={displayedValue} />;
|
return obfuscate
|
||||||
|
? <>{obfuscatedCount(displayedValue)}</>
|
||||||
|
: <FormattedNumber value={displayedValue} numberingSystem='latn' />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = [{
|
const styles = [{
|
||||||
|
@ -52,7 +54,14 @@ const AnimatedNumber: React.FC<IAnimatedNumber> = ({ value, obfuscate }) => {
|
||||||
{items => (
|
{items => (
|
||||||
<span className='relative inline-flex flex-col items-stretch overflow-hidden'>
|
<span className='relative inline-flex flex-col items-stretch overflow-hidden'>
|
||||||
{items.map(({ key, data, style }) => (
|
{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>
|
</span>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -29,6 +29,7 @@ const DashCounter: React.FC<IDashCounter> = ({ count, label, to = '#', percent =
|
||||||
value={count}
|
value={count}
|
||||||
style={percent ? 'unit' : undefined}
|
style={percent ? 'unit' : undefined}
|
||||||
unit={percent ? 'percent' : undefined}
|
unit={percent ? 'percent' : undefined}
|
||||||
|
numberingSystem='latn'
|
||||||
/>
|
/>
|
||||||
</Text>
|
</Text>
|
||||||
<Text align='center'>
|
<Text align='center'>
|
||||||
|
|
|
@ -44,6 +44,7 @@ export const shortNumberFormat = (number: any, max?: number): React.ReactNode =>
|
||||||
maximumFractionDigits={0}
|
maximumFractionDigits={0}
|
||||||
minimumFractionDigits={0}
|
minimumFractionDigits={0}
|
||||||
maximumSignificantDigits={3}
|
maximumSignificantDigits={3}
|
||||||
|
numberingSystem='latn'
|
||||||
style='decimal'
|
style='decimal'
|
||||||
/>
|
/>
|
||||||
{factor}
|
{factor}
|
||||||
|
|
Loading…
Reference in a new issue