Skip to content

Commit

Permalink
add parent info to send and deposit forms
Browse files Browse the repository at this point in the history
  • Loading branch information
buck54321 committed Jul 26, 2023
1 parent 510af0e commit 75376c3
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 12 deletions.
2 changes: 1 addition & 1 deletion client/webserver/site/src/html/bodybuilder.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
{{end}}

{{define "bottom"}}
<script src="/js/entry.js?v=c6213ed0|a7774ee6"></script>
<script src="/js/entry.js?v=8133eac6|2f651303"></script>
</body>
</html>
{{end}}
13 changes: 9 additions & 4 deletions client/webserver/site/src/html/forms.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
</div>
<div class="bordertop py-2 text-center fs22 sans-light position-relative" data-tmpl="header">
[[[add_a_x_wallet]]]
<div class="flex-center pt-1 d-hide" data-tmpl="tokenMsgBox">
<div class="flex-center pt-1 d-hide fs18 sans" data-tmpl="tokenMsgBox">
<span>[[[Token on]]]</span>
<img data-tmpl="tokenParentLogo" class="ms-1 mini-icon">
<img data-tmpl="tokenParentLogo" class="ms-1 micro-icon">
<span data-tmpl="tokenParentName"></span>
</div>
</div>
Expand Down Expand Up @@ -133,10 +133,15 @@

{{define "depositAddress"}}
<div class="form-closer hoverbg"><span class="ico-cross"></span></div>
<div class="px-2 py-1 mb-2 text-center position-relative fs22 sans-light">
<div class="px-2 py-1 mb-2 text-center position-relative fs24 sans-light">
[[[Deposit]]]
<img id="depositLogo" class="micro-icon mx-1">
<img id="depositLogo" class="mini-icon mx-1">
<span id="depositName"></span>
<div class="flex-center pt-1 d-hide fs18 sans" id="depositTokenMsgBox">
<span>[[[Token on]]]</span>
<img id="depositTokenParentLogo" class="ms-1 micro-icon">
<span id="depositTokenParentName"></span>
</div>
</div>
<img class="mb-3" id="qrcode" />
<div class="mono deposit-address select-all">
Expand Down
11 changes: 8 additions & 3 deletions client/webserver/site/src/html/wallets.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<img id="assetLogo">
<div class="ms-2 fs28 sans-light lh1" id="assetName" data-asset-name="1"></div>
</div>
<div id="tokenParentBox" class="flex-center" class="fs16 d-hide">
<div id="tokenParentBox" class="flex-center fs18 sans" class="fs16 d-hide">
<span>[[[Token on]]]</span>
<img id="tokenParentLogo" class="ms-1">
<span id="tokenParentName"></span>
Expand Down Expand Up @@ -237,10 +237,15 @@
{{- /* SEND */ -}}
<form class="pb-3 d-hide" id="sendForm" autocomplete="off">
<div class="form-closer hoverbg"><span class="ico-cross"></span></div>
<div class="py-1 text-center position-relative fs22 sans-light">
<div class="py-1 text-center position-relative fs24 sans-light">
[[[Send]]]
<img id="sendLogo" class="micro-icon mx-1">
<img id="sendLogo" class="mini-icon mx-1">
<span id="sendName"></span>
<div class="flex-center pt-1 d-hide fs18 sans" id="sendTokenMsgBox">
<span>[[[Token on]]]</span>
<img id="sendTokenParentLogo" class="ms-1 micro-icon">
<span id="sendTokenParentName"></span>
</div>
</div>
<div class="mt-3">
<label for="sendAddr" class="form-label ps-1 mb-1">[[[Address]]]</label>
Expand Down
8 changes: 7 additions & 1 deletion client/webserver/site/src/js/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1795,13 +1795,19 @@ export class DepositAddress {
async setAsset (assetID: number) {
this.assetID = assetID
const page = this.page
Doc.hide(page.depositErr)
Doc.hide(page.depositErr, page.depositTokenMsgBox)
const asset = app().assets[assetID]
page.depositLogo.src = Doc.logoPath(asset.symbol)
const wallet = app().walletMap[assetID]
page.depositName.textContent = asset.name
page.depositAddress.textContent = wallet.address
page.qrcode.src = `/generateqrcode?address=${wallet.address}`
if (asset.token) {
const parentAsset = app().assets[asset.token.parentID]
page.depositTokenParentLogo.src = Doc.logoPath(parentAsset.symbol)
page.depositTokenParentName.textContent = parentAsset.name
Doc.show(page.depositTokenMsgBox)
}
if ((wallet.traits & traitNewAddresser) !== 0) Doc.show(page.newDepAddrBttn)
else Doc.hide(page.newDepAddrBttn)
}
Expand Down
10 changes: 7 additions & 3 deletions client/webserver/site/src/js/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1143,14 +1143,20 @@ export default class WalletsPage extends BasePage {
Doc.show(page.toggleSubtract)
}

Doc.hide(page.validAddr, page.sendErr, page.maxSendDisplay)
Doc.hide(page.validAddr, page.sendErr, page.maxSendDisplay, page.sendTokenMsgBox)
page.sendAddr.classList.remove('invalid')
page.sendAddr.value = ''
page.sendAmt.value = ''
this.showFiatValue(assetID, 0, page.sendValue)
page.walletBal.textContent = Doc.formatFullPrecision(wallet.balance.available, ui)
page.sendLogo.src = Doc.logoPath(symbol)
page.sendName.textContent = name
if (token) {
const parentAsset = app().assets[token.parentID]
page.sendTokenParentLogo.src = Doc.logoPath(parentAsset.symbol)
page.sendTokenParentName.textContent = parentAsset.name
Doc.show(page.sendTokenMsgBox)
}
// page.sendFee.textContent = wallet.feerate
// page.sendUnit.textContent = wallet.units

Expand Down Expand Up @@ -1187,8 +1193,6 @@ export default class WalletsPage extends BasePage {

this.showFiatValue(assetID, 0, page.sendValue)
page.walletBal.textContent = Doc.formatFullPrecision(wallet.balance.available, ui)
page.sendLogo.src = Doc.logoPath(wallet.symbol)
page.sendName.textContent = name
box.dataset.assetID = String(assetID)
this.showForm(box)
}
Expand Down

0 comments on commit 75376c3

Please sign in to comment.