Skip to content

Conversation

@DannyDelott
Copy link
Contributor

@DannyDelott DannyDelott commented Oct 17, 2023

Related to #433, matches the simpler style for the preview card/modal:

Open short Add Liquidity Redeem Withdrawal Shares
image image image

@vercel
Copy link

vercel bot commented Oct 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hyperdrive-fixed-borrow ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 3:45pm
hyperdrive-monorepo-hyperdrive-trading ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 3:45pm
hyperdrive-sdk-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 3:45pm
trading-competition ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 3:45pm

className={
"daisy-badge daisy-badge-md inline-flex text-success"
}
>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding a badge to show you how much ETH this fixed yield represents:
image

Approve {market.baseToken.symbol}
</button>
<p className="text-center text-body">
Please note: You can remove your liquidity at any time, however if
Copy link
Contributor

Choose a reason for hiding this comment

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

There's something about this note being on three lines that feels like it's too much text for this modal. Does this get across the point "Note: You can withdraw liquidity at any time. If you're backing open positions, you'll receive Withdrawal Shares for later redemption." It gets across the point and looks cleaner at two lines

const formattedBaseAmountOut =
baseAmountOut !== undefined
? `${formatBalance({
balance: baseAmountOut,
Copy link
Contributor

Choose a reason for hiding this comment

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

The onRemoveLiquidity callback and baseSymbol are unused in this file. Unless we'll need them later we should remove.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing baseSymbol but I'd like to keep onRemoveLiquidity a little longer in case we want to e.preventDefault() (to avoid closing the modal this form is rendered in) in the near term

className="daisy-btn-primary daisy-btn"
disabled={!removeLiquidity || removeLiquidityStatus === "loading"}
onClick={(e) => {
removeLiquidity?.();
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this just be onClick={removeLiquidity} since we don't use any params

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, I think i'll just wire up onRemoveLiquidity here instead so the event arg is used.

<h5>Approve {market.baseToken.symbol}</h5>
</button>
<p className="text-center text-body">
Please note: When you short hy{market.baseToken.symbol} you earn the
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels like we don't need these notes here. If a user is taking an action like this they will likely have taken the time to understand the result of taking out a short. Maybe the exception is LP modal where the concept of withdrawal shares requires a note.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the notes are helpful since we're introducing something new to the market. It's worth highlighting the risks at the point a user is about to transact, eg: long price can fluctuate before close, shorts earn the yield source rate, and LPs might receive withdrawal shares when closing.

</div>
<div className="flex justify-between">
<p className="">Matures in</p>
<p className="">
Copy link
Contributor

Choose a reason for hiding this comment

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

remove unused class names

</p>
</div>
<div className="flex justify-between">
<p className="">Matures in</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Here too

<SortableGridTable
headingRowClassName="grid-cols-5 text-start"
bodyRowClassName="grid-cols-5 items-center text-sm md:text-h6 even:bg-base-300/5 h-16"
bodyRowClassName="grid-cols-5 items-center even:bg-base-300/5 h-16"
Copy link
Contributor

Choose a reason for hiding this comment

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

We should convert this over to react-table for consistency. I can do this after I add LP to the transactions table.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

💯

@DannyDelott DannyDelott merged commit a5d022d into main Oct 17, 2023
@DannyDelott DannyDelott deleted the danny-polish-open-shorts branch October 17, 2023 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants