0
0
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:
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({ 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(){

View File

@@ -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;