Skip to content

Commit

Permalink
fix: solana rewards message
Browse files Browse the repository at this point in the history
  • Loading branch information
icfor committed Apr 16, 2024
1 parent abd1a2b commit ea82bee
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions public/locales/en/staking.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"claimRewards": {
"claimFrom": "Claim from:",
"selectNetwork": "Select network:",
"solanaInfo": "On solana, your rewards will be distributed automatically to your staking account every 2-3 days, it means you don't need to withdraw it manually!",
"title": "Claim Rewards"
},
"commission": "Commission Rate",
Expand Down
1 change: 1 addition & 0 deletions public/locales/zh-CN/staking.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"claimRewards": {
"claimFrom": "选择网络:",
"selectNetwork": "选择网络:",
"solanaInfo": "在 solana 上,您的奖励将每 2-3 天自动分配到您的质押账户,这意味着您无需手动提取!",
"title": "领取奖励"
},
"commission": "佣金",
Expand Down
1 change: 1 addition & 0 deletions public/locales/zh-HK/staking.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"claimRewards": {
"claimFrom": "從哪個錢包領取?",
"selectNetwork": "選擇網路:",
"solanaInfo": "在 solana 上,您的獎勵將每 2-3 天自動分配到您的質押帳戶,這意味著您無需手動提取!",
"title": "領取獎勵"
},
"commission": "佣金",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@
flex-direction: column;
gap: 12px;
}

.infoMessage {
color: $color-blue-1;
margin: 0 auto;
max-width: 600px;
text-align: center;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
getSelectedAccount,
} from "@src/screens/staking/lib/staking_sdk/context/selectors";
import type { Coin } from "@src/screens/staking/lib/staking_sdk/core/base";
import { solanaNetworks } from "@src/screens/staking/lib/staking_sdk/core/solana";
import { formatCoin } from "@src/screens/staking/lib/staking_sdk/formatters";
import { accountHasRewards } from "@src/screens/staking/lib/staking_sdk/utils/accounts";
import {
Expand Down Expand Up @@ -64,6 +65,11 @@ const ClaimRewardsModal = () => {
setSelectedAccount(stakingRef.current, null, null);
};

const infoMessage =
networkId && solanaNetworks.has(networkId)
? `* ${t("claimRewards.solanaInfo")}`
: "";

return (
<ModalBase onClose={onClose} open={isOpen} title={t("claimRewards.title")}>
<div className={styles.wrapper}>
Expand Down Expand Up @@ -94,6 +100,7 @@ const ClaimRewardsModal = () => {
</div>
</div>
)}
{infoMessage && <div className={styles.infoMessage}>{infoMessage}</div>}
<HighlightButton
disabled={!address || !networkId || isLoading || !hasRewards}
onClick={() => {
Expand Down

0 comments on commit ea82bee

Please sign in to comment.