Skip to content

Commit

Permalink
chore: move displaycommithash back to init
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-ae committed Jul 8, 2024
1 parent 1d36fda commit 5b426f3
Show file tree
Hide file tree
Showing 4 changed files with 6,019 additions and 8,629 deletions.
12 changes: 12 additions & 0 deletions static/scripts/rewards/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@ import { app } from "./app-state";
import { readClaimDataFromUrl } from "./render-transaction/read-claim-data-from-url";
import { grid } from "./the-grid";

displayCommitHash();
grid(document.getElementById("grid") as HTMLElement, gridLoadedCallback); // @DEV: display grid background
readClaimDataFromUrl(app).catch(console.error); // @DEV: read claim data from URL

const footer = document.querySelector(".footer") as Element;
footer.classList.add("animate");

declare const commitHash: string; // @DEV: passed in at build time check build/esbuild-build.ts
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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@ 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 "./display-commit-hash";

const carousel = document.getElementById("carousel") as Element;
const footer = document.querySelector(".footer") as Element;
const table = document.querySelector(`table`) as HTMLTableElement;
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";
const rewardsCount = document.getElementById("rewardsCount") as Element;
Expand Down
Loading

0 comments on commit 5b426f3

Please sign in to comment.