Skip to content

Commit ff86cea

Browse files
committed
used Tooltip for the sidebar metadeta
1 parent 3dce14f commit ff86cea

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

app/components/crate-sidebar.css

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
display: flex;
33
flex-direction: column;
44

5-
> * + * {
5+
>*+* {
66
margin-top: var(--space-m);
77
}
88
}
@@ -13,16 +13,11 @@
1313
}
1414

1515
.metadata {
16-
> * + * {
16+
>*+* {
1717
margin-top: var(--space-2xs);
1818
}
1919
}
2020

21-
._label {
22-
font-weight: 500;
23-
margin-right: 0.2rem;
24-
}
25-
2621
.date,
2722
.msrv,
2823
.edition,
@@ -45,7 +40,7 @@
4540
.msrv,
4641
.edition,
4742
.linecount {
48-
> span {
43+
>span {
4944
cursor: help;
5045
}
5146
}
@@ -90,7 +85,7 @@
9085
.purl-tooltip {
9186
word-break: break-all;
9287

93-
> small {
88+
>small {
9489
word-break: normal;
9590
}
9691
}
@@ -116,7 +111,7 @@
116111
}
117112

118113
.links {
119-
> * + * {
114+
>*+* {
120115
margin-top: var(--space-m);
121116
}
122117
}
@@ -127,7 +122,8 @@
127122
line-height: 1.5;
128123
}
129124

130-
.report-button, .playground-button {
125+
.report-button,
126+
.playground-button {
131127
justify-content: center;
132128
width: 220px;
133129
}
@@ -140,4 +136,4 @@
140136
max-width: 220px;
141137
text-align: justify;
142138
line-height: 1.3em;
143-
}
139+
}

app/components/crate-sidebar.gjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ export default class CrateSidebar extends Component {
6868
<time datetime={{dateFormatIso @version.created_at}} class='date' data-test-date-label>
6969
{{svgJar 'calendar'}}
7070
<span>
71-
<span class='_label'>Last Updated</span>
7271
{{dateFormatDistanceToNow @version.created_at addSuffix=true}}
73-
<Tooltip @text={{dateFormat @version.created_at 'PPP'}} />
72+
<Tooltip>
73+
Last Updated:
74+
{{dateFormat @version.created_at 'PPP'}}
75+
</Tooltip>
7476
</span>
7577
</time>
7678

@@ -110,10 +112,10 @@ export default class CrateSidebar extends Component {
110112
{{/if}}
111113

112114
{{#if @version.crate_size}}
113-
<div class='bytes' data-test-byte-size-label>
115+
<div class='bytes' data-test-byte-size>
114116
{{svgJar 'weight'}}
115-
<span class='_label'>Size</span>
116117
{{prettyBytes @version.crate_size}}
118+
<Tooltip @text='Crate Size' />
117119
</div>
118120
{{/if}}
119121

tests/acceptance/crate-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,12 @@ module('Acceptance | crate page', function (hooks) {
312312

313313
await visit('/crates/foo');
314314
assert.dom('[data-test-linecounts]').hasText('1,119 SLoC');
315-
assert.dom('[data-test-date-label]').includesText('Last Updated');
316-
assert.dom('[data-test-byte-size-label]').includesText('Size');
315+
assert.dom('[data-test-date-ts]').exists();
316+
assert.dom('[data-test-byte-size]').exists();
317317

318318
await visit('/crates/foo/0.5.0');
319319
assert.dom('[data-test-linecounts]').hasText('520 SLoC');
320-
assert.dom('[data-test-date-label]').includesText('Last Updated');
321-
assert.dom('[data-test-byte-size-label]').includesText('Size');
320+
assert.dom('[data-test-date-ts]').exists();
321+
assert.dom('[data-test-byte-size]').exists();
322322
});
323323
});

0 commit comments

Comments
 (0)