diff --git a/src/apps/pulse/components/Buy/Buy.tsx b/src/apps/pulse/components/Buy/Buy.tsx index 9e56be2c..0e800a8c 100644 --- a/src/apps/pulse/components/Buy/Buy.tsx +++ b/src/apps/pulse/components/Buy/Buy.tsx @@ -200,17 +200,17 @@ export default function Buy(props: BuyProps) { } = useTokenPnL( token && accountAddress && portfolioToken ? { - token: { - contract: token.address || '', - symbol: token.symbol, - decimals: token.decimals || 18, - balance: portfolioToken.balance || 0, - price: portfolioToken.price || 0, - }, - transactionsData, - walletAddress: accountAddress, - chainId: token.chainId, - } + token: { + contract: token.address || '', + symbol: token.symbol, + decimals: token.decimals || 18, + balance: portfolioToken.balance || 0, + price: portfolioToken.price || 0, + }, + transactionsData, + walletAddress: accountAddress, + chainId: token.chainId, + } : null ); @@ -245,7 +245,7 @@ export default function Buy(props: BuyProps) { const nativeToken = portfolioTokens.find( (t) => Number(getChainId(t.blockchain as MobulaChainNames)) === - maxStableCoinBalance.chainId && isNativeToken(t.contract) + maxStableCoinBalance.chainId && isNativeToken(t.contract) ); if (!nativeToken) { @@ -598,7 +598,7 @@ export default function Buy(props: BuyProps) { ? foundToken.decimals[0] || 18 : foundToken.decimals || 18, usdValue: foundToken.price?.toString() || '0', - dailyPriceChange: 0, + dailyPriceChange: foundToken.price_change_24h || 0, }; setBuyToken(tokenToSelect as SelectedToken); @@ -642,11 +642,11 @@ export default function Buy(props: BuyProps) { > {token ? (
{/* Logo */} -
+
{token.logo ? (
- {/* Top Row: Symbol and Name */} -
-

- {token.symbol} -

-

- {token.name} -

-
+ {/* Text Container */} +
+ {/* Top Row: Symbol and Name */} +
+

+ {token.symbol} +

+

+ {token.name} +

+
+ + {/* Bottom Row: Price and Change */} +
+

+ ${token.usdValue} +

- {/* Bottom Row: Price and Change */} -
-

- ${token.usdValue} -

- -
- {/* Triangle Indicator */} - {token.dailyPriceChange !== 0 && ( -
= 0 - ? 'border-b-[6px] border-b-[#5CFF93]' - : 'border-t-[6px] border-t-[#FF366C]' - } opacity-50`} - /> - )} - -

= 0 +

+ {/* Triangle Indicator */} + {token.dailyPriceChange !== 0 && ( +
= 0 + ? 'border-b-[4px] border-b-[#5CFF93]' + : 'border-t-[4px] border-t-[#FF366C]' + } opacity-50`} + /> + )} + +

= 0 ? 'text-[#5CFF93]' : 'text-[#FF366C]' - }`} - > - {Math.abs(token.dailyPriceChange).toFixed(2)}% -

+ }`} + > + {Math.abs(token.dailyPriceChange).toFixed(2)}% +

+
{/* Chevron */} -
+
arrow-down
@@ -852,11 +853,10 @@ export default function Buy(props: BuyProps) { className="flex bg-black ml-2.5 mr-2.5 w-[75px] h-[30px] rounded-[10px] p-0.5 pb-1 pt-0.5" >