diff --git a/src/app/doi.org/[...doi]/RelatedContent.tsx b/src/app/doi.org/[...doi]/RelatedContent.tsx index 125a3349..d8644b32 100644 --- a/src/app/doi.org/[...doi]/RelatedContent.tsx +++ b/src/app/doi.org/[...doi]/RelatedContent.tsx @@ -73,6 +73,14 @@ export default function RelatedContent(props: Props) { partOfCount > 0 ? 'partOf' : 'otherRelated' const displayedConnectionType = connectionType ? connectionType : defaultConnectionType + //convert camel case to title and make first letter uppercase + //convert connectionType to title, allRelated becomes All Related Wokrs, references becomes References, citations becomes Citations, parts becomes Parts, partOf becomes Part Of, and otherRelated becomes Other Works + const displayedConnectionTitle = + displayedConnectionType === 'allRelated' ? 'All Related Works' : + displayedConnectionType === 'otherRelated' ? 'Other Works' : + displayedConnectionType.replace(/([A-Z])/g, ' $1').replace(/^./, str => str.toUpperCase()) + + const works: Works = displayedConnectionType in relatedWorks ? @@ -101,7 +109,7 @@ export default function RelatedContent(props: Props) { connectionTypesCounts={connectionTypeCounts} showAnalytics={true} showSankey={showSankey} - sankeyTitle={`Contributions to ${displayedConnectionType}`} + sankeyTitle={`Contributions to ${displayedConnectionTitle}`} showClaimStatus={true} hasPagination={works.totalCount > 25} hasNextPage={hasNextPage}