Skip to content

Commit cdf4329

Browse files
committed
crate.version: Add loading spinner for the README
1 parent 694ab39 commit cdf4329

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

app/styles/crate/version.module.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,22 @@
3131
margin-bottom: 20px;
3232
}
3333

34+
.readme-spinner {
35+
padding: 40px 15px;
36+
text-align: center;
37+
font-size: 20px;
38+
font-weight: 300;
39+
40+
code {
41+
font-size: 18px;
42+
font-weight: 500;
43+
}
44+
}
45+
46+
.readme-spinner > div {
47+
--spinner-size: 35px;
48+
}
49+
3450
.crate-downloads {
3551
display: flex;
3652
flex-wrap: wrap;

app/templates/crate/version.hbs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
one that has not been yanked.
1515
</p>
1616
{{else}}
17-
{{#if this.readme}}
17+
{{#if this.loadReadmeTask.isRunning}}
18+
<div local-class="readme-spinner">
19+
<LoadingSpinner/>
20+
</div>
21+
{{else if this.readme}}
1822
<article aria-label="Readme">
1923
<RenderedHtml @html={{this.readme}} local-class="readme" />
2024
</article>

0 commit comments

Comments
 (0)