Add streaming API updates for announcements being modified or deleted (#12963)

Change `all_day` to be a visual client-side cue only

Publish immediately if `scheduled_at` is in the past

Add `published_at` and `updated_at` to announcements JSON
This commit is contained in:
Eugen Rochko
2020-01-26 20:07:26 +01:00
committed by GitHub
parent 408b3e2b93
commit b9d74d4076
12 changed files with 100 additions and 41 deletions

View File

@ -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>
)}