|
|
|
@ -25,28 +25,25 @@ const Feed = () => { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (tick.current === tick.next.timestamp) { |
|
|
|
|
const newItems = tick.next.events as Event[]; |
|
|
|
|
// Current tick is a new event.
|
|
|
|
|
|
|
|
|
|
const limit = Math.min(8, feedItems.length) |
|
|
|
|
for (let i = 0; i < limit; i++) { |
|
|
|
|
const newItems: any[] = []; |
|
|
|
|
for (let i = 0; i < feedItems.length; i++) { |
|
|
|
|
newItems.push(feedItems[i]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (let j = 0; j < newItems.length; j++) { |
|
|
|
|
newItems[j].key = j; |
|
|
|
|
for (let j = 0; j < tick.next.events.length; j++) { |
|
|
|
|
newItems.push(tick.next.events[j]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
setFeedItems(newItems); |
|
|
|
|
console.log(newItems) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
console.log(feedItems) |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
return () => { |
|
|
|
|
socket.off("tick_event"); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, [feedItems]); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
// <Col className="feed" span={16}>
|
|
|
|
@ -60,12 +57,11 @@ const Feed = () => { |
|
|
|
|
// )}
|
|
|
|
|
// </Col>
|
|
|
|
|
<Col className="time-feed" span={16}> |
|
|
|
|
<Timeline mode="alternate"> |
|
|
|
|
<Timeline mode="alternate" reverse={true}> |
|
|
|
|
{feedItems.map(item => |
|
|
|
|
<Timeline.Item> |
|
|
|
|
{/*dot={<img src={images[item.type]} alt="logo"/>}>*/} |
|
|
|
|
{/*{item.text[0]} - {item.text[1]}*/} |
|
|
|
|
{item} |
|
|
|
|
{item.text[0]} - {item.text[1]} |
|
|
|
|
</Timeline.Item> |
|
|
|
|
)} |
|
|
|
|
|
|
|
|
|