Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: misc vault fixes 7 #1216

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions src/pages/vaults/VaultPositionsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,17 @@ export const VaultPositionsTable = ({ className }: { className?: string }) => {
>
{marketId === USDC_MARKET_HARDCODED ? usdcLabel : asset?.name}
<div tw="row gap-0.25">
<$OutputSigned
value={
(currentLeverageMultiple ?? 0) === 0
? stringGetter({ key: STRING_KEYS.NONE })
: (currentLeverageMultiple ?? 0) < 0
{!!currentLeverageMultiple && (
<$OutputSigned
value={
(currentLeverageMultiple ?? 0) < 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait, is this conditional possible? since this won't render unless !!currentLEverageMultiple evaluates to true?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, what i meant is the nullish coalescing operator required*

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh good point it's not required anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

welp guess it's going in the next misc fixes pr, probably tomorrow

? stringGetter({ key: STRING_KEYS.SHORT_POSITION_SHORT })
: stringGetter({ key: STRING_KEYS.LONG_POSITION_SHORT })
}
sign={getNumberSign(currentLeverageMultiple ?? 0)}
type={OutputType.Text}
/>
}
sign={getNumberSign(currentLeverageMultiple ?? 0)}
type={OutputType.Text}
/>
)}
<Output
type={OutputType.Multiple}
value={
Expand Down Expand Up @@ -202,7 +202,15 @@ export const VaultPositionsTable = ({ className }: { className?: string }) => {
},
] satisfies Array<ColumnDef<VaultTableRow> | false>
).filter(isTruthy),
[isTablet, marketIdToAssetMetadataMap, marketsData, navigate, stringGetter, usdcImage]
[
isTablet,
marketIdToAssetMetadataMap,
marketsData,
navigate,
stringGetter,
usdcImage,
usdcLabel,
]
);

return (
Expand Down
Loading