Skip to content

Commit

Permalink
Improve accumulative balance tip
Browse files Browse the repository at this point in the history
  • Loading branch information
1aerostorm committed Dec 17, 2024
1 parent a9b9fee commit b8a0c62
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 25 deletions.
47 changes: 28 additions & 19 deletions app/components/modules/UserWallet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ class UserWallet extends React.Component {
return
}
const accumulative_balance_steem = parseFloat(account.get('accumulative_balance').split(' ')[0])
if (accumulative_balance_steem) {
const pr = await libs.dex.apidexGetPrices({ sym: 'GOLOS' })
this.setState({
price_rub: pr.price_rub,
price_usd: pr.price_usd
})
}
const pr = await libs.dex.apidexGetPrices({ sym: 'GOLOS' })
this.setState({
price_rub: pr.price_rub,
price_usd: pr.price_usd
})
}

componentDidMount() {
Expand Down Expand Up @@ -367,9 +365,12 @@ class UserWallet extends React.Component {
claim_hint = <span>
{tt('tips_js.claim_balance_hint1')}
{SUBTRACT}
{tt('tips_js.claim_balance_hint2')}
{accumulative_balance_steem ? tt('tips_js.claim_balance_hint_claim') : tt('tips_js.claim_balance_hint_no_claim')}
{tt('tips_js.claim_balance_hint_DAILY', {
DAILY
})}
&nbsp;<Link to="/convert/YMUSDT/GOLOS?buy">{tt('tips_js.buy_tokens')}</Link>
</span>
claim_disabled = true
}
Expand Down Expand Up @@ -399,7 +400,7 @@ class UserWallet extends React.Component {
let gbgAprTip = tt('userwallet_jsx.apr_gbg')
if (vesting_steem < min_gp_to_curate) {
gbgPerMonth = 0
gbgTip = tt('tips_js.savings_interest_gp_AMOUNT', { AMOUNT: SUBTRACT })
gbgTip = [tt('tips_js.savings_interest_gp'), ...SUBTRACT, tt('tips_js.savings_interest_gp2')]
} else if (gprops.is_forced_min_price) {
gbgPerMonth = 0
sbdInterest = 0
Expand All @@ -424,6 +425,22 @@ class UserWallet extends React.Component {

const { ClaimBalance, TipBalance, VestingBalance, GolosBalance, GbgBalance, SavingsBalance } = BalanceHeader

let claimBtn = null
if (isMyAccount && accumulative_balance_steem) {
claimBtn = <button
className="Wallet__claim_button button tiny"
disabled={claim_disabled}
onClick={claim.bind(this, account.get('accumulative_balance'))}
>
{tt('g.claim')}
</button>
if (claim_disabled) {
claimBtn = <LiteTooltip t={[tt('tips_js.claim_min_gp'), ...SUBTRACT, tt('tips_js.claim_min_gp2')]}>
{claimBtn}
</LiteTooltip>
}
}

return (<div className={"UserWallet top-margin" + (isS ? ' small-screen' : '')}>
{accountIdleness && <Callout>
<div align="center">{tt('userwallet_jsx.account_idleness')}. <a target="_blank" href="https://wiki.golos.id/users/update#ponizhenie-sily-golosa-pri-neaktivnosti">{tt('g.more_hint')} <Icon name="extlink" /></a>
Expand All @@ -433,24 +450,16 @@ class UserWallet extends React.Component {

<TransactionError opType="withdraw_vesting" />

{accumulative_balance_steem ? <div className="UserWallet__balance row zebra">
<div className="UserWallet__balance row zebra">
<div className="column small-12 medium-8">
<ClaimBalance tipText={claim_hint} isS={isS} />
</div>
<div className="column small-12 medium-4">
<span className='main-balance'>{steem_claim_balance_str}</span>
<div>{isMyAccount ? (<LiteTooltip t={tt('tips_js.claim_min_gp_AMOUNT', { AMOUNT: SUBTRACT })}>
<button
className="Wallet__claim_button button tiny"
disabled={claim_disabled}
onClick={claim.bind(this, account.get('accumulative_balance'))}
>
{tt('g.claim')}
</button>
</LiteTooltip>) : null}</div>
<div>{claimBtn}</div>
{emissionStake}
</div>
</div> : null}
</div>
<div className="UserWallet__balance row">
<div className="column small-12 medium-8">
<TipBalance isS={isS} />
Expand Down
12 changes: 9 additions & 3 deletions app/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,11 @@
"tips_js": {
"tip_balance_hint": "Balance that you use to reward users and that you use to earn rewards for yourself. Tokens from it can also be sent to increase the Golos Power.",
"claim_balance_hint1": "If you will add ",
"claim_balance_hint_DAILY": " into your Golos Power, you will be able to daily and automatically achieve emission stake (+%(DAILY)s) onto your TIP-balance.",
"claim_balance_hint2": " into your Golos Power, you will be able ",
"claim_balance_hint_claim": "to claim these funda, and ",
"claim_balance_hint_no_claim": "",
"claim_balance_hint_DAILY": "to daily and automatically achieve emission stake (+%(DAILY)s) onto your TIP-balance.",
"buy_tokens": "Buy tokens",
"claim_balance_hint_enough_REQUIRED": "Your Golos Power was not enough to receive emission (required at least %(REQUIRED)s). Emission for that time period is collected on your CLAIM-balance. Now you can claim it on your TIP-balance.",
"claim_expiration_hint": "The tokens request window will end",
"tradeable_tokens_that_may_be_transferred_anywhere_at_anytime": "Tradable digital tokens that can be transferred anywhere at any time.",
Expand All @@ -1034,8 +1038,10 @@
"savings_interest": "Interest per month, if you will store this GBG amount in the savings",
"savings_interest_zero": "Savings interest payments are disabled at now.",
"savings_interest_debt": "GBG debt do not allows us to pay GBG savings interest.",
"savings_interest_gp_AMOUNT": "It is not enough %(AMOUNT)s Golos Power, to receive GBG interest payments.",
"claim_min_gp_AMOUNT": "There is not enough %(AMOUNT)s in the Golos Power of the vote to withdraw tokens from the claim-balance."
"savings_interest_gp": "It is not enough ",
"savings_interest_gp2": " Golos Power, to receive GBG interest payments.",
"claim_min_gp": "There is not enough ",
"claim_min_gp2": " in the Golos Power of the vote to withdraw tokens from the claim-balance."
},
"transferhistoryrow_jsx": {
"to_savings": "to savings",
Expand Down
12 changes: 9 additions & 3 deletions app/locales/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,11 @@
"tips_js": {
"tip_balance_hint": "Для вознаграждений пользователей, и на который получаете вознаграждения сами. Токены с него можно также отправить на увеличение Силы Голоса.",
"claim_balance_hint1": "Добавив ",
"claim_balance_hint_DAILY": " в Силу Голоса, вы сможете востребовать накопленное, а также ежедневно дополнительно получать +%(DAILY)s на TIP-баланс.",
"claim_balance_hint2": " в Силу Голоса, вы сможете ",
"claim_balance_hint_claim": "востребовать накопленное, а также ежедневно дополнительно ",
"claim_balance_hint_no_claim": "ежедневно ",
"claim_balance_hint_DAILY": "получать +%(DAILY)s на TIP-баланс.",
"buy_tokens": "Купить токены",
"claim_balance_hint_enough_REQUIRED": "Ваша Сила Голоса была недостаточна для получения эмиссии (менее %(REQUIRED)s) и накапливалась на этом балансе. Теперь вы можете получить её на TIP-баланс.",
"claim_expiration_hint": "Окно востребования токенов закончится",
"tradeable_tokens_that_may_be_transferred_anywhere_at_anytime": "Торгуемые токены, которые могут быть переданы в любой момент.",
Expand All @@ -899,8 +903,10 @@
"savings_interest": "Сумма, которая будет начисляться каждый месяц, как процент за хранение GBG в сейфе.",
"savings_interest_zero": "Начисление процентов за хранение GBG в сейфе отключено делегатами.",
"savings_interest_debt": "Текущий курс токена GOLOS не позволяет начислять проценты \n за хранение GBG в сейфе (долг >10%%).",
"savings_interest_gp_AMOUNT": "Не хватает %(AMOUNT)s в Силе Голоса, чтобы начать получать проценты за хранение GBG.",
"claim_min_gp_AMOUNT": "Не хватает %(AMOUNT)s в Силе Голоса, чтобы снять токены с накопительного баланса."
"savings_interest_gp": "Не хватает ",
"savings_interest_gp2": " в Силе Голоса, чтобы начать получать проценты за хранение GBG.",
"claim_min_gp": "Не хватает ",
"claim_min_gp2": " в Силе Голоса, чтобы снять токены с накопительного баланса."
},
"transfer_jsx": {
"amount_is_in_form": "Сумма должна быть в формате 99999.999",
Expand Down

0 comments on commit b8a0c62

Please sign in to comment.