|
@ -15,7 +15,7 @@ import './styles.css'; |
|
|
import { POSTS_DATABASE, USER_DATABASE } from '../../../constants/OrbitDatabases'; |
|
|
import { POSTS_DATABASE, USER_DATABASE } from '../../../constants/OrbitDatabases'; |
|
|
import determineKVAddress from '../../../utils/orbitUtils'; |
|
|
import determineKVAddress from '../../../utils/orbitUtils'; |
|
|
import { USER_PROFILE_PICTURE } from '../../../constants/UserDatabaseKeys'; |
|
|
import { USER_PROFILE_PICTURE } from '../../../constants/UserDatabaseKeys'; |
|
|
import { POST_CONTENT, POST_SUBJECT } from '../../../constants/PostsDatabaseKeys'; |
|
|
import { POST_CONTENT } from '../../../constants/PostsDatabaseKeys'; |
|
|
import { FORUM_CONTRACT } from '../../../constants/ContractNames'; |
|
|
import { FORUM_CONTRACT } from '../../../constants/ContractNames'; |
|
|
|
|
|
|
|
|
const { orbit } = breeze; |
|
|
const { orbit } = breeze; |
|
@ -28,7 +28,6 @@ const PostListRow = (props) => { |
|
|
const [postAuthorAddress, setPostAuthorAddress] = useState(null); |
|
|
const [postAuthorAddress, setPostAuthorAddress] = useState(null); |
|
|
const [postAuthor, setPostAuthor] = useState(null); |
|
|
const [postAuthor, setPostAuthor] = useState(null); |
|
|
const [timeAgo, setTimeAgo] = useState(null); |
|
|
const [timeAgo, setTimeAgo] = useState(null); |
|
|
const [postSubject, setPostSubject] = useState(null); |
|
|
|
|
|
const [postContent, setPostContent] = useState(null); |
|
|
const [postContent, setPostContent] = useState(null); |
|
|
const [postAuthorMeta, setPostAuthorMeta] = useState(null); |
|
|
const [postAuthorMeta, setPostAuthorMeta] = useState(null); |
|
|
const userAddress = useSelector((state) => state.user.address); |
|
|
const userAddress = useSelector((state) => state.user.address); |
|
@ -68,7 +67,6 @@ const PostListRow = (props) => { |
|
|
.find((post) => post.id === postId); |
|
|
.find((post) => post.id === postId); |
|
|
|
|
|
|
|
|
if (postFound) { |
|
|
if (postFound) { |
|
|
setPostSubject(postFound[POST_SUBJECT]); |
|
|
|
|
|
setPostContent(postFound[POST_CONTENT]); |
|
|
setPostContent(postFound[POST_CONTENT]); |
|
|
} |
|
|
} |
|
|
}, [postId, posts]); |
|
|
}, [postId, posts]); |
|
@ -126,9 +124,6 @@ const PostListRow = (props) => { |
|
|
<Feed.Content> |
|
|
<Feed.Content> |
|
|
<Feed.Summary> |
|
|
<Feed.Summary> |
|
|
<div> |
|
|
<div> |
|
|
{postSubject !== null |
|
|
|
|
|
? postSubject |
|
|
|
|
|
: <Placeholder><Placeholder.Line length="very long" /></Placeholder>} |
|
|
|
|
|
<span className="post-summary-meta-index"> |
|
|
<span className="post-summary-meta-index"> |
|
|
{t('post.list.row.post.id', { id: postIndexInTopic })} |
|
|
{t('post.list.row.post.id', { id: postIndexInTopic })} |
|
|
</span> |
|
|
</span> |
|
@ -136,8 +131,6 @@ const PostListRow = (props) => { |
|
|
{postAuthor !== null && setPostAuthorAddress !== null && timeAgo !== null |
|
|
{postAuthor !== null && setPostAuthorAddress !== null && timeAgo !== null |
|
|
? ( |
|
|
? ( |
|
|
<> |
|
|
<> |
|
|
{t('post.list.row.author.pre')} |
|
|
|
|
|
|
|
|
|
|
|
<Feed.User as={Link} to={`/users/${postAuthorAddress}`}>{postAuthor}</Feed.User> |
|
|
<Feed.User as={Link} to={`/users/${postAuthorAddress}`}>{postAuthor}</Feed.User> |
|
|
<Feed.Date className="post-summary-meta-date">{timeAgo}</Feed.Date> |
|
|
<Feed.Date className="post-summary-meta-date">{timeAgo}</Feed.Date> |
|
|
</> |
|
|
</> |
|
@ -150,7 +143,7 @@ const PostListRow = (props) => { |
|
|
</Feed.Content> |
|
|
</Feed.Content> |
|
|
</Dimmer.Dimmable> |
|
|
</Dimmer.Dimmable> |
|
|
), [ |
|
|
), [ |
|
|
authorAvatarLink, loading, postAuthor, postAuthorAddress, postContent, postIndexInTopic, postSubject, t, timeAgo, |
|
|
authorAvatarLink, loading, postAuthor, postAuthorAddress, postContent, postIndexInTopic, t, timeAgo, |
|
|
]); |
|
|
]); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|