Repository
https://github.com/knacksteem/knacksteem.org
Pull Request
https://github.com/knacksteem/knacksteem.org/pull/54
This PR adds the user avatar, the time the the post was made, and the tags entered by the user on posting to the block chain and refactor of component to add the similar post feature to the ArticleDetail component.
The overall responsive layout of the Editor post area has being fixed along with the ArticleDetailI component which was referenced in the issues below.
https://github.com/knacksteem/knacksteem.org/issues/53
Made use of the PrettyDate function to return time in a nice format on the ArticleListItem.
export const prettyDate = (time) => {
const date = new Date(time),
diff = (((new Date()).getTime() - date.getTime()) / 1000) + date.getTimezoneOffset() * 60,
day_diff = Math.floor(diff / 86400);
if (day_diff === 0) {
//posted just today
if (diff < 60) {
return 'just now';
} else if (diff < 120) {
return '1 minute ago';
} else if (diff < 3600) {
return Math.floor(diff / 60) + ' minutes ago';
} else if (diff < 7200) {
return '1 hour ago';
} else {
return Math.floor(diff / 3600) + ' hours ago';
}
} else if (day_diff === 1) {
return 'yesterday';
} else if (day_diff < 7) {
return day_diff + ' days ago';
} else {
return Math.ceil(day_diff / 7) + ' weeks ago';
}
};
Issue
https://github.com/knacksteem/knacksteem.org/issues/53
Task Request
What's next?
I believe notifications and layouts for moderator will be my next target.