0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

Change author names to UserPage links

This commit is contained in:
G.Ambatte
2023-04-09 23:24:54 +12:00
parent 0e226ca8db
commit eb7d558c8d
2 changed files with 15 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ const Nav = require('naturalcrit/nav/nav.jsx');
const MetadataNav = createClass({
DisplayName : 'MetadataNav',
displayName : 'MetadataNav',
getDefaultProps : function() {
return {
};
@@ -30,7 +30,13 @@ const MetadataNav = createClass({
getAuthors : function(){
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(){

View File

@@ -233,6 +233,13 @@
display: inline-block;
border-radius: 5px;
}
a.userPageLink{
text-decoration: none;
color: white;
&:hover{
text-decoration: underline;
}
}
}
&:nth-of-type(even){
background-color: #555;