Skip to content

Commit

Permalink
fix: show user position on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveVodrazka committed Sep 29, 2024
1 parent 3676578 commit a0915a8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 33 deletions.
48 changes: 24 additions & 24 deletions src/components/Yield/PoolItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,38 +165,38 @@ export const PoolItem = ({ pool }: Props) => {
)}
</div>
)}
<div>
<div>
{price === undefined ? (
<LoadingAnimation size={20} />
) : (
<p>${formatNumber(tvl * price)}</p>
)}
<p className="p4 secondary-col">
{formatNumber(tvl)} {pool.underlying.symbol}
</p>
</div>
</div>
{isWideScreen && (
<div>
<div>
{price === undefined ||
userPosition === undefined ||
userPosition === 0 ? (
<p>-</p>
) : (
<p>${formatNumber(userPosition * price)}</p>
)}
{userPosition === undefined || userPosition === 0 ? (
<p>- {pool.underlying.symbol}</p>
{price === undefined ? (
<LoadingAnimation size={20} />
) : (
<p className="p4 secondary-col">
{formatNumber(userPosition)} {pool.underlying.symbol}
</p>
<p>${formatNumber(tvl * price)}</p>
)}
<p className="p4 secondary-col">
{formatNumber(tvl)} {pool.underlying.symbol}
</p>
</div>
</div>
)}
<div>
<div>
{price === undefined ||
userPosition === undefined ||
userPosition === 0 ? (
<p>-</p>
) : (
<p>${formatNumber(userPosition * price)}</p>
)}
{userPosition === undefined || userPosition === 0 ? (
<p>- {pool.underlying.symbol}</p>
) : (
<p className="p4 secondary-col">
{formatNumber(userPosition)} {pool.underlying.symbol}
</p>
)}
</div>
</div>
<div>
<button onClick={handleClick} className="primary active mainbutton">
{userPosition === undefined || userPosition === 0 ? "View" : "Manage"}
Expand Down
9 changes: 0 additions & 9 deletions src/components/Yield/PoolTable.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useState } from "react";
import { useIsMobile } from "../../hooks/useIsMobile";
import { Pool } from "../../classes/Pool";
import {
Expand All @@ -14,7 +13,6 @@ import styles from "./pooltable.module.css";

export const PoolTable = () => {
const isWideScreen = !useIsMobile();
const [showPools, setShowPools] = useState<"all" | "call" | "put">("all");

const pools = [
new Pool(STRK_ADDRESS, USDC_ADDRESS, OptionType.Call),
Expand All @@ -27,13 +25,6 @@ export const PoolTable = () => {
new Pool(BTC_ADDRESS, USDC_ADDRESS, OptionType.Put),
];

const selectedPools =
showPools === "all"
? pools
: showPools === "call"
? pools.filter((p) => p.isCall)
: pools.filter((p) => p.isPut);

return (
<div className={styles.outer} style={{ marginTop: "20px" }}>
<div className={styles.inner + " " + styles.mobilewidth}>
Expand Down

0 comments on commit a0915a8

Please sign in to comment.