Merge pull request #397 from MuhammadWasif/label-fix

Display author name when only one contributor
This commit is contained in:
Jean-Philippe Sirois
2021-05-27 02:54:04 -04:00
committed by GitHub
+12 -8
View File
@@ -45,14 +45,18 @@ export const Header: React.FC<IHeaderProps> = ({
{authors && (
<SC.Meta>
<StackedAvatars authors={authors} />
<SC.PopoverToggler>
{authors.length} contributor{authors.length > 1 && "s"}
<SC.Popover>
{authors
.map((author) => `${author.name}#${author.hash}`)
.join(", ")}
</SC.Popover>
</SC.PopoverToggler>
{authors.length > 1 ? (
<SC.PopoverToggler>
{authors.length} contributor{authors.length > 1 && "s"}
<SC.Popover>
{authors
.map((author) => `${author.name}#${author.hash}`)
.join(", ")}
</SC.Popover>
</SC.PopoverToggler>
) : (
`${authors[0].name}#${authors[0].hash}`
)}
</SC.Meta>
)}
{dateToHuman && <SC.Meta>{dateToHuman}</SC.Meta>}