Display author when only one contribute

This commit is contained in:
MuhammadWasif
2021-05-27 02:48:46 -04:00
committed by Jean-Philippe Sirois
parent 4492b17a4b
commit 79eaea6e05
+4
View File
@@ -45,6 +45,7 @@ export const Header: React.FC<IHeaderProps> = ({
{authors && ( {authors && (
<SC.Meta> <SC.Meta>
<StackedAvatars authors={authors} /> <StackedAvatars authors={authors} />
{authors.length > 1 ? (
<SC.PopoverToggler> <SC.PopoverToggler>
{authors.length} contributor{authors.length > 1 && "s"} {authors.length} contributor{authors.length > 1 && "s"}
<SC.Popover> <SC.Popover>
@@ -53,6 +54,9 @@ export const Header: React.FC<IHeaderProps> = ({
.join(", ")} .join(", ")}
</SC.Popover> </SC.Popover>
</SC.PopoverToggler> </SC.PopoverToggler>
) : (
`${authors[0].name}#${authors[0].hash}`
)}
</SC.Meta> </SC.Meta>
)} )}
{dateToHuman && <SC.Meta>{dateToHuman}</SC.Meta>} {dateToHuman && <SC.Meta>{dateToHuman}</SC.Meta>}