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