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): preview dialog for in-app staking + unstaking #742

Merged
merged 8 commits into from
Jul 3, 2024

Conversation

moo-onthelawn
Copy link
Contributor

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

  1. Implement preview confirmation dialog for staking and unstaking
  2. Does some refactoring to reorg stake / unstake form files

Initially:

forms/
  StakeForm/
  UnstakeForm/

Now:

forms/
   StakingForms/
      shared/
        ValidatorName
        StakeRewardButtonAndReceipt
        StakePreviewContents
        StakeConfirmationButtonRow
      StakeForm/
        index
        StakeFormInputContents
        StakeFormPreviewContents
        ValidatorDropdown
      UnstakeForm/
        index
        UnstakeFormInputContents
        UnstakeFormPreviewContents

Input Preview
Stake Screenshot 2024-07-02 at 5 30 55 PM Screenshot 2024-07-02 at 5 31 08 PM
Unstake Screenshot 2024-07-02 at 5 40 13 PM Screenshot 2024-07-02 at 5 40 24 PM
Unstake multiple Screenshot 2024-07-02 at 5 34 44 PM Screenshot 2024-07-02 at 5 34 31 PM

Views

  • New: views/forms/StakingForms/shared/StakePreviewContents

    • Used by StakeFormPreviewContents and UnstakeFormPreviewContents
    • Visual skeleton for the preview forms
  • New: views/forms/StakingForms/shared/StakeConfirmationButtonRow

    • Used by StakePreviewContents
  • Moved: views/StakeRewardButtonAndReceipt -> views/forms/StakingForms/shared/StakeRewardButtonAndReceipt

    • Used by StakePreviewContents
  • Moved: components/ValidatorName -> views/forms/StakingForms/shared/ValidatorName

  • StakeDialog

    • Updated to add steps to this dialog (editing inputs, and then previewing stake)
    • Also refactored a bit to take the logic out of StakeForm/index.ts - moved description into description prop of Dialog and LegalDisclaimer into footer prop
  • StakeForm (moved from forms/StakeForm -> forms/StakingForms/StakeForm)

    • Added logic for different rendering based on step (preview vs input)
    • A lot of code shifted into StakeFormInputContents and StakeFormPreviewContents
  • Deleted: StakeButtonAndReceipt, encapsulated into new: StakeFormInputContents

    • The existing stake form view
  • New: StakeFormPreviewContents

    • The new stake form preview step
  • UnstakeDialog

    • Updated to add steps to this dialog (editing inputs, and then previewing unstake)
    • Also refactored a bit to take the logic out of UnstakeForm/index.ts - moved description into description prop of Dialog
  • UnstakeForm (moved from forms/UnstakeForm -> forms/StakingForms/UnstakeForm)

    • Github didn't seem to pick up that it moved
  • Deleted: UnstakeButtonAndReceipt, encapsulated into new: UnstakeFormInputContents

    • The existing unstake form view
  • New: UntakeFormPreviewContents

    • The new unstake form preview step

Components

  • New: FastForwardIcon

  • New: components/ValidatorIcons

    • Renders a group of ValidatorFaviconIcons slightly overlapping each other
  • ValidatorFaviconIcon extracted into own component in components/ (from ValidatorName)

    • It's used without ValidatorName in several places

Styles/Mixins

  • styles/formMixins
    • Added a stakingForm mixin for UnstakeForm and StakeForm
  • styles/layoutMixins
    • Added textLineClamp which truncates text at 2 lines

Constants/Types

  • constants/stakingForms.ts
    • Added enum for StakeFormSteps currently used by StakeDialog, will be used by UnstakeDialog

Packages

  • package.json
    • bump localization

Copy link

vercel bot commented Jun 27, 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 Jul 2, 2024 9:46pm
v4-testnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2024 9:46pm

Copy link

linear bot commented Jun 27, 2024

@moo-onthelawn moo-onthelawn changed the title feat(staking): preview dialog for in-app staking feat(staking): (1/2) preview dialog for in-app staking Jun 28, 2024
@moo-onthelawn moo-onthelawn force-pushed the mulan/ote-473-confirm-state-for-stakeunstake branch from 114701f to 010dfaf Compare July 2, 2024 20:13
@moo-onthelawn moo-onthelawn changed the title feat(staking): (1/2) preview dialog for in-app staking feat(staking): preview dialog for in-app staking + unstaking Jul 2, 2024
@moo-onthelawn moo-onthelawn force-pushed the mulan/ote-473-confirm-state-for-stakeunstake branch from 010dfaf to 56a94a3 Compare July 2, 2024 20:25
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 job re-organizing! very cleanly done 🔥

@@ -174,4 +174,25 @@ export const formMixins = {
--form-input-gap: 1rem;
}
`,

stakingForm: css`
Copy link
Contributor

Choose a reason for hiding this comment

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

sweet!

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