Skip to content

Commit

Permalink
fix: [GSW-2033] Native TokenDetail Link
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrg committed Jan 6, 2025
1 parent 62ebecf commit fcdd813
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useTheme } from "@emotion/react";
import { useGnoscanUrl } from "@hooks/common/use-gnoscan-url";
import { LineGraphData } from "@components/common/line-graph/LineGraph";
import { DEVICE_TYPE } from "@styles/media";
import { GNOT_TOKEN } from "@common/values/token-constant";
import useElementWidth from "@hooks/common/use-element-width";

import MissingLogo from "@components/common/missing-logo/MissingLogo";
Expand Down Expand Up @@ -73,6 +74,10 @@ const SwapTokenHeader = ({ tokenInfo, currentPrice, chartData, containerWidth }:

const onClickTokenName = React.useCallback(() => {
if (!tokenInfo.path) return;
if (tokenInfo.isNative) {
router.movePageWithTokenPath("TOKEN", GNOT_TOKEN.path);
return;
}
router.movePageWithTokenPath("TOKEN", tokenInfo.path);
}, [tokenInfo.path, router]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const SwapTokenInfo = ({ token }: SwapTokenInfoProps) => {
name: token.name,
symbol: token.symbol,
logoURI: token.logoURI,
path: token.path,
path: token.type === "native" ? token.wrappedPath : token.path,
isNative: token.type === "native",
}),
[token],
Expand Down

0 comments on commit fcdd813

Please sign in to comment.