Skip to content

Commit

Permalink
chore: ensure footer always loads
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-ae committed Jul 1, 2024
1 parent 582e16c commit 30f33b3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 0 additions & 8 deletions static/scripts/rewards/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ grid(document.getElementById("grid") as HTMLElement, gridLoadedCallback); // @DE

readClaimDataFromUrl(app).catch(console.error); // @DEV: read claim data from URL

declare const commitHash: string; // @DEV: passed in at build time check build/esbuild-build.ts
export function displayCommitHash() {
// display commit hash in footer
const buildElement = document.querySelector(`#build a`) as HTMLAnchorElement;
buildElement.innerHTML = commitHash;
buildElement.href = `https://github.com/ubiquity/pay.ubq.fi/commit/${commitHash}`;
}

// cSpell:ignore llback
function gridLoadedCallback() {
document.body.classList.add("grid-loaded");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
declare const commitHash: string; // @DEV: passed in at build time check build/esbuild-build.ts
export function displayCommitHash() {
// display commit hash in footer
const buildElement = document.querySelector(`#build a`) as HTMLAnchorElement;
buildElement.innerHTML = commitHash;
buildElement.href = `https://github.com/ubiquity/pay.ubq.fi/commit/${commitHash}`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { insertErc20PermitTableData, insertErc721PermitTableData } from "./inser
import { renderEnsName } from "./render-ens-name";
import { renderNftSymbol, renderTokenSymbol } from "./render-token-symbol";
import { ERC20Permit, Permit, TokenType } from "@ubiquibot/permit-generation/types";
import { displayCommitHash } from "../init";
import { displayCommitHash } from "./display-commit-hash";

const carousel = document.getElementById("carousel") as Element;
const footer = document.querySelector(".footer") as Element;
Expand All @@ -18,9 +18,10 @@ type Success = boolean;
export async function renderTransaction(): Promise<Success> {
displayCommitHash(); // @DEV: display commit hash in footer

footer.classList.add("animate");

if (app.claims && app.claims.length > 1) {
carousel.className = "flex";
footer.classList.add("animate");
const rewardsCount = document.getElementById("rewardsCount") as Element;
rewardsCount.innerHTML = `${app.rewardIndex + 1}/${app.claims.length} reward`;
}
Expand Down

0 comments on commit 30f33b3

Please sign in to comment.