From 11d5bbc3b7929df1cdf6945a9546aec1bb619935 Mon Sep 17 00:00:00 2001 From: Francis Turmel Date: Sun, 1 Oct 2023 19:25:09 -0400 Subject: [PATCH] don't pluralize video count label when track only has one video --- src/components/tracks/Card.js | 8 ++++++-- src/components/tracks/Header.js | 2 +- src/pages/index.js | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/tracks/Card.js b/src/components/tracks/Card.js index 6b1df3d0e..4d5024320 100644 --- a/src/components/tracks/Card.js +++ b/src/components/tracks/Card.js @@ -18,10 +18,12 @@ const FilteredVideosSection = ({ videos: allVideos, trackSlug }) => { const [expanded, setExpanded] = useState(false); const canExpand = allVideos.length > 6; const videos = expanded || !canExpand ? allVideos : allVideos.slice(0, 6); + return (
- {allVideos.length} videos within this track match the filter. + {allVideos.length} video{allVideos.length > 1 ? 's' : ''} within this + track match the filter.
{videos.map((v, i) => ( @@ -113,7 +115,9 @@ const Card = ({

{title}

👁
{trackType}
-
{numVideos} videos
+
+ {numVideos} video{numVideos > 1 ? 's' : ''} +
{ }` ] : []), - `${numVideos} videos` + `${numVideos} video${numVideos > 1 ? 's' : ''}` ]} singleLine={false} /> diff --git a/src/pages/index.js b/src/pages/index.js index 68daf3262..0b8139730 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -31,7 +31,9 @@ const TrackCard = ({ track, placeholderImage }) => { {title} -
{numVideos} videos
+
+ {numVideos} video{numVideos > 1 ? 's' : ''} +