mirror of
https://github.com/urbit/shrub.git
synced 2024-12-23 19:05:48 +03:00
Post: show reply if main post
This commit is contained in:
parent
86fd281bd0
commit
d14b4ea471
@ -23,6 +23,7 @@ export class PostFeed extends React.Component {
|
||||
history,
|
||||
baseUrl,
|
||||
parentNode,
|
||||
grandparentNode,
|
||||
association,
|
||||
group,
|
||||
vip
|
||||
@ -52,7 +53,9 @@ export class PostFeed extends React.Component {
|
||||
<PostItem
|
||||
key={parentNode.post.index}
|
||||
ref={ref}
|
||||
parentPost={grandparentNode?.post}
|
||||
node={parentNode}
|
||||
parentNode={grandparentNode}
|
||||
graphPath={graphPath}
|
||||
association={association}
|
||||
api={api}
|
||||
|
@ -114,10 +114,10 @@ class PostItem extends React.Component {
|
||||
association={association}
|
||||
showTimestamp={isRelativeTime}
|
||||
isReply={isReply} />
|
||||
{ isReply ? (
|
||||
{ (isReply || (parentPost && index.length > 1 && isParent)) ? (
|
||||
<Row width="100%" alignItems="center" mb="2" pl="2" pr="2">
|
||||
<Text color="gray" pr="1">Replying to</Text>
|
||||
<Mention ship={parentPost.author} />
|
||||
<Mention ship={parentPost?.author} />
|
||||
</Row>
|
||||
) : null }
|
||||
<PostContent
|
||||
|
@ -41,11 +41,15 @@ export default function PostReplies(props) {
|
||||
});
|
||||
|
||||
let node;
|
||||
nodeIndex.forEach((i) => {
|
||||
let parentNode;
|
||||
nodeIndex.forEach((i, idx) => {
|
||||
if (!graph) {
|
||||
return null;
|
||||
}
|
||||
node = graph.get(i);
|
||||
if(idx < nodeIndex.length - 1) {
|
||||
parentNode = node;
|
||||
}
|
||||
if (!node) {
|
||||
return null;
|
||||
}
|
||||
@ -101,6 +105,7 @@ export default function PostReplies(props) {
|
||||
key={locationUrl}
|
||||
graphPath={graphPath}
|
||||
graph={graph}
|
||||
grandparentNode={parentNode}
|
||||
parentNode={node}
|
||||
pendingSize={pendingSize}
|
||||
association={association}
|
||||
|
Loading…
Reference in New Issue
Block a user