Skip to content

Commit

Permalink
Show "preview" badge if current version is not released yet (#3126)
Browse files Browse the repository at this point in the history
  • Loading branch information
yifanmai authored Nov 1, 2024
1 parent c1750e7 commit 2ae1381
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions helm-frontend/src/components/ReleaseDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,16 @@ function ReleaseDropdown() {
return <div>{releaseInfo}</div>;
}

const indexOfCurrentVersion = releases.indexOf(currentVersion);

const badge =
releases.length > 0 && currentVersion != releases[0] ? (
<Badge color="yellow">stale</Badge>
) : (
indexOfCurrentVersion < 0 ? (
<Badge color="blue">preview</Badge>
) : indexOfCurrentVersion === 0 ? (
<Badge color="blue">latest</Badge>
) : (
<Badge color="yellow">stale</Badge>
);

return (
<div className="dropdown">
<div
Expand Down

0 comments on commit 2ae1381

Please sign in to comment.