Skip to content

Commit

Permalink
app: Toggle trading tier/reputation UI
Browse files Browse the repository at this point in the history
  • Loading branch information
martonp committed Oct 11, 2024
1 parent 83f6d4e commit 15504f3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
4 changes: 4 additions & 0 deletions client/webserver/locales/en-us.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,4 +653,8 @@ var EnUS = map[string]*intl.Translation{
"Transaction": {T: "Transaction"},
"Value": {T: "Value"},
"Prepaid bond redeemed": {T: "Prepaid bond redeemed!"},
"Show trading tier info": {T: "Show trading tier info"},
"Hide trading tier info": {T: "Hide trading tier info"},
"Show reputation": {T: "Show reputation"},
"Hide reputation": {T: "Hide reputation"},
}
12 changes: 10 additions & 2 deletions client/webserver/site/src/html/markets.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,11 @@
<div id="reputationAndTradingTierBox">
<div id="showTradingTier" class="p-2 grey fs15 hoverbg pointer">
<span class="ico-plus fs10 me-2"></span>
<span>Show trading tier info</span>
<span>[[[Show trading tier info]]]</span>
</div>
<div id="hideTradingTier" class="p-2 grey fs15 hoverbg pointer d-hide">
<span class="ico-minus fs10 me-2"></span>
<span>[[[Hide trading tier info]]]</span>
</div>
<div id="tradingLimits" class="d-flex align-items-stretch fs15 mx-2 mb-2 border d-hide">
<div class="d-flex flex-column flex-grow-1 align-items-stretch p-2">
Expand Down Expand Up @@ -474,7 +478,11 @@
</div>
<div id="showTradingReputation" class="p-2 grey fs15 hoverbg pointer">
<span class="ico-plus fs10 me-2"></span>
<span>Show reputation</span>
<span>[[[Show reputation]]]</span>
</div>
<div id="hideTradingReputation" class="p-2 grey fs15 hoverbg pointer d-hide">
<span class="ico-minus fs10 me-2"></span>
<span>[[[Hide reputation]]]</span>
</div>
<div id="reputationMeter" class="px-3 mb-3 border-bottom d-hide">
{{template "reputationMeter"}}
Expand Down
21 changes: 13 additions & 8 deletions client/webserver/site/src/js/markets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,19 @@ export default class MarketsPage extends BasePage {
bind(page.approveBaseBttn, 'click', () => { this.showTokenApprovalForm(true) })
bind(page.approveQuoteBttn, 'click', () => { this.showTokenApprovalForm(false) })

bind(page.showTradingTier, 'click', () => {
Doc.hide(page.showTradingTier)
Doc.show(page.tradingLimits)
})
bind(page.showTradingReputation, 'click', () => {
Doc.hide(page.showTradingReputation)
Doc.show(page.reputationMeter)
})
const toggleTradingTier = (show: boolean) => {
Doc.setVis(!show, page.showTradingTier)
Doc.setVis(show, page.tradingLimits, page.hideTradingTier)
}
bind(page.showTradingTier, 'click', () => { toggleTradingTier(true) })
bind(page.hideTradingTier, 'click', () => { toggleTradingTier(false) })

const toggleTradingReputation = (show: boolean) => {
Doc.setVis(!show, page.showTradingReputation)
Doc.setVis(show, page.reputationMeter, page.hideTradingReputation)
}
bind(page.showTradingReputation, 'click', () => { toggleTradingReputation(true) })
bind(page.hideTradingReputation, 'click', () => { toggleTradingReputation(false) })

// Buttons to set order type and side.
bind(page.buyBttn, 'click', () => { this.setBuy() })
Expand Down

0 comments on commit 15504f3

Please sign in to comment.