aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vnext/src/ui/Message.js8
-rw-r--r--vnext/src/ui/Thread.js4
2 files changed, 7 insertions, 5 deletions
diff --git a/vnext/src/ui/Message.js b/vnext/src/ui/Message.js
index f8d3dc51..dd6fc0ce 100644
--- a/vnext/src/ui/Message.js
+++ b/vnext/src/ui/Message.js
@@ -51,7 +51,7 @@ export default function Message({ visitor, data, children }) {
data.user &&
<Avatar user={data.user}>
<div className="msg-ts">
- <Link to={`/${data.user.uname}/${data.mid}`}>
+ <Link to={`/${data.user.uname}/${data.mid}`} state={{ data: data }}>
<time dateTime={data.timestamp}
title={moment.utc(data.timestamp).local().format('lll')}>
{moment.utc(data.timestamp).fromNow()}
@@ -92,7 +92,8 @@ export default function Message({ visitor, data, children }) {
<div className="embedContainer" ref={embedRef} />
<nav className="l">
{data.user && visitor.uid === data.user.uid ? (
- <Link to={`/${data.user.uname}/${data.mid}`} className="a-like msg-button">
+ <Link to={`/${data.user.uname}/${data.mid}`} className="a-like msg-button"
+ state={{ data: data }}>
<Icon name="ei-heart" size="s" />
<span>{likesSummary}</span>
</Link>
@@ -108,7 +109,8 @@ export default function Message({ visitor, data, children }) {
</Link>
)}
{data.user && canComment && (
- <Link to={`/${data.user.uname}/${data.mid}`} className="a-comment msg-button">
+ <Link to={`/${data.user.uname}/${data.mid}`} className="a-comment msg-button"
+ state={{ data: data }}>
<Icon name="ei-comment" size="s" />
<span>{commentsSummary}</span>
</Link>
diff --git a/vnext/src/ui/Thread.js b/vnext/src/ui/Thread.js
index 0f0f88e3..5c9412d6 100644
--- a/vnext/src/ui/Thread.js
+++ b/vnext/src/ui/Thread.js
@@ -21,7 +21,7 @@ const emptyMessage = {};
export default function Thread(props) {
const location = useLocation();
const params = useParams();
- const [message, setMessage] = useState((location.state || {}).msg || {});
+ const [message, setMessage] = useState((location.state || {}).data || {});
const [replies, setReplies] = useState([]);
const [loading, setLoading] = useState(false);
const [active, setActive] = useState(0);
@@ -112,7 +112,7 @@ export default function Thread(props) {
<Comment msg={msg} draft={msg.rid === editing.replyto ? editing.body : ''} visitor={props.visitor} active={active} setActive={setActive} onStartEditing={startEditing} postComment={postComment} />
</li>
)) : (
- <>
+ <>
{
Array(loaders).fill().map((it, i) => <Spinner key={i} />)
}