Skip to content

Commit

Permalink
hide send button when not transferable (#6123)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-schrammel committed Oct 16, 2024
1 parent f4ca59a commit caed4a7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/expanded-state/asset/ChartExpandedState.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export default function ChartExpandedState({ asset }) {

const isL2 = useMemo(() => isL2Chain({ chainId: asset?.chainId }), [asset?.chainId]);
const isTestnet = isTestnetChain({ chainId: currentChainId });
const isTransferable = asset?.transferable ?? genericAsset?.transferable ?? true;

const { data, isLoading: additionalAssetDataLoading } = useAdditionalAssetData({
address: asset?.address,
Expand Down Expand Up @@ -293,7 +294,9 @@ export default function ChartExpandedState({ asset }) {
<SwapActionButton asset={assetWithPrice} color={color} inputType={AssetInputTypes.in} />
)}
{hasBalance ? (
<SendActionButton asset={assetWithPrice} color={color} fromDiscover={fromDiscover} />
isTransferable ? (
<SendActionButton asset={assetWithPrice} color={color} fromDiscover={fromDiscover} />
) : null
) : swapEnabled ? (
<SwapActionButton
asset={assetWithPrice}
Expand Down
1 change: 1 addition & 0 deletions src/graphql/queries/metadata.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ query externalToken($address: String!, $chainId: Int!, $currency: String) {
iconUrl
name
networks
transferable
price {
relativeChange24h
value
Expand Down
1 change: 1 addition & 0 deletions src/resources/assets/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export function parseAsset({ address, asset }: { address: string; asset: AddysAs
symbol: asset?.symbol,
type: asset?.type,
uniqueId,
transferable: asset?.transferable,
};

return parsedAsset;
Expand Down
1 change: 1 addition & 0 deletions src/resources/assets/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type AddysAsset = {
price?: AddysAssetPrice;
symbol: string;
type?: string;
transferable?: boolean;
};

export type AddysNetworkDetails = {
Expand Down

0 comments on commit caed4a7

Please sign in to comment.