Skip to content

Commit

Permalink
Remove Token and TokenInfoProps interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
saidam90 committed Aug 11, 2024
1 parent acee1ea commit 289ba3a
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions src/app/components/PriceChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { displayNumber, getPrecision } from "../utils";
import * as tailwindConfig from "../../../tailwind.config";
import { shortenString } from "../utils";
import { TextToCopy } from "./TextToCopy";
import { TokenInfo } from "state/pairSelectorSlice";

interface PriceChartProps {
data: OHLCVData[];
Expand Down Expand Up @@ -429,36 +430,22 @@ function LabelAndAddress({
);
}

interface Token {
iconUrl: string;
symbol: string;
name: string;
address: string;
}

interface TokenInfoProps {
token: Token;
}

function CoinInfo({ token }: TokenInfoProps) {
function CoinInfo({ token }: { token: TokenInfo }) {
const { iconUrl, symbol, name, address } = token;
const t = useTranslations();

return (
<div className="flex flex-col items-start xs:mb-4 mb-4 sm:mb-0 w-[50%]">
<div className="flex items-center mb-3 pt-8">
<img
src={token.iconUrl}
alt={token.symbol}
className="w-8 h-8 rounded-full"
/>
<img src={iconUrl} alt={symbol} className="w-8 h-8 rounded-full" />
<p className="pl-2 text-base">
{token.name.split(" ")[0]} ({token.symbol})
{name.split(" ")[0]} ({symbol})
</p>
</div>
<div className="flex flex-col">
<LabelAndAddress
label={t("resource")}
address={token.address}
address={address}
shortenLength={{ min: 8, max: 10 }}
/>
</div>
Expand Down

0 comments on commit 289ba3a

Please sign in to comment.