diff options
Diffstat (limited to 'vnext/src/ui/Message.js')
-rw-r--r-- | vnext/src/ui/Message.js | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/vnext/src/ui/Message.js b/vnext/src/ui/Message.js index e4135700..ec9af46f 100644 --- a/vnext/src/ui/Message.js +++ b/vnext/src/ui/Message.js @@ -6,7 +6,6 @@ dayjs.extend(utc) import relativeTime from 'dayjs/plugin/relativeTime' dayjs.extend(relativeTime) -import { Link } from 'react-router-dom' import Icon from './Icon' import Avatar from './Avatar' import { UserLink } from './UserInfo' @@ -63,19 +62,17 @@ export default function Message({ data, isThread, onToggleSubscription, children data.user && <Avatar user={data.user}> <div className="msg-ts"> - <Link to={`/${data.user.uname}/${data.mid}`} state={{ data: data }}> + <a href={`/${data.user.uname}/${data.mid}`}> <time dateTime={data.timestamp} title={dayjs.utc(data.timestamp).local().format('lll')}> {dayjs.utc(data.timestamp).fromNow()} </time> - </Link> + </a> { visitor.uid == data.user.uid && <> <span> · </span> - <Link to={{ - pathname: '/post', - }} state={{ data: data }}>Edit</Link> + <a href={'/post'}>Edit</a> </> } </div> @@ -101,21 +98,20 @@ export default function Message({ data, isThread, onToggleSubscription, children {canComment && <nav className="l"> {data.user && visitor.uid === data.user.uid ? ( - <Link to={`/${data.user.uname}/${data.mid}`} className="a-like msg-button" - state={{ data: data }}> + <a href={`/${data.user.uname}/${data.mid}`} className="a-like msg-button"> <Icon name="ei-heart" size="s" /> <span>{likesSummary}</span> - </Link> + </a> ) : visitor.uid > 0 ? ( - <Link to={'/post'} className="a-like msg-button"> + <a href={'/post'} className="a-like msg-button"> <Icon name="ei-heart" size="s" /> <span>{likesSummary}</span> - </Link> + </a> ) : ( - <Link to="/login" className="a-login msg-button"> + <a href="/login" className="a-login msg-button"> <Icon name="ei-heart" size="s" /> <span>{likesSummary}</span> - </Link> + </a> )} { data.user && canComment && (( @@ -131,11 +127,10 @@ export default function Message({ data, isThread, onToggleSubscription, children </>)} </a> ) : ( - <Link to={`/${data.user.uname}/${data.mid}`} className="a-comment msg-button" - state={{ data: data }}> + <a href={`/${data.user.uname}/${data.mid}`} className="a-comment msg-button"> <Icon name="ei-comment" size="s" /> <span>{commentsSummary}</span> - </Link> + </a> ) )) } @@ -164,9 +159,9 @@ function Tags({ data, user }) { data.map((tag, index) => ( <Fragment key={tag}> {index > 0 && ' '} - <Link key={tag} to={`/${user.uname}?tag=${tag}`} title={tag}> + <a key={tag} href={`/${user.uname}?tag=${tag}`} title={tag}> {tag} - </Link> + </a> </Fragment> )) } |