From ffef60aff50dd45170c84413ae14df69bd018bea Mon Sep 17 00:00:00 2001 From: Apostolof Date: Tue, 17 Nov 2020 00:29:17 +0200 Subject: [PATCH] Replace post list with feed --- .../public/locales/en/translation.json | 2 +- .../components/PostList/PostListRow/index.jsx | 92 +++++++++---------- .../PostList/PostListRow/styles.css | 26 ++---- .../src/components/PostList/index.jsx | 4 +- 4 files changed, 57 insertions(+), 67 deletions(-) diff --git a/packages/concordia-app/public/locales/en/translation.json b/packages/concordia-app/public/locales/en/translation.json index d466c8b..ab15e35 100644 --- a/packages/concordia-app/public/locales/en/translation.json +++ b/packages/concordia-app/public/locales/en/translation.json @@ -2,7 +2,7 @@ "board.header.no.topics.message": "There are no topics yet!", "board.sub.header.no.topics.guest": "Sign up and be the first to post.", "board.sub.header.no.topics.user": "Be the first to post.", - "post.list.row.author.date": "Posted by {{author}}, {{timeAgo}}", + "post.list.row.author.pre": "Post by", "post.list.row.post.id": "#{{id}}", "register.card.header": "Sign Up", "register.form.button.back": "Back", diff --git a/packages/concordia-app/src/components/PostList/PostListRow/index.jsx b/packages/concordia-app/src/components/PostList/PostListRow/index.jsx index ac639a6..5f754c1 100644 --- a/packages/concordia-app/src/components/PostList/PostListRow/index.jsx +++ b/packages/concordia-app/src/components/PostList/PostListRow/index.jsx @@ -2,7 +2,7 @@ import React, { memo, useEffect, useMemo, useState, } from 'react'; import { - Dimmer, Grid, Image, List, Placeholder, + Dimmer, Icon, Image, Feed, Placeholder, } from 'semantic-ui-react'; import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; @@ -88,52 +88,50 @@ const PostListRow = (props) => { }, [postAuthorAddress, users]); return useMemo(() => ( - - {postAuthorMeta !== null && postAuthorMeta[PROFILE_PICTURE] - ? ( - - ) - : ( - - )} - - - - - {postSubject !== null - ? postSubject - : } - - - - {t('post.list.row.post.id', { id: postId })} - - - - - - - - {postAuthor !== null && timeAgo !== null - ? t('post.list.row.author.date', { author: postAuthor, timeAgo }) - : } - - - - - - {postMessage} - + + + {postAuthorMeta !== null && postAuthorMeta[PROFILE_PICTURE] + ? ( + + ) + : ( + + )} + + + +
+ {postSubject !== null + ? postSubject + : } + + {t('post.list.row.post.id', { id: postId })} + +
+ {postAuthor !== null && timeAgo !== null + ? ( + <> + {t('post.list.row.author.pre')} +   + {postAuthor} + {timeAgo} + + ) + : } +
+ + {postMessage} + +
), [loading, postAuthor, postAuthorMeta, postId, postMessage, postSubject, t, timeAgo]); }; diff --git a/packages/concordia-app/src/components/PostList/PostListRow/styles.css b/packages/concordia-app/src/components/PostList/PostListRow/styles.css index 83f366b..d74bc71 100644 --- a/packages/concordia-app/src/components/PostList/PostListRow/styles.css +++ b/packages/concordia-app/src/components/PostList/PostListRow/styles.css @@ -1,21 +1,13 @@ -.post-metadata { - font-size: 12px !important; - font-weight: initial; +.post-profile-picture { + margin: 5px 0 0 0; } -.list-item { - display: flex !important; - text-align: start; +.post-summary-meta-index { + float: right; + font-size: 12px; + opacity: 0.4; } -.profile-picture { - cursor: pointer; - max-width: 36px; - max-height: 36px; - margin: 0; - vertical-align: middle; -} - -.list-content { - flex-grow: 1; -} +.post-summary-meta-date { + float: right !important; +} \ No newline at end of file diff --git a/packages/concordia-app/src/components/PostList/index.jsx b/packages/concordia-app/src/components/PostList/index.jsx index d961233..991fc2f 100644 --- a/packages/concordia-app/src/components/PostList/index.jsx +++ b/packages/concordia-app/src/components/PostList/index.jsx @@ -3,7 +3,7 @@ import React, { } from 'react'; import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; -import { Dimmer, List, Loader } from 'semantic-ui-react'; +import { Dimmer, Feed, Loader } from 'semantic-ui-react'; import PostListRow from './PostListRow'; import { drizzle } from '../../redux/store'; @@ -55,7 +55,7 @@ const PostList = (props) => { }, [getPostCallHashes, loading, postIds]); return ( - + {posts}