Skip to content

Commit

Permalink
Merge pull request #590 from DeXter-on-Radix/fix-icon
Browse files Browse the repository at this point in the history
fix logo for details page as well
  • Loading branch information
Radstakes authored Oct 2, 2024
2 parents a992a80 + 8c6c17a commit 959dcaf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/app/rewards/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { getTokenRewards, getTypeRewards } from "../state/rewardUtils";

// import * as adex from "alphadex-sdk-js";
import { DexterToast } from "../components/DexterToaster";
import { DEXTER_LOGO_URL } from "utils";

export default function Rewards() {
const { showSuccessUi } = useAppSelector((state) => state.rewardSlice);
Expand Down Expand Up @@ -199,7 +200,11 @@ function RewardsOverview() {
key={indx}
>
<img
src={rewardToken.iconUrl}
src={
rewardToken.symbol === "DEXTR"
? DEXTER_LOGO_URL
: rewardToken.iconUrl
}
alt={rewardToken.name}
className="w-7 h-7 rounded-full mr-3"
></img>
Expand Down Expand Up @@ -312,7 +317,11 @@ function RewardsDetails() {
key={indx2}
>
<img
src={tokenReward.iconUrl}
src={
tokenReward.symbol === "DEXTR"
? DEXTER_LOGO_URL
: tokenReward.iconUrl
}
alt={tokenReward.name}
className="w-4 h-4 rounded-full mr-2"
></img>
Expand Down
5 changes: 4 additions & 1 deletion src/app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import * as adex from "alphadex-sdk-js";
import { TokenInfo } from "./state/pairSelectorSlice";
import type { OrderReceipt } from "alphadex-sdk-js";

export const DEXTER_LOGO_URL =
"https://assets.coingecko.com/coins/images/34946/standard/DEXTRLogo.jpg";

export function displayPositiveNumber(
x: number,
noDigits: number = 6,
Expand Down Expand Up @@ -315,7 +318,7 @@ export function updateIconIfNeeded(token: adex.TokenInfo): TokenInfo {
const iconUrl =
token.symbol === "DEXTR"
? // use asset from coingecko to prevent ipfs failure
"https://assets.coingecko.com/coins/images/34946/standard/DEXTRLogo.jpg"
DEXTER_LOGO_URL
: token.symbol === "RDK"
? // fix wrong icon URL in metadata ofRDK on ledger, see https://t.me/radix_dlt/716425
"https://radket.shop/img/logo.svg"
Expand Down

0 comments on commit 959dcaf

Please sign in to comment.