Skip to content

Commit

Permalink
Clean up render method
Browse files Browse the repository at this point in the history
  • Loading branch information
flachware committed Sep 15, 2023
1 parent 968e67d commit 494b690
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions assets/javascripts/elements/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ export class Download extends CustomElement {
${this.releaseNotesLink()}`

else if (this.failed)
return `
<a
href="https://github.com/tropy/tropy/releases/latest"
class="btn">
Download Tropy
</a>`
return `${this.fallbackButton()}`

else
return `<div class="spinner"></div>`
Expand Down Expand Up @@ -99,6 +94,15 @@ export class Download extends CustomElement {
else
return ''
}

fallbackButton() {
return `
<a
href="https://github.com/tropy/tropy/releases/latest"
class="btn btn-fallback">
Download Tropy
</a>`
}
}

Download.propTypes = {
Expand Down
2 changes: 1 addition & 1 deletion assets/stylesheets/home/_hero.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
}
}

.fallback {
.legacy {
animation: show-delayed 3s step-end forwards;

@include state("tpy-download:defined") {
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<h1>Tropy</h1>
<p class="lead">Explore your research photos</p>
<tpy-download>
<a class="btn fallback" href="https://github.com/tropy/tropy/releases/latest">Download Tropy</a>
<a class="btn fallback legacy" href="https://github.com/tropy/tropy/releases/latest">Download Tropy</a>
</tpy-download>
</div>
<div class="hero-illustration"></div>
Expand Down

0 comments on commit 494b690

Please sign in to comment.