Skip to content

Commit

Permalink
CrateHeader: Show "Yanked" badge for yanked versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed May 2, 2023
1 parent f588004 commit b7f9ffb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/components/crate-header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
<span data-test-crate-name>{{@crate.name}}</span>
{{#if @version}}
<small data-test-crate-version>v{{@version.num}}</small>

{{#if @version.yanked}}
<span local-class="yanked-badge">
{{svg-jar "trash"}}
Yanked
</span>
{{/if}}
{{/if}}
</h1>

Expand Down
19 changes: 19 additions & 0 deletions app/components/crate-header.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@
}
}

.yanked-badge {
background: #d30000;
border-radius: 99999px;
padding: var(--space-3xs) var(--space-s);
font-size: var(--space-s);
color: white;
align-self: center;
display: inline-flex;
align-items: center;
gap: var(--space-3xs);
white-space: nowrap;

svg {
width: 1em;
height: 1em;
flex-shrink: 0;
}
}

.description {
margin-top: var(--space-xs);
line-height: 1.35;
Expand Down

0 comments on commit b7f9ffb

Please sign in to comment.