Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move controls into sight #248

Merged
merged 3 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</td>
</tr>
</thead>
<tbody>
<tbody id="mainTableBody">
<tr id="Amount">
<th>
<div>Amount</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export async function renderTransaction(): Promise<Success> {

if (isErc20Permit(app.reward)) {
const treasury = await fetchTreasury(app.reward);
table.setAttribute(`data-additional-data-size`, "small");

// insert tx data into table
const requestedAmountElement = insertErc20PermitTableData(app, table, treasury);
Expand Down Expand Up @@ -63,6 +64,7 @@ export async function renderTransaction(): Promise<Success> {
} else {
const requestedAmountElement = insertErc721PermitTableData(app.reward, table);
table.setAttribute(`data-make-claim`, "ok");
table.setAttribute(`data-additional-data-size`, "large");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the logic to remove this? If this is to display on NFT rewards, what happens when you switch to a non NFT reward? Does it re-render the table without this attribute?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This scenario never dawned on me but it does not re-render the table. I crafted a permit with both types in it NFT first and it shifted for ERC20.

renderNftSymbol({
tokenAddress: app.reward.tokenAddress,
explorerUrl: networkExplorers[app.reward.networkId],
Expand All @@ -71,7 +73,7 @@ export async function renderTransaction(): Promise<Success> {
}).catch(console.error);

const toElement = document.getElementById(`rewardRecipient`) as Element;
renderEnsName({ element: toElement, address: app.reward.beneficiary }).catch(console.error);
renderEnsName({ element: toElement, address: app.reward.beneficiary, networkID: app.networkId }).catch(console.error);

getMakeClaimButton().addEventListener("click", claimErc721PermitHandler(app.reward));
}
Expand Down
3 changes: 3 additions & 0 deletions static/styles/rewards/claim-table.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ table[data-make-claim-rendered] button.show > svg#claim-loader {
table[data-make-claim-rendered] button.hide > svg#claim-icon {
display: unset;
}
table[data-details-visible="true"][data-additional-data-size="large"] #mainTableBody {
transform: translate(-50%, 20px);
}
table #controls {
opacity: 0;
transition: 1s ease-in-out opacity;
Expand Down
Loading