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 }) });
|
||||
|
||||
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>
|
||||
)}
|
||||
|
|
|
@ -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'>
|
||||
|
|
|
@ -44,6 +44,7 @@ export const shortNumberFormat = (number: any, max?: number): React.ReactNode =>
|
|||
maximumFractionDigits={0}
|
||||
minimumFractionDigits={0}
|
||||
maximumSignificantDigits={3}
|
||||
numberingSystem='latn'
|
||||
style='decimal'
|
||||
/>
|
||||
{factor}
|
||||
|
|
Loading…
Reference in a new issue