From 79eaea6e05b99e46248bc8ef0a5af02beb7c056a Mon Sep 17 00:00:00 2001 From: MuhammadWasif Date: Thu, 15 Apr 2021 15:20:19 +0500 Subject: [PATCH] Display author when only one contribute --- src/components/Header/index.tsx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/Header/index.tsx b/src/components/Header/index.tsx index c7e7370..c31b513 100644 --- a/src/components/Header/index.tsx +++ b/src/components/Header/index.tsx @@ -45,14 +45,18 @@ export const Header: React.FC = ({ {authors && ( - - {authors.length} contributor{authors.length > 1 && "s"} - - {authors - .map((author) => `${author.name}#${author.hash}`) - .join(", ")} - - + {authors.length > 1 ? ( + + {authors.length} contributor{authors.length > 1 && "s"} + + {authors + .map((author) => `${author.name}#${author.hash}`) + .join(", ")} + + + ) : ( + `${authors[0].name}#${authors[0].hash}` + )} )} {dateToHuman && {dateToHuman}}