Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wording for homepage position count #691

Merged
merged 3 commits into from
Feb 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Components/HomePageBanner/HomePageBanner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ class HomePageBanner extends Component {
// Subtract the count by 6 to ensure that it will always be rounded down to the nearest 10 (-1)
const shouldRound = positionCount > 50;
const roundedCount = shouldRound ? round(positionCount - 6, -1) : positionCount;
let preText = shouldRound ? 'There are more than' : 'There are';
if (positionCount === 1) { preText = 'There is'; }
const positionTextPlural = positionCount === 1 ? 'position' : 'positions';
return (
<div className="usa-grid-full homepage-search-banner">
<div className="usa-grid-full">
Expand All @@ -52,7 +55,7 @@ class HomePageBanner extends Component {
!roundedCount && !isLoading ?
null :
<span className="stats-text--position">
<span>There are more than&nbsp;</span>
<span>{preText}&nbsp;</span>
{
isLoading ?
<Skeleton width="25px" duration={1.1} />
Expand All @@ -63,7 +66,7 @@ class HomePageBanner extends Component {
)}
</CountUp>
}
<span>&nbsp;positions available for bidding.</span>
<span>&nbsp;{positionTextPlural} available for bidding.</span>
</span>
}
</span>
Expand Down