Skip to content

Commit 5767422

Browse files
committed
Auto merge of #2453 - Turbo87:crate-row, r=locks
CrateRow: Replace version badge with regular text ... and show the copy button only on mouse over. ### Before <img width="640" alt="Bildschirmfoto 2020-04-26 um 17 18 39" src="https://user-images.githubusercontent.com/141300/80311805-19986d80-87e2-11ea-9825-c2f93335d003.png"> ### After <img width="639" alt="Bildschirmfoto 2020-04-26 um 17 18 13" src="https://user-images.githubusercontent.com/141300/80311833-4a78a280-87e2-11ea-8208-4213791d5c82.png"> r? @locks
2 parents 8793c4f + fa7fdff commit 5767422

File tree

5 files changed

+13
-29
lines changed

5 files changed

+13
-29
lines changed

app/components/crate-badge.hbs

Lines changed: 0 additions & 7 deletions
This file was deleted.

app/components/crate-badge.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

app/components/crate-row.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
>
1010
{{ @crate.name }}
1111
</LinkTo>
12-
<CrateTomlCopy @copyText='{{@crate.name}} = "{{@crate.max_version}}"' @inline={{true}} />
13-
<CrateBadge @crate={{@crate}} local-class="version-badge" />
12+
<span local-class="version" data-test-version>v{{@crate.max_version}}</span>
13+
<CrateTomlCopy @copyText='{{@crate.name}} = "{{@crate.max_version}}"' @inline={{true}} local-class="copy-button" />
1414
</div>
1515
<div local-class="description" data-test-description>
1616
{{ truncate-text @crate.description }}

app/components/crate-row.module.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,19 @@
1717
font-size: 120%;
1818
}
1919

20-
.version-badge {
20+
.version {
2121
margin-left: 10px;
2222
}
2323

24+
.copy-button {
25+
opacity: 0;
26+
transition: 50ms;
27+
28+
.crate-row:hover & {
29+
opacity: 1;
30+
}
31+
}
32+
2433
.description {
2534
composes: small from '../styles/shared/typography.module.css';
2635
margin-top: 8px;

tests/acceptance/search-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module('Acceptance | search', function (hooks) {
4141
.dom('[data-test-search-sort]')
4242
.hasText('Sort by Relevance Relevance All-Time Downloads Recent Downloads Recent Updates Newly Added');
4343
assert.dom('[data-test-crate-row="0"] [data-test-crate-link]').hasText('kinetic-rust');
44-
assert.dom('[data-test-crate-row="0"] [data-test-version-badge]').hasAttribute('alt', '0.0.16');
44+
assert.dom('[data-test-crate-row="0"] [data-test-version]').hasText('v0.0.16');
4545

4646
assert
4747
.dom('[data-test-crate-row="0"] [data-test-description]')

0 commit comments

Comments
 (0)