Skip to content

Commit

Permalink
fix major words
Browse files Browse the repository at this point in the history
  • Loading branch information
nonrational committed Oct 20, 2024
1 parent dc3734a commit dff3806
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@ const UsageStats = ({ deviceType, userAgent, version, name, usage, major, curren
const globalUsage = getGlobalUsageStats(userAgent.browser, userAgent.device)
const americasUsage = getNorthAmericaUsageStats(userAgent.browser, userAgent.device)

const bestVersion = usage && usage > 0.001 ? version : major
const preferMajor = !usage || usage < 0.001
const bestVersion = preferMajor ? major : version

const showVersionStats = currentVersion === major || usage

return (
<p>
{showVersionStats && name && version && <>{name} {bestVersion}</>}
{currentVersion === major && <>{' '}is the most recent major release{usage && <>{' '}and</>}</>}
{currentVersion === major && <>{' '}is the most recent{preferMajor && ' major'} release{usage && <>{' '}and</>}</>}
{usage && (
<>
{' '}represents <strong>{usage.toFixed(3)}%</strong> of global browser traffic.
Expand Down

0 comments on commit dff3806

Please sign in to comment.