From 2d5bfa4850f1ae2be0e0c149628216ace074b774 Mon Sep 17 00:00:00 2001 From: Ezerous Date: Fri, 27 Nov 2020 20:52:35 +0200 Subject: [PATCH] PostList improvements --- .../public/locales/en/translation.json | 3 +-- .../src/components/PostCreate/index.jsx | 27 +++---------------- .../src/components/PostCreate/styles.css | 8 ------ .../components/PostList/PostListRow/index.jsx | 11 ++------ .../PostList/PostListRow/styles.css | 4 --- .../src/constants/PostsDatabaseKeys.js | 2 -- .../src/redux/sagas/peerDbReplicationSaga.js | 3 +-- .../src/views/Topic/TopicCreate/index.jsx | 3 +-- 8 files changed, 8 insertions(+), 53 deletions(-) diff --git a/packages/concordia-app/public/locales/en/translation.json b/packages/concordia-app/public/locales/en/translation.json index a6cb0b5..e8681d5 100644 --- a/packages/concordia-app/public/locales/en/translation.json +++ b/packages/concordia-app/public/locales/en/translation.json @@ -6,7 +6,6 @@ "post.create.form.send.button": "Post", "post.form.content.field.placeholder": "Message", "post.form.subject.field.placeholder": "Subject", - "post.list.row.author.pre": "Post by", "post.list.row.post.id": "#{{id}}", "profile.general.tab.address.row.title": "Account address:", "profile.general.tab.location.row.title": "Location:", @@ -55,4 +54,4 @@ "topic.list.row.author.date": "Created by {{author}}, {{timeAgo}}", "topic.list.row.number.of.replies": "{{numberOfReplies}} replies", "topic.list.row.topic.id": "#{{id}}" -} \ No newline at end of file +} diff --git a/packages/concordia-app/src/components/PostCreate/index.jsx b/packages/concordia-app/src/components/PostCreate/index.jsx index fcaec71..b6322ea 100644 --- a/packages/concordia-app/src/components/PostCreate/index.jsx +++ b/packages/concordia-app/src/components/PostCreate/index.jsx @@ -14,7 +14,7 @@ import { USER_PROFILE_PICTURE } from '../../constants/UserDatabaseKeys'; import { breeze, drizzle } from '../../redux/store'; import './styles.css'; import { TRANSACTION_ERROR, TRANSACTION_SUCCESS } from '../../constants/TransactionStatus'; -import { POST_CONTENT, POST_SUBJECT } from '../../constants/PostsDatabaseKeys'; +import { POST_CONTENT } from '../../constants/PostsDatabaseKeys'; import { FORUM_CONTRACT } from '../../constants/ContractNames'; import { POST_CREATED_EVENT } from '../../constants/ForumContractEvents'; @@ -27,7 +27,7 @@ const PostCreate = (props) => { } = props; const transactionStack = useSelector((state) => state.transactionStack); const transactions = useSelector((state) => state.transactions); - const [postSubject, setPostSubject] = useState(initialPostSubject); + const [postSubject] = useState(initialPostSubject); const [postContent, setPostContent] = useState(''); const [userProfilePictureUrl, setUserProfilePictureUrl] = useState(); const [createPostCacheSendStackId, setCreatePostCacheSendStackId] = useState(''); @@ -68,9 +68,6 @@ const PostCreate = (props) => { } switch (event.target.name) { - case 'postSubject': - setPostSubject(event.target.value); - break; case 'postContent': setPostContent(event.target.value); break; @@ -94,11 +91,9 @@ const PostCreate = (props) => { postsDb .put(contractPostId, { - [POST_SUBJECT]: postSubject, [POST_CONTENT]: postContent, }, { pin: true }) .then(() => { - setPostSubject(initialPostSubject); setPostContent(''); setPosting(false); setStoringPost(false); @@ -147,21 +142,6 @@ const PostCreate = (props) => { -
- - - {t('post.list.row.post.id', { id: postIndexInTopic })} - -
-
-