warden-protocol / wardenprotocol

Monorepo for the Warden Protocol.
https://wardenprotocol.org
Apache License 2.0
1.1k stars 107 forks source link

feat(spaceward): add Staking page and modals #331

Closed alex-nax closed 3 months ago

alex-nax commented 4 months ago

fix(spaceward): refs clean-23-05

feat(spaceward): Add stake page

staking wip

Summary by CodeRabbit

coderabbitai[bot] commented 4 months ago

[!NOTE] Currently processing new changes in this PR. This may take a few minutes, please wait...

Commits Files that changed from the base of the PR and between 24a33353d404ff846acfaabd70251587bf147db5 and 0461d01198e8f3002987c864ef7c0d9579dab8ca.
Files ignored due to path filters (4) * `spaceward/public/images/bnr-governance.png` is excluded by `!**/*.png` * `spaceward/public/images/chorus.png` is excluded by `!**/*.png` * `spaceward/public/images/dsrv.png` is excluded by `!**/*.png` * `spaceward/public/images/graph-example.png` is excluded by `!**/*.png`
Files selected for processing (28) * spaceward/src/App.tsx (2 hunks) * spaceward/src/components/ui/icons-assets.tsx (1 hunks) * spaceward/src/features/assets/Assets.tsx (1 hunks) * spaceward/src/features/assets/SignTransactionModal.tsx (1 hunks) * spaceward/src/features/governance/CantVoteModal.tsx (1 hunks) * spaceward/src/features/governance/DetailsModal.tsx (1 hunks) * spaceward/src/features/governance/ItemCard.tsx (1 hunks) * spaceward/src/features/governance/ItemRow.tsx (1 hunks) * spaceward/src/features/governance/VoteModal.tsx (1 hunks) * spaceward/src/features/governance/VotesListModal.tsx (1 hunks) * spaceward/src/features/intents/Intent.tsx (4 hunks) * spaceward/src/features/intents/util/code.test.ts (2 hunks) * spaceward/src/features/intents/util/code.ts (1 hunks) * spaceward/src/features/staking/DetailsModal.tsx (1 hunks) * spaceward/src/features/staking/RedelegateModal.tsx (1 hunks) * spaceward/src/features/staking/StakeModal.tsx (1 hunks) * spaceward/src/features/staking/StakingHeading.tsx (1 hunks) * spaceward/src/features/staking/ValidatorRow.tsx (1 hunks) * spaceward/src/features/staking/hooks.ts (1 hunks) * spaceward/src/features/staking/types.ts (1 hunks) * spaceward/src/features/staking/util.ts (1 hunks) * spaceward/src/layouts/sidebar.tsx (2 hunks) * spaceward/src/lib/math.ts (1 hunks) * spaceward/src/pages/Governance.tsx (1 hunks) * spaceward/src/pages/Staking.tsx (1 hunks) * spaceward/src/pages/index.ts (1 hunks) * spaceward/src/utils/common.ts (1 hunks) * spaceward/tailwind.config.ts (2 hunks)
 ______________
< Bugs begone! >
 --------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ

Walkthrough

The changes introduced several new components and functionalities related to staking and governance in the Spaceward application. These include new pages for staking and governance, various modal components for voting, staking, and displaying details, as well as new icons and utility functions. Additionally, the Tailwind configuration was updated with new color definitions and box shadow styles.

Changes

File Path Change Summary
spaceward/src/App.tsx Added routes for StakingPage and GovernancePage.
spaceward/src/components/ui/icons-assets.tsx Added new SVG icons and corresponding rendering functions.
spaceward/src/features/assets/Assets.tsx Removed code related to wallet address display.
spaceward/src/features/governance/... Introduced new components: CantVoteModal, DetailsModal, ItemCard, ItemRow, VoteModal, VotesListModal.
spaceward/src/features/intents/Intent.tsx Refactored reducer function to use commonReducer.
spaceward/src/features/intents/util/code.test.ts Added a new test for tokenization functionality.
spaceward/src/features/intents/util/code.ts Adjusted normalize function to exclude an additional character in the value string.
spaceward/src/features/stake/StakeModal.tsx Introduced StakeModal component with new props and transaction handling.
spaceward/src/features/staking/... Added new components and functionalities for staking, including DetailsModal, RedelegateModal, StakingHeading, ValidatorRow, and hooks.
spaceward/src/pages/Staking.tsx Introduced StakingPage component for handling staking functionality.
spaceward/src/pages/index.ts Added export statement for StakingPage.
spaceward/src/utils/common.ts Introduced common utility functions for handling actions and reducers.
spaceward/tailwind.config.ts Updated Tailwind configuration with new colors and box shadow styles.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant App
    participant StakingPage
    participant GovernancePage
    participant StakeModal
    participant DetailsModal
    participant RedelegateModal
    participant VoteModal
    participant VotesListModal

    User ->> App: Navigate to /staking
    App ->> StakingPage: Render StakingPage
    StakingPage ->> StakeModal: Open Stake Modal
    User ->> StakeModal: Submit Stake Transaction
    StakeModal ->> StakingPage: Update Staking Info

    User ->> App: Navigate to /governance
    App ->> GovernancePage: Render GovernancePage
    GovernancePage ->> DetailsModal: Open Details Modal
    User ->> DetailsModal: Interact with Proposal Details
    DetailsModal ->> VoteModal: Open Vote Modal
    User ->> VoteModal: Submit Vote
    VoteModal ->> GovernancePage: Update Voting Info
    GovernancePage ->> VotesListModal: Open Votes List Modal
    User ->> VotesListModal: View Votes List

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
github-actions[bot] commented 4 months ago

Hey @alex-nax and thank you for opening this pull request! 👋🏼

It looks like you forgot to add a changelog entry for your changes. Make sure to add a changelog entry in the 'CHANGELOG.md' file.