mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-14 19:22:52 +00:00
hide usernames with emails
This commit is contained in:
@@ -141,11 +141,17 @@ const BrewItem = createClass({
|
|||||||
</> : <></>
|
</> : <></>
|
||||||
}
|
}
|
||||||
<span title={`Authors:\n${brew.authors?.join('\n')}`}>
|
<span title={`Authors:\n${brew.authors?.join('\n')}`}>
|
||||||
<i className='fas fa-user'/> {brew.authors?.map((author, index)=>(
|
<i className='fas fa-user'/>
|
||||||
<>
|
{brew.authors?.map((author, index) => (
|
||||||
<a key={index} href={`/user/${author}`}>{author}</a>
|
<React.Fragment key={index}>
|
||||||
{index < brew.authors.length - 1 && ', '}
|
{author === 'hidden' ? (
|
||||||
</>))}
|
<span>{author}</span> // Render as plain text if the author's name is "hidden"
|
||||||
|
) : (
|
||||||
|
<a href={`/user/${author}`}>{author}</a> // Render as a link if not "hidden"
|
||||||
|
)}
|
||||||
|
{index < brew.authors.length - 1 && ', '}
|
||||||
|
</React.Fragment>
|
||||||
|
))}
|
||||||
</span>
|
</span>
|
||||||
<br />
|
<br />
|
||||||
<span title={`Last viewed: ${moment(brew.lastViewed).local().format(dateFormatString)}`}>
|
<span title={`Last viewed: ${moment(brew.lastViewed).local().format(dateFormatString)}`}>
|
||||||
|
|||||||
@@ -435,22 +435,27 @@ const VaultPage = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="foundBrews">
|
<div className="foundBrews">
|
||||||
<span className="totalBrews">
|
<span className="totalBrews">
|
||||||
{`Brews found: `}
|
{`Brews found: `}
|
||||||
<span>{totalBrews}</span>
|
<span>{totalBrews}</span>
|
||||||
</span>
|
</span>
|
||||||
{brewCollection.map((brew, index) => (
|
{brewCollection.map((brew, index) => {
|
||||||
<BrewItem
|
const processedAuthors = brew.authors.map(author =>
|
||||||
brew={brew}
|
author.includes('@') ? 'hidden' : author
|
||||||
key={index}
|
);
|
||||||
reportError={props.reportError}
|
return (
|
||||||
/>
|
<BrewItem
|
||||||
))}
|
brew={{ ...brew, authors: processedAuthors }}
|
||||||
{renderPaginationControls()}
|
key={index}
|
||||||
</div>
|
reportError={props.reportError}
|
||||||
);
|
/>
|
||||||
};
|
);
|
||||||
|
})}
|
||||||
|
{renderPaginationControls()}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="vaultPage">
|
<div className="vaultPage">
|
||||||
|
|||||||
Reference in New Issue
Block a user