aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/Message.js
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-07-06 01:32:43 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:53 +0300
commit7f25b0f261b5a5fc2696054004fb24673375b91b (patch)
tree38ee591e176b4799e39eff7a16f1950e017e7bb4 /vnext/src/components/Message.js
parent88732ba8c06c23a93f7248b6eabc182f38be3d33 (diff)
Proptypes & eslint
Diffstat (limited to 'vnext/src/components/Message.js')
-rw-r--r--vnext/src/components/Message.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/vnext/src/components/Message.js b/vnext/src/components/Message.js
index ae981df6..d9a32a11 100644
--- a/vnext/src/components/Message.js
+++ b/vnext/src/components/Message.js
@@ -47,7 +47,7 @@ export default function Message({ data, visitor, children, ...rest }) {
<span>&nbsp;Recommend</span>
</a>
) : visitor.uid > 0 ? (
- <Link to={{ pathname: "/post", search: `?body=!+%23${data.mid}` }} className="a-like msg-button">
+ <Link to={{ pathname: '/post', search: `?body=!+%23${data.mid}` }} className="a-like msg-button">
<span className="msg-button-icon">
<Icon name="ei-heart" size="s" />
{data.likes > 0 && (` ${data.likes}`)}
@@ -63,13 +63,13 @@ export default function Message({ data, visitor, children, ...rest }) {
<span>&nbsp;Recommend</span>
</a>
)}
- {!Boolean(data.ReadOnly) | (visitor.uid === data.user.uid) && (
+ {!data.ReadOnly | (visitor.uid === data.user.uid) && (
<React.Fragment>
<Link to={{ pathname: `/${data.user.uname}/${data.mid}`, state: { msg: data } }} className="a-comment msg-button">
<span className="msg-button-icon">
<Icon name="ei-comment" size="s" />
{data.replies > 0 &&
- (Boolean(data.unread) ? (
+ (data.unread ? (
<span className="badge">${data.replies}</span>
) : (
`${data.replies}`
@@ -107,6 +107,7 @@ function Tags({ data, user, ...rest }) {
Message.propTypes = {
data: MessageType,
+ visitor: UserType.isRequired,
children: PropTypes.node
};