diff options
author | Vitaly Takmazov | 2018-06-18 23:34:47 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:52 +0300 |
commit | 3a6ac190800644dba207b0c7b4d65640ca7175c3 (patch) | |
tree | 85c2406748d8852a376a48ff61cd5dabf0319f6c /vnext | |
parent | 3aee462b5ca9640c43609b288da16eec5394b382 (diff) |
fix other links
Diffstat (limited to 'vnext')
-rw-r--r-- | vnext/src/components/Avatar.js | 7 | ||||
-rw-r--r-- | vnext/src/components/Message.js | 14 | ||||
-rw-r--r-- | vnext/src/index.js | 2 |
3 files changed, 14 insertions, 9 deletions
diff --git a/vnext/src/components/Avatar.js b/vnext/src/components/Avatar.js index 72b5d2d1..c6dc71ec 100644 --- a/vnext/src/components/Avatar.js +++ b/vnext/src/components/Avatar.js @@ -1,11 +1,14 @@ import React from 'react'; +import { Link } from 'react-router-dom'; import { UserType } from './Types'; export default function Avatar(props) { return ( - <div className="msg-avatar"><a href={`/${props.user.uname}/`}> - <img src={`//i.juick.com/a/${props.user.uid}.png`} alt={`${props.user.uname}`} /></a> + <div className="msg-avatar"> + <Link to={{ pathname: `/${props.user.uname}/`}}> + <img src={`//i.juick.com/a/${props.user.uid}.png`} alt={`${props.user.uname}`} /> + </Link> </div> ); } diff --git a/vnext/src/components/Message.js b/vnext/src/components/Message.js index 9a15d512..e03935ce 100644 --- a/vnext/src/components/Message.js +++ b/vnext/src/components/Message.js @@ -16,16 +16,18 @@ export default function Message(props) { <div className="msg-cont" itemProp="blogPost" itemScope="" itemType="http://schema.org/BlogPosting" itemRef="org"> <header className="h"> <span itemProp="author" itemScope="" itemType="http://schema.org/Person"> - <a href={`/${msg.user.uname}/`} itemProp="url" rel="author"><span itemProp="name">{msg.user.uname}</span></a> + <Link to={{ pathname: `/${msg.user.uname}/` }} itemProp="url" rel="author"> + <span itemProp="name">{msg.user.uname}</span> + </Link> </span> <Avatar user={msg.user} /> <div className="msg-ts"> - <a href={`/${msg.user.uname}/${msg.mid}`}> + <Link to={{ pathname: `/${msg.user.uname}/${msg.mid}` }}> <time itemProp="datePublished dateModified" itemType="http://schema.org/Date" dateTime={msg.timestamp} title={moment.utc(msg.timestamp).local().format('lll')}> {moment.utc(msg.timestamp).fromNow()} </time> - </a> + </Link> </div> <div className="msg-tags" itemProp="headline"> <Tags user={msg.user} data={msg.tags || []} /> @@ -67,7 +69,7 @@ export default function Message(props) { )} {!Boolean(msg.ReadOnly) | (visitor.uid === msg.user.uid) && ( <React.Fragment> - <a href={`/${msg.user.uname}/${msg.mid}`} className="a-comment msg-button"> + <Link to={{ pathname: `/${msg.user.uname}/${msg.mid}` }} className="a-comment msg-button"> <span className="msg-button-icon"> <Icon name="ei-comment" size="s" /> {msg.replies > 0 && @@ -79,7 +81,7 @@ export default function Message(props) { } </span> <span> Comment</span> - </a> + </Link> <a href="#" className="msg-menu msg-button"> <Icon name="ei-link" size="s" /> <span> Share</span> @@ -97,7 +99,7 @@ export default function Message(props) { function Tags(props) { return props.data && props.data.map(tag => { - return (<Link key={tag} to={{ pathname: `/${props.user.uname}`, search: `?tag=${tag}`}} title={tag}>{tag}</Link>) + return (<Link key={tag} to={{ pathname: `/${props.user.uname}`, search: `?tag=${tag}` }} title={tag}>{tag}</Link>) }) } diff --git a/vnext/src/index.js b/vnext/src/index.js index 24421545..3a5fcbfe 100644 --- a/vnext/src/index.js +++ b/vnext/src/index.js @@ -121,10 +121,10 @@ class App extends React.Component { <Switch> <Route exact path="/" render={(props) => <Discover visitor={this.state.visitor} {...props} />} /> <Route exact path="/discussions" render={(props) => <Discussions visitor={this.state.visitor} {...props} />} /> + <Route exact path="/post" render={(props) => <Post visitor={this.state.visitor} {...props} />} /> <Route exact path="/:user" render={(props) => <Blog visitor={this.state.visitor} {...props} />} /> <Route exact path="/tag/:tag" render={(props) => <Tag visitor={this.state.visitor} {...props} />} /> <Route exact path="/:user/:mid" render={(props) => <Thread visitor={this.state.visitor} {...props} />} /> - <Route exact path="/post" render={(props) => <Post visitor={this.state.visitor} {...props} />} /> </Switch> </section> <aside id="column"></aside> |