0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-26 05:12:39 +00:00

no authors fix

This commit is contained in:
Víctor Losada Hernández
2024-01-27 16:56:28 +01:00
parent 7e30f860b2
commit 87e18c0521

View File

@@ -111,7 +111,7 @@ const BrewItem = createClass({
brew.tags = brew.tags?.filter((tag)=>tag); //remove tags that are empty strings
}
const dateFormatString = 'YYYY-MM-DD HH:mm:ss';
const authors = brew.authors || 'No authors';
const authors = brew.authors.length > 0 ? brew.authors : 'No authors';
return <div className='brewItem'>
@@ -137,7 +137,11 @@ const BrewItem = createClass({
</> : <></>
}
<span title={`Authors:\n${authors?.join('\n')}`}>
<i className='fas fa-user'/> {authors.map((item) => <a href={`/user/${item}`}>{item}</a>)}
<i className='fas fa-user'/> {brew.authors?.map((author, index) => (
<span key={index}>
<a href={`/share/${author}`}>{author}</a>
{index < brew.authors.length - 1 && ', '}
</span>))}
</span>
<br />
<span title={`Last viewed: ${moment(brew.lastViewed).local().format(dateFormatString)}`}>