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

feat(staking): ui of validator selection #691

Merged
merged 14 commits into from
Jun 20, 2024

Conversation

moo-onthelawn
Copy link
Contributor

@moo-onthelawn moo-onthelawn commented Jun 19, 2024

  1. Implement UI of Validator Selection on staking dialog
  • Note: no search bar implemented (confirmed with product)
  • Default sort is on "validator" which actually sorts by commission (lowest -> highest)
  1. Some smol polishes
  • Fix table sorting visuals
  • Update max input button to be purple with brighter text
  • Update text colors of staking and unstaking forms
  • Add token next to header on unstake form
  • Update tooltip of "Validator" on staking form + legal disclaimer
Empty With scrollable list of validators Non scrollable list of validators
Screenshot 2024-06-19 at 11 57 42 AM Screenshot 2024-06-19 at 2 02 43 PM Screenshot 2024-06-19 at 2 00 40 PM

Views

  • UnstakeForm

    • [Polish work] add token next to header
    • [Polish work] update staked amount text color
  • StakeForm

    • [Polish work] update tooltip on "Validator"; also rename "Selected Validator" -> "Validator"
    • [Polish work] update legal disclaimer (which no longer links out to Keplr) and update text size
    • [Polish work] fix up text colors in form

Components

  • New: DropdownIcon

    • Basically a caret or triangle that flips 180 degrees when open vs closed
    • Did some refactoring to use where possible; I didn't update cases where we associate it with a DropdownTrigger; that would require slightly more work
      • Updated in SearchSelectMenu, UnopenedIsolatedPositions, MarketsDropdown
      • Used in ValidatorDropdown
  • New: ValidatorDropdown

    • Implemented dropdown of validators
    • TODO to internationalize empty state
  • Details

    • Remove isolation: isolate because it's covered by layoutMixins calls below
  • FormMaxInputToggleButton

    • [Polish work] increase size to be small to match Figma
    • [Polish work] Update max button to be purple with brighter text
  • Popover

    • Add align prop to allow alignment to the end (radix prop)
  • Table

    • Fix our sort arrow not actually working because we were reading the aria-sort which didn't actually work
  • StakeRewardButtonAndReceipt

    • [Polish work] fix up text colors

Constants/Types

  • constants/validators.ts
    • add a ValidatorData type

Hooks

  • hooks/useStakingValidator
    • For now just pass in dummy data (filtered validators) for list of validators to show; linked a TODO

Copy link

vercel bot commented Jun 19, 2024

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

Name Status Preview Comments Updated (UTC)
v4-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2024 3:05pm
v4-testnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2024 3:05pm

Copy link

linear bot commented Jun 19, 2024

OTE-447 Implement UI

validators.push({
name: val.description.moniker,
operatorAddress: val.operatorAddress,
votingPower: MustBigNumber(val.delegatorShares).div(10 ** 36),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops forgot to update these hardcoded vals (36; 16) will do

Copy link
Contributor

@rosepuppy rosepuppy left a comment

Choose a reason for hiding this comment

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

Awesome work!!!

Copy link
Contributor

Choose a reason for hiding this comment

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

nice one

Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is implemented already so don't sweat it, and I think this approach is totally valid.

Originally I was thinking we could have leveraged SearchSelectMenu since it would give us the search functionality for free, and more designed as a popover UI. But obviously won't column have sorting, which I thought was less important. But just throwing it out there.

Copy link
Contributor Author

@moo-onthelawn moo-onthelawn Jun 20, 2024

Choose a reason for hiding this comment

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

ooh good point; yeah my understanding of product was that sortability seemed more important than search but may have been easier to use SearchSelectMenu. Tbh I was basing my implementation on the MarketsDropdown; I think there is opportunity to update SearchSelectMenu to be able to handle rendering something with a table (optionally) and then having MarketsDropdown/ValidatorDropdown reuse it as well // maybe one day I'll get around it to it 🫠

Copy link
Contributor

Choose a reason for hiding this comment

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

All good! I think this reasoning make sense too

@moo-onthelawn moo-onthelawn merged commit a8e3503 into main Jun 20, 2024
6 checks passed
@moo-onthelawn moo-onthelawn deleted the mulan/ote-447-implement-ui branch June 20, 2024 15:07
DavideSegullo added a commit to nabla-studio/v4-web that referenced this pull request Jun 26, 2024
* feat: ➕ add export-to-csv dep

* feat: ✨ add download icon

* feat: ✨ add navigation menu slots

* feat: ✨ add csv utility

* feat: 🏷️ improve dropdown menu types

* refactor: ♻️ refactor Output component

refactored Output component to export formatting utils.

* feat: ✨ add ExportHistoryDropdown component

* feat: ✨ add export inside History page

added ExportHistoryDropdown component inside History page layout.

* feat: 🚸 disable csv export on empty data

* feat: 📈 add export history analytics

* fix: 🐛 fix export history download

* fix: 🐛 fix post merge errors

* feat: ✨ add reusable format number function

* refactor: ♻️ add better style declaration

* fix: 🐛 fix post merge errors

* fix: 🐛 fix react errors

* fix: 🐛 fix empty export

* feat: ⬆️ upgrade @dydxprotocol/v4-client-js

* feat: ✨ add history export all services

* feat: ✨ add export loading states

* refactor: 🎨 improve format of the code

* style: 🚨 fix lint errors

* style: 🚨 add default case

* feat: ✨ add export sorting in decreasing order

* feat: ✨ add price column inside csv

* fix: add back precision to earned by stakers (dydxprotocol#692)

* fix(sparklines): bump abacus and fix output component (dydxprotocol#695)

* feat(staking): ui of validator selection (dydxprotocol#691)

* chore: replace spread row with mid market price row (dydxprotocol#696)

* chore(hide-gasToggle): temp hide gas toggle (dydxprotocol#700)

* chore: improve order statuses (dydxprotocol#693)

* fix(subaccount-transfer): enforce senderAddress matches localWallet (dydxprotocol#703)

* feat: update to use proxy for staking apr (dydxprotocol#702)

* chore: remove deprecated params [OTE-353] (dydxprotocol#698)

* feat: add ZK, ZRO, NCAT to the widget (dydxprotocol#704)

* feat(staking): polishes (dydxprotocol#701)

* feat: improve markets page style (dydxprotocol#699)

* feat: ⬆️ upgrade @dydxprotocol/v4-client-js

* feat: ✨ add parentSubaccount export

* feat: ✨ disable export on disconnection state

* feat(staking): add staking live notif (dydxprotocol#708)

* feat(new market): have other market validation run on diff only (dydxprotocol#705)

* feat: redirect other reward pages after staking is turned on (dydxprotocol#711)

* docs: 📝 improve comment format

* fix: 🐛 fix merge error

* style: 🚨 fix lint errors

* feat: fix invert tag for certain raydium markets (dydxprotocol#709)

Co-authored-by: jaredvu <[email protected]>

* chore(default-page): change default page to /markets (dydxprotocol#713)

* chore(staking): remove last faq question (dydxprotocol#712)

* feat: add tracking to staking (dydxprotocol#710)

* fix: polishes for staking (dydxprotocol#716)

* fix: nonzero rewards (dydxprotocol#653)

* chore: fully type dialogs, fix some more any types, redo analytics (dydxprotocol#671)

* fix: fix validator url icon (dydxprotocol#720)

* chore(new-market): update header copy (dydxprotocol#718)

* feat(mobile-download): Add mobile app store download links (dydxprotocol#717)

* feat: preload metadata for all markets in otherMarketData.json (dydxprotocol#646)

Co-authored-by: jaredvu <[email protected]>

* fix: isolated positions bug fixes + auto-open (dydxprotocol#721)

* feat: orderbook refresh + updates (dydxprotocol#647)

* chore: install-local-l10n command (dydxprotocol#697)

* chore: use FormMaxInputToggleButton in transfer/deposit/withdraw forms (dydxprotocol#715)

* fix: fix updated terms of use link (dydxprotocol#724)

* fix: orderbook bugs (dydxprotocol#725)

* style(nits): update exchange billboards and stats, assetIcons (dydxprotocol#726)

* feat: update zk logo and zro zk logo data (dydxprotocol#727)

* feat: skip track/status endpoints [OTE-354] (dydxprotocol#719)

* fix(disconnect-cleanup): set localWallet and hdKey to undefined when disconnecting (dydxprotocol#728)

* fix: analytics property names (dydxprotocol#730)

* style(tables): update table header styling (dydxprotocol#729)

* feat: ✨ add new analytics api

---------

Co-authored-by: moo-onthelawn <[email protected]>
Co-authored-by: Jared Vu <[email protected]>
Co-authored-by: aleka <[email protected]>
Co-authored-by: Bill <[email protected]>
Co-authored-by: Jeremy Lee <[email protected]>
Co-authored-by: yujin512 <[email protected]>
Co-authored-by: Tian <[email protected]>
Co-authored-by: tyleroooo <[email protected]>
DavideSegullo pushed a commit to nabla-studio/v4-web that referenced this pull request Jun 26, 2024
DavideSegullo pushed a commit to nabla-studio/v4-web that referenced this pull request Jun 26, 2024
DavideSegullo added a commit to nabla-studio/v4-web that referenced this pull request Jun 28, 2024
chore: override post order position margin for full close position on isolated market (dydxprotocol#670)

fix: fix decimal places on order size/amount in positions + orders table (dydxprotocol#675)

chore(staking): (un)stake form polishes (dydxprotocol#658)

chore: set privy app client id (dydxprotocol#660)

fix: handle partially canceled orders (dydxprotocol#679)

fix(staking): add faq + fix unflagged fetch of trading rewards data (dydxprotocol#681)

feat: cancel trigger orders automatically / abacus bump (dydxprotocol#682)

chore: abacus enum casing + remove cancelOrder param (dydxprotocol#683)

chore(adjust-margin): add additional validation (dydxprotocol#668)

chore(abacus): bump to 1.7.83 (dydxprotocol#677)

Co-authored-by: aforaleka <[email protected]>

feat: add raydium markets to the widget (dydxprotocol#533)

Co-authored-by: jaredvu <[email protected]>
Co-authored-by: Bill <[email protected]>
Co-authored-by: tyleroooo <[email protected]>
Co-authored-by: moo-onthelawn <[email protected]>
Co-authored-by: Tian Qin <[email protected]>
Co-authored-by: Nikhil Vasan <[email protected]>

fix(new-market-filter): remove isolated filter (dydxprotocol#688)

feat(staking): claim rewards transaction (+ simulation) (dydxprotocol#648)

fix: Recently Listed Markets View Sorted by `clobPairId` (dydxprotocol#689)

chore: bump abacus (dydxprotocol#690)

feat: share PNL analytics (dydxprotocol#678)

fix: add back precision to earned by stakers (dydxprotocol#692)

fix(sparklines): bump abacus and fix output component (dydxprotocol#695)

feat(staking): ui of validator selection (dydxprotocol#691)

chore: replace spread row with mid market price row (dydxprotocol#696)

chore(hide-gasToggle): temp hide gas toggle (dydxprotocol#700)

chore: improve order statuses (dydxprotocol#693)

fix(subaccount-transfer): enforce senderAddress matches localWallet (dydxprotocol#703)

feat: update to use proxy for staking apr (dydxprotocol#702)

chore: remove deprecated params [OTE-353] (dydxprotocol#698)

feat: add ZK, ZRO, NCAT to the widget (dydxprotocol#704)

feat(staking): polishes (dydxprotocol#701)

feat: improve markets page style (dydxprotocol#699)

feat(staking): add staking live notif (dydxprotocol#708)

feat(new market): have other market validation run on diff only (dydxprotocol#705)

feat: redirect other reward pages after staking is turned on (dydxprotocol#711)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants