-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split up OpenOrdersTable and ClosedOrdersTable components
- Loading branch information
1 parent
e6e20d1
commit fc8c168
Showing
8 changed files
with
59 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
31 changes: 31 additions & 0 deletions
31
apps/hyperdrive-trading/src/ui/portfolio/OpenLongsTable/OpenLongsTable.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* eslint-disable react/jsx-key */ | ||
import { ReactElement } from "react"; | ||
import { Hyperdrive } from "src/appconfig/types"; | ||
import { SortableGridTable } from "src/ui/base/components/tables/SortableGridTable"; | ||
import { useOpenLongRows } from "src/ui/portfolio/OpenLongsTable/useOpenLongRows"; | ||
import { useAccount } from "wagmi"; | ||
|
||
interface OpenOrdersTableProps { | ||
hyperdrive: Hyperdrive; | ||
} | ||
|
||
export function OpenLongsTable({ | ||
hyperdrive, | ||
}: OpenOrdersTableProps): ReactElement { | ||
const { address: account } = useAccount(); | ||
|
||
const { openLongRows = [] } = useOpenLongRows({ | ||
account, | ||
hyperdrive, | ||
}); | ||
|
||
return ( | ||
<SortableGridTable | ||
headingRowClassName="grid-cols-4 text-neutral-content" | ||
bodyRowClassName="grid-cols-4 text-base-content items-center text-h6 even:bg-base-300/50 h-16" | ||
// Blank col added for actions | ||
cols={["Position", "Balance", "Value", "Matures on", ""]} | ||
rows={openLongRows} | ||
/> | ||
); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters