mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 01:32:47 +00:00
Change author names to UserPage links
This commit is contained in:
@@ -7,7 +7,7 @@ const Nav = require('naturalcrit/nav/nav.jsx');
|
|||||||
|
|
||||||
|
|
||||||
const MetadataNav = createClass({
|
const MetadataNav = createClass({
|
||||||
DisplayName : 'MetadataNav',
|
displayName : 'MetadataNav',
|
||||||
getDefaultProps : function() {
|
getDefaultProps : function() {
|
||||||
return {
|
return {
|
||||||
};
|
};
|
||||||
@@ -30,7 +30,13 @@ const MetadataNav = createClass({
|
|||||||
|
|
||||||
getAuthors : function(){
|
getAuthors : function(){
|
||||||
if(!this.props.brew.authors || this.props.brew.authors.length == 0) return 'No authors';
|
if(!this.props.brew.authors || this.props.brew.authors.length == 0) return 'No authors';
|
||||||
return this.props.brew.authors.join(', ');
|
return <>
|
||||||
|
{this.props.brew.authors.map((author, idx, arr)=>{
|
||||||
|
let spacer = <span>, </span>;
|
||||||
|
if(arr.length - 1 == idx) spacer = <></>;
|
||||||
|
return <span key={idx}><a className='userPageLink' href={`/user/${author}`}>{author}</a>{spacer}</span>;
|
||||||
|
})}
|
||||||
|
</>;
|
||||||
},
|
},
|
||||||
|
|
||||||
getTags : function(){
|
getTags : function(){
|
||||||
|
|||||||
@@ -233,6 +233,13 @@
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
a.userPageLink{
|
||||||
|
text-decoration: none;
|
||||||
|
color: white;
|
||||||
|
&:hover{
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
&:nth-of-type(even){
|
&:nth-of-type(even){
|
||||||
background-color: #555;
|
background-color: #555;
|
||||||
|
|||||||
Reference in New Issue
Block a user