From 558578f5d909773ab113b1579b707c1142d56649 Mon Sep 17 00:00:00 2001 From: Apostolof Date: Sun, 6 Dec 2020 17:26:15 +0200 Subject: [PATCH] Change topic header moment date with TimeAgo --- packages/concordia-app/src/views/Topic/TopicView/index.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/concordia-app/src/views/Topic/TopicView/index.jsx b/packages/concordia-app/src/views/Topic/TopicView/index.jsx index ec5196a..d237e98 100644 --- a/packages/concordia-app/src/views/Topic/TopicView/index.jsx +++ b/packages/concordia-app/src/views/Topic/TopicView/index.jsx @@ -4,9 +4,9 @@ import { useDispatch, useSelector } from 'react-redux'; import { Container, Dimmer, Icon, Image, Placeholder, Step, } from 'semantic-ui-react'; -import moment from 'moment'; import { Link } from 'react-router-dom'; import { useHistory } from 'react-router'; +import TimeAgo from 'react-timeago'; import { breeze, drizzle } from '../../../redux/store'; import { FETCH_USER_DATABASE } from '../../../redux/actions/peerDbReplicationActions'; import './styles.css'; @@ -65,7 +65,7 @@ const TopicView = (props) => { setTopicAuthorAddress(getTopicResults[getTopicCallHash].value[0]); setTopicAuthor(getTopicResults[getTopicCallHash].value[1]); - setTimestamp(getTopicResults[getTopicCallHash].value[2]); + setTimestamp(getTopicResults[getTopicCallHash].value[2] * 1000); setPostIds(getTopicResults[getTopicCallHash].value[3].map((postId) => parseInt(postId, 10))); const topicFound = topics @@ -163,7 +163,7 @@ const TopicView = (props) => { {timestamp - ? moment(timestamp * 1000).fromNow() + ? : (