Skip to content

Commit

Permalink
Merge pull request #5386 from EdgeApp/matthew/earn-scene-icons
Browse files Browse the repository at this point in the history
Use chain icon for staking cards
  • Loading branch information
peachbits authored Dec 6, 2024
2 parents edce9ce + 7a16c5a commit 41ee341
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- changed: Improved EdgeCrashEvent reporting with additional metadata, tags, and name/message information.
- changed: Integrate `installSurvey` endpoint for post-install survey options
- changed: Always show Add Wallet button at bottom of asset list
- changed: Use chain icon for staking cards

## 4.19.0

Expand Down
9 changes: 7 additions & 2 deletions src/util/stakeUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { add } from 'biggystring'
import { EdgeAccount, EdgeCurrencyInfo, EdgeCurrencyWallet, EdgeStakingStatus, EdgeTokenId } from 'edge-core-js'
import { sprintf } from 'sprintf-js'

import { SPECIAL_CURRENCY_INFO } from '../constants/WalletAndCurrencyConstants'
import { formatTimeDate } from '../locales/intl'
import { lstrings } from '../locales/strings'
import { PositionAllocation, StakePlugin, StakePolicy, StakePolicyFilter, StakePosition } from '../plugins/stake-plugins/types'
Expand Down Expand Up @@ -84,8 +85,12 @@ export const getPolicyIconUris = (
(rewardAssetName, i) => stakePolicy.rewardAssets[i].cdnName ?? metaTokens.find(metaToken => metaToken.currencyCode === rewardAssetName)?.contractAddress
)

const stakeAssetUris = stakeContractAddresses.map(stakeContractAddress => getCurrencyIconUris(pluginId, stakeContractAddress ?? null).symbolImage)
const rewardAssetUris = rewardContractAddresses.map(rewardContractAddress => getCurrencyIconUris(pluginId, rewardContractAddress ?? null).symbolImage)
const stakeAssetUris = stakeContractAddresses.map(
stakeContractAddress => getCurrencyIconUris(pluginId, stakeContractAddress ?? null, SPECIAL_CURRENCY_INFO[pluginId]?.chainIcon ?? false).symbolImage
)
const rewardAssetUris = rewardContractAddresses.map(
rewardContractAddress => getCurrencyIconUris(pluginId, rewardContractAddress ?? null, SPECIAL_CURRENCY_INFO[pluginId]?.chainIcon ?? false).symbolImage
)

return { stakeAssetUris, rewardAssetUris }
}
Expand Down

0 comments on commit 41ee341

Please sign in to comment.