Skip to content

Commit

Permalink
feat: hide pool weights for concentrated pools in mobile (#4018)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseRFelix authored Dec 18, 2024
1 parent 61314b9 commit b9b33e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/web/components/chart/asset-breakdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ export const AssetBreakdownChart: FunctionComponent<{
}[];
totalWeight: IntPretty;
colorCycle?: typeof ColorCycle;
}> = ({ assets, totalWeight, colorCycle = ColorCycle }) => {
hideWeights?: boolean;
}> = ({
assets,
totalWeight,
colorCycle = ColorCycle,
hideWeights = false,
}) => {
const { isMobile, width } = useWindowSize();

const assetPercentages = assets.map(({ weight }) =>
Expand Down Expand Up @@ -55,8 +61,8 @@ export const AssetBreakdownChart: FunctionComponent<{
className="subtitle1 md:body2 text-osmoverse-400"
title={amount.currency.coinDenom}
>
{truncate(amount.currency.coinDenom, isMobile ? 6 : 12)}:{" "}
{assetPercentages[index].toString()}%
{truncate(amount.currency.coinDenom, isMobile ? 6 : 12)}
{!hideWeights && <>: {assetPercentages[index].toString()}%</>}
</span>
</div>
<h6 className="md:subtitle2 text-osmoverse-100">
Expand Down
1 change: 1 addition & 0 deletions packages/web/components/pool-detail/base-pool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export const BasePoolDetails: FunctionComponent<{
amount: coin,
}))}
totalWeight={new IntPretty(pool.reserveCoins.length)}
hideWeights={pool.type === "concentrated"}
/>
</div>
</div>
Expand Down

0 comments on commit b9b33e9

Please sign in to comment.