aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/Message.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-06-18 23:27:23 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:52 +0300
commit3aee462b5ca9640c43609b288da16eec5394b382 (patch)
treea8538eb1188091c8a298bbd9a031d653d0050f6c /vnext/src/components/Message.js
parent3b381577f839863eed5aea2c3bb76eaae8706f67 (diff)
fix tags navigation
Diffstat (limited to 'vnext/src/components/Message.js')
-rw-r--r--vnext/src/components/Message.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/vnext/src/components/Message.js b/vnext/src/components/Message.js
index 5667047c..9a15d512 100644
--- a/vnext/src/components/Message.js
+++ b/vnext/src/components/Message.js
@@ -1,5 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
+import { Link } from 'react-router-dom';
import moment from 'moment';
import { UserType } from './Types';
@@ -27,7 +28,7 @@ export default function Message(props) {
</a>
</div>
<div className="msg-tags" itemProp="headline">
- <Tags data={msg.tags || []} />
+ <Tags user={msg.user} data={msg.tags || []} />
</div>
</header>
<div className="msg-txt">
@@ -96,7 +97,7 @@ export default function Message(props) {
function Tags(props) {
return props.data && props.data.map(tag => {
- return (<a key={tag} href={`/tag/${tag}`} title={tag}>{tag}</a>)
+ return (<Link key={tag} to={{ pathname: `/${props.user.uname}`, search: `?tag=${tag}`}} title={tag}>{tag}</Link>)
})
}
@@ -111,6 +112,7 @@ Message.propTypes = {
};
Tags.propTypes = {
+ user: UserType.isRequired,
data: PropTypes.array
}