Skip to content

Commit

Permalink
remove unused table skeleton (#1749)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackburrus authored Jan 29, 2025
1 parent 8625823 commit d24eee8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { useAppConfigForConnectedChain } from "src/ui/appconfig/useAppConfigForC
import { ConnectWalletButton } from "src/ui/base/components/ConnectWallet";
import { NonIdealState } from "src/ui/base/components/NonIdealState";
import { Pagination } from "src/ui/base/components/Pagination";
import { TableSkeleton } from "src/ui/base/components/TableSkeleton";
import { formatBalance } from "src/ui/base/formatting/formatBalance";
import { CloseLongModalButton } from "src/ui/hyperdrive/longs/CloseLongModalButton/CloseLongModalButton";
import { StatusCell } from "src/ui/hyperdrive/longs/StatusCell";
Expand All @@ -42,8 +41,10 @@ export function OpenLongsTableDesktop({
hyperdrives: HyperdriveConfig[];
account: Address | undefined;
}): ReactElement | null {
const { openLongPositions, openLongPositionsStatus } =
usePortfolioLongsDataFromHyperdrives({ hyperdrives, account });
const { openLongPositions } = usePortfolioLongsDataFromHyperdrives({
hyperdrives,
account,
});
const openLongPositionsExist = openLongPositions?.some(
(position) => position.details !== undefined,
);
Expand Down Expand Up @@ -80,10 +81,6 @@ export function OpenLongsTableDesktop({
);
}

if (openLongPositionsStatus === "loading") {
return <TableSkeleton numColumns={columns.length} numRows={5} />;
}

if (!openLongPositionsExist) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { useAppConfigForConnectedChain } from "src/ui/appconfig/useAppConfigForC
import { ConnectWalletButton } from "src/ui/base/components/ConnectWallet";
import { NonIdealState } from "src/ui/base/components/NonIdealState";
import { Pagination } from "src/ui/base/components/Pagination";
import { TableSkeleton } from "src/ui/base/components/TableSkeleton";
import { formatBalance } from "src/ui/base/formatting/formatBalance";
import { StatusCell } from "src/ui/hyperdrive/longs/StatusCell";
import { MaturesOnCell } from "src/ui/hyperdrive/MaturesOnCell/MaturesOnCell";
Expand All @@ -40,8 +39,10 @@ export function OpenShortsTableDesktop({
account: Address | undefined;
}): ReactElement | null {
const appConfig = useAppConfigForConnectedChain();
const { openShortPositions, openShortPositionsStatus } =
usePortfolioShortsDataFromHyperdrives({ hyperdrives, account });
const { openShortPositions } = usePortfolioShortsDataFromHyperdrives({
hyperdrives,
account,
});
const openShortPositionsExist =
openShortPositions && openShortPositions.length > 0;
const columns = getColumns({ account, hyperdrives, appConfig });
Expand Down Expand Up @@ -77,10 +78,6 @@ export function OpenShortsTableDesktop({
return null;
}

if (openShortPositionsStatus === "loading") {
return <TableSkeleton numColumns={columns.length} numRows={5} />;
}

return (
<div className="flex flex-col gap-6">
<PositionTableHeading
Expand Down

0 comments on commit d24eee8

Please sign in to comment.