[Glitch] Add streaming API updates for announcements being modified or deleted
Port b9d74d4076
to glitch-soc
Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
committed by
Thibaut Girka
parent
8a8936725e
commit
e36d0a98cc
@ -27,7 +27,8 @@ export default class AnimatedNumber extends React.PureComponent {
|
||||
}
|
||||
|
||||
const styles = [{
|
||||
key: value,
|
||||
key: `${value}`,
|
||||
data: value,
|
||||
style: { y: spring(0, { damping: 35, stiffness: 400 }) },
|
||||
}];
|
||||
|
||||
@ -35,8 +36,8 @@ export default class AnimatedNumber extends React.PureComponent {
|
||||
<TransitionMotion styles={styles} willEnter={this.willEnter} willLeave={this.willLeave}>
|
||||
{items => (
|
||||
<span className='animated-number'>
|
||||
{items.map(({ key, style }) => (
|
||||
<span key={key} style={{ position: style.y > 0 ? 'absolute' : 'static', transform: `translateY(${style.y * 100}%)` }}><FormattedNumber value={key} /></span>
|
||||
{items.map(({ key, data, style }) => (
|
||||
<span key={key} style={{ position: style.y > 0 ? 'absolute' : 'static', transform: `translateY(${style.y * 100}%)` }}><FormattedNumber value={data} /></span>
|
||||
))}
|
||||
</span>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user