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

squashed: web-ui/staging #1374

Merged
merged 9 commits into from
Apr 3, 2024
Merged

squashed: web-ui/staging #1374

merged 9 commits into from
Apr 3, 2024

Conversation

joe-bowman
Copy link
Contributor

@joe-bowman joe-bowman commented Apr 2, 2024

1. Summary

All web-ui/* changes from web-ui/staging branch without breaking non web-ui changes.

Summary by CodeRabbit

  • New Features
    • Added deposit and withdraw functionality for assets, including UI updates for better interaction.
    • Introduced a rewards modal to display token rewards from fees, staking, and holding qAssets with functionality to bridge these rewards to different chains.
    • Enhanced staking features with new modals and updated fee estimation logic.
    • Implemented dynamic fee estimation across transactions, replacing static fee calculations.
  • Bug Fixes
    • Fixed issues related to skeleton spam and ensured refetching of data on transaction success.
    • Adjusted the back button size in the staking modal for better accessibility.
  • Documentation
    • Completed documentation for adding networks, enhancing user guidance.
  • Refactor
    • Refactored state management and layout in asset modals for clarity and efficiency.
    • Updated portfolio display logic for more accurate representation of assets.
  • Style
    • Made significant styling changes to components like the chain dropdown for consistency and visual appeal.
    • Adjusted modal body styling and button variants for better layout and readability.
  • Chores
    • Updated imports and removed unused components to clean up the codebase and improve maintainability.

@joe-bowman joe-bowman requested a review from chalabi2 as a code owner April 2, 2024 10:05
Copy link
Contributor

coderabbitai bot commented Apr 2, 2024

Walkthrough

The recent updates focus on enhancing the web UI's functionality and user experience across various components. Key improvements include the addition of new features like support for Dymension, weight options, UI/UX enhancements, and the integration of dynamic fee estimation. Components related to assets, staking, and modals have seen significant refinements, including better handling of interchain details, deposit/withdraw functionality, and a more intuitive layout. Documentation and code readability have also been improved, streamlining the development process.

Changes

File Path Summary
web-ui/README.md Adjusted task list, added support for Dymension, weight options, UI/UX improvements, and network documentation.
web-ui/components/Assets/... Enhanced asset handling, added new props, interchain details, deposit/withdraw functionality, and dynamic fee estimation.
web-ui/components/Assets/modals/... Updated modals with new UI components, dynamic fee estimation, and improved layout and functionality.
web-ui/components/Assets/rewardsModal.tsx Introduced RewardsModal for displaying and bridging token rewards.
web-ui/components/Assets/unbondingTable.tsx Improved unbonding assets display logic.
web-ui/components/Governance/VoteModal.tsx Integrated dynamic fee estimation for transactions.
web-ui/components/Staking/... Added new hooks, updated fee estimation, and refetch logic. Enhanced UI components.
web-ui/components/react/... Styling adjustments and logic modifications for better user experience.
web-ui/hooks/... Adjusted handling of environment variables, endpoint configurations, and added new query functions.
web-ui/pages/... Modified control flow, data processing, and UI updates for assets and staking pages.
web-ui/utils/... Added and updated utility functions for number formatting and string processing.

"In the realm of code, where logic intertwines,
A rabbit hopped, leaving bugs behind.
With every leap, the UI refined,
🌟 Enhancements bloom, by design aligned.
Celebrate we do, this update signed,
By a rabbit, in code entwined."
🐰💻✨

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

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • 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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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 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/coderabbit-overrides.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

vercel bot commented Apr 2, 2024

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

Name Status Preview Comments Updated (UTC)
quicksilver ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 3, 2024 8:18am

@joe-bowman joe-bowman changed the base branch from web-ui/staging to main April 2, 2024 10:06
@joe-bowman joe-bowman mentioned this pull request Apr 2, 2024
2 tasks
chalabi2
chalabi2 previously approved these changes Apr 2, 2024
Copy link
Collaborator

@chalabi2 chalabi2 left a comment

Choose a reason for hiding this comment

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

vercel deployment succesful

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 25

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between db29fa1 and eb8f47c.
Files ignored due to path filters (1)
  • web-ui/package.json is excluded by !**/*.json
Files selected for processing (31)
  • web-ui/README.md (1 hunks)
  • web-ui/components/Assets/assetsGrid.tsx (5 hunks)
  • web-ui/components/Assets/intents.tsx (7 hunks)
  • web-ui/components/Assets/modals/qTokenDepositModal.tsx (5 hunks)
  • web-ui/components/Assets/modals/qTokenWithdrawlModal.tsx (6 hunks)
  • web-ui/components/Assets/modals/qckDepositModal.tsx (6 hunks)
  • web-ui/components/Assets/modals/qckWithdrawModal.tsx (6 hunks)
  • web-ui/components/Assets/modals/rewardsModal.tsx (1 hunks)
  • web-ui/components/Assets/modals/signalIntentProcess.tsx (2 hunks)
  • web-ui/components/Assets/portfolio.tsx (5 hunks)
  • web-ui/components/Assets/quickbox.tsx (3 hunks)
  • web-ui/components/Assets/rewardsClaim.tsx (3 hunks)
  • web-ui/components/Assets/unbondingTable.tsx (4 hunks)
  • web-ui/components/Governance/VoteModal.tsx (3 hunks)
  • web-ui/components/Staking/assetsAccordion.tsx (2 hunks)
  • web-ui/components/Staking/modals/revertSharesProcessModal.tsx (5 hunks)
  • web-ui/components/Staking/modals/stakingProcessModal.tsx (3 hunks)
  • web-ui/components/Staking/modals/transferProcessModal.tsx (6 hunks)
  • web-ui/components/Staking/networkSelectButton.tsx (1 hunks)
  • web-ui/components/Staking/stakingBox.tsx (11 hunks)
  • web-ui/components/react/accountControlModal.tsx (7 hunks)
  • web-ui/components/react/chain-dropdown.tsx (6 hunks)
  • web-ui/components/react/index.ts (1 hunks)
  • web-ui/components/wallet.tsx (3 hunks)
  • web-ui/hooks/useGrpcQueryClient.ts (2 hunks)
  • web-ui/hooks/useQueries.ts (15 hunks)
  • web-ui/pages/assets.tsx (6 hunks)
  • web-ui/pages/staking/[chainId]/[valoperAddress].tsx (1 hunks)
  • web-ui/pages/staking/index.tsx (3 hunks)
  • web-ui/utils/maths.ts (1 hunks)
  • web-ui/utils/string.ts (1 hunks)
Additional comments not posted (52)
web-ui/components/react/index.ts (1)

1-3: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-7]

The changes align with the PR objectives of cleaning up unused components. Ensure that any dependent code has been updated accordingly.

web-ui/README.md (1)

53-53: Complete the documentation for adding networks to enhance developer guidance.

web-ui/hooks/useGrpcQueryClient.ts (1)

1-1: Ensure that all environment variables used here are correctly set in your deployment configuration.

web-ui/components/wallet.tsx (1)

6-15: > 📝 NOTE

This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [1-1]

The removal of unused components and simplification of the component structure contribute to a cleaner and more maintainable codebase.

web-ui/components/Assets/quickbox.tsx (1)

52-99: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-96]

The integration of the RewardsModal component and the addition of the "Unwind" button enhance the component's functionality and user experience.

web-ui/components/Staking/networkSelectButton.tsx (1)

80-86: The addition of _active and _focus styles to the NetworkSelect component ensures consistent styling across different states, enhancing the user experience.

web-ui/components/Staking/assetsAccordion.tsx (1)

19-19: Ensure the address prop is validated or sanitized before use in queries or transactions to prevent potential security issues.

web-ui/pages/staking/index.tsx (1)

31-31: Validate or sanitize the address obtained from useChain before using it in downstream components or API calls.

web-ui/components/Assets/rewardsClaim.tsx (3)

58-58: Confirm the increase in the reward amount from '50' to '5000' aligns with the intended business logic and is not an error.


69-76: Ensure that the conditional logic for executing msgRevokeBad and msgGrant based on authData presence is intentional and correctly implemented.


107-107: Verify that setting proofType to an empty string is the intended behavior and does not impact the functionality negatively.

web-ui/components/Assets/portfolio.tsx (2)

10-10: Ensure the addition of the chainId field to PortfolioItemInterface is utilized appropriately in the component and aligns with the intended functionality.


46-52: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [49-62]

Validate the loading state logic to ensure it provides a smooth user experience and accurately reflects the loading status of portfolio data.

web-ui/components/react/chain-dropdown.tsx (1)

226-226: Confirm the change of the isClearable prop from true to false in the ChangeChainDropdown component aligns with the desired user experience and functionality.

web-ui/components/Staking/modals/revertSharesProcessModal.tsx (1)

152-152: Ensure that the estimateFee function's failure does not prevent the transaction from proceeding. Consider adding a fallback mechanism or user notification in case of fee estimation failure.

- const fee = await estimateFee(address, [msg])
+ let fee;
+ try {
+   fee = await estimateFee(address, [msg]);
+ } catch (error) {
+   console.error('Error estimating fee:', error);
+   // Fallback fee or user notification logic here
+   return;
+ }
web-ui/components/Assets/intents.tsx (2)

16-19: Ensure that the useCallback hook is utilized effectively for memoizing the handleScroll function to avoid unnecessary re-creations on component re-renders.


235-249: The implementation of the Fade component to indicate more content at the bottom is a good UX practice. Ensure that the Fade component's visibility is tested across different browsers for consistent behavior.

web-ui/components/Assets/modals/qTokenWithdrawlModal.tsx (3)

31-31: The integration of the useFeeEstimation hook for dynamic fee estimation in withdrawal transactions is a significant improvement. Ensure that error handling is implemented for the hook.


145-145: When using the estimateFee function, consider implementing a fallback mechanism or user notification in case of fee estimation failure to enhance the user experience.

- const fee = await estimateFee(qAddress ?? '', [msg]);
+ let fee;
+ try {
+   fee = await estimateFee(qAddress ?? '', [msg]);
+ } catch (error) {
+   console.error('Error estimating fee:', error);
+   // Fallback fee or user notification logic here
+   return;
+ }

193-193: The logic to prevent the user from entering an amount greater than the maximum is well-implemented. However, consider adding a visual indicator or tooltip to inform users when their input exceeds the maximum allowed amount.

web-ui/components/Assets/modals/qTokenDepositModal.tsx (3)

31-31: The use of the useFeeEstimation hook for dynamic fee estimation in deposit transactions is a positive change. Ensure that error handling is in place for the hook to manage potential failures gracefully.


146-146: Implement a fallback mechanism or user notification for the estimateFee function's failure to ensure the transaction can proceed or the user is informed appropriately.

- const fee = await estimateFee(address ?? '', [msg]);
+ let fee;
+ try {
+   fee = await estimateFee(address ?? '', [msg]);
+ } catch (error) {
+   console.error('Error estimating fee:', error);
+   // Fallback fee or user notification logic here
+   return;
+ }

194-194: The logic to limit the user's input to the maximum amount is correctly implemented. Consider adding feedback for users when their input exceeds the maximum to improve the user experience.

web-ui/components/Assets/unbondingTable.tsx (2)

30-30: The simplification of the formatDenom function to directly use formatQasset is a good improvement for code readability and maintainability.


65-65: Filtering unbondingData to only include entries relevant to the user's address is a crucial step for displaying accurate information. Ensure that this filtering logic is thoroughly tested to confirm its correctness.

web-ui/pages/assets.tsx (3)

13-22: Consider using a custom hook to encapsulate multiple related queries.

To improve code readability and maintainability, consider encapsulating the multiple query hooks (useAPYQuery, useAPYsQuery, useLiquidRewardsQuery, etc.) into a single custom hook. This approach can simplify the component logic and make it easier to manage the state and lifecycle of related data fetching operations.


50-53: Ensure error handling for the refetchAll function.

Given the critical nature of refetching data, verify that appropriate error handling is implemented for the refetchAll function to ensure the application's resilience against network or query failures.


152-175: Refactor the assetsData calculation to improve readability.

Consider refactoring the assetsData calculation to improve code readability. Extracting parts of the logic into separate functions or using more descriptive variable names can make the code easier to understand and maintain.

web-ui/components/Assets/assetsGrid.tsx (2)

28-40: Ensure the liquidRewards prop is properly documented.

Given the addition of the liquidRewards prop to AssetCardProps, ensure that this prop is properly documented, including its type and usage, to facilitate understanding and maintenance by other developers.


162-376: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [287-413]

Refactor the AssetsGrid component to improve readability.

The AssetsGrid component's rendering logic, especially the conditional rendering and mapping over assets, could be refactored for better readability. Consider extracting parts of the JSX into smaller, reusable components or using more descriptive variable names.

web-ui/components/Assets/modals/signalIntentProcess.tsx (2)

28-28: Ensure the useFeeEstimation hook is properly utilized.

The integration of the useFeeEstimation hook for dynamic fee calculation in the SignalIntentModal component is a significant improvement, enhancing the accuracy of transaction cost estimations.


189-189: Validate the fee estimation logic with real transaction data.

Given the critical nature of fee estimation for transactions, verify that the estimateFee logic is validated with real transaction data to ensure accuracy and prevent potential issues during transaction submission.

web-ui/components/Staking/modals/stakingProcessModal.tsx (4)

85-85: Add PropTypes or TypeScript interfaces for new props to ensure type safety.

For maintainability and to prevent bugs, it's a good practice to define types for all props in a React component. This helps in catching type-related errors during development. Since refetch is a new prop, its type should be defined.


276-276: Ensure the useFeeEstimation hook is used correctly and efficiently.

Given the dynamic nature of fee estimation, it's crucial to verify that the useFeeEstimation hook is used in a way that doesn't lead to unnecessary re-renders or performance issues. Consider checking if the hook's dependencies are optimized and if its usage aligns with the expected behavior in the UI.


284-284: Validate the error handling for the estimateFee async call.

Asynchronous calls can fail for various reasons, such as network issues or server errors. It's important to ensure that there's proper error handling for the estimateFee call. This could include try-catch blocks, error state management, and user-friendly error messages.


291-291: Confirm that the refetch function is called at the appropriate time.

The refetch function is called upon the successful completion of a transaction. It's important to verify that this is the correct behavior in the context of the application. Consider whether there are any edge cases where refetch should be called under different conditions or if there are any potential side effects.

web-ui/pages/staking/[chainId]/[valoperAddress].tsx (1)

697-697: Ensure the padding adjustment aligns with the design requirements.

Changing the padding from mt={-8} to pt={2} alters the spacing above the HStack component. It's important to verify that this adjustment meets the design requirements and does not negatively impact the layout or user experience of the staking/unstaking interface.

web-ui/hooks/useQueries.ts (9)

6-6: Ensure that the imported QueryAllBalancesResponse type is used appropriately in the new functions.


83-87: Rename proof_ops to proofOps and proof_type to proofTypes for consistency with JavaScript naming conventions.


71-71: Adding refetch functions to various query return types is a good practice for enabling manual query refreshes.

Also applies to: 151-151, 281-281, 367-367, 487-487, 1010-1010


117-119: Initialization of skipClient with SKIP_API_URL is correctly implemented.


117-119: Ensure that SKIP_API_URL is correctly configured in the environment or configuration files.


117-119: Consider adding error handling for the skipClient initialization to gracefully handle potential issues with the API URL or network connectivity.


642-653: The implementation of fetchAPYs to fetch APYs for multiple chains is a useful addition. Ensure that the API endpoint used returns the expected data format.


1014-1038: The useSkipAssets hook for querying assets using skipClient is a valuable addition. Verify that the chainId parameter is correctly passed and handled by the skipClient.assets method.


1040-1061: The useRecommendations hook for fetching asset recommendations is well-implemented. Ensure that the skipClient.recommendAssets method correctly handles the input parameters and returns the expected response format.

web-ui/components/Staking/stakingBox.tsx (6)

41-41: Consider memoizing the useFeeEstimation hook's return value.

To ensure optimal performance, especially in components with frequent re-renders, consider memoizing the return value of useFeeEstimation using useMemo if the estimated fee calculation is expensive or if it depends on inputs that change infrequently.


172-172: Memoize the estimateFee function to avoid unnecessary recalculations.

Given that estimateFee is derived from a custom hook and might be computationally expensive, consider memoizing its result with useMemo to prevent unnecessary recalculations, especially if it's used in a context where its dependencies change infrequently.


211-211: Verify the error handling strategy for useNativeStakeQuery.

Ensure that the UI gracefully handles errors from useNativeStakeQuery. Consider displaying an error message or providing a retry mechanism if delegationsIsError is true.


571-571: Ensure refetch in StakingProcessModal is properly utilized.

Confirm that the refetch prop passed to StakingProcessModal is used effectively within the modal to trigger necessary data refetching operations upon successful transactions or other relevant events.


706-706: Validate the use of refetchDelegations in TransferProcessModal.

Ensure that refetchDelegations is correctly implemented within TransferProcessModal to update the delegation data after a successful transfer operation, enhancing data accuracy and user experience.


716-716: Check the implementation of refetchDelegations in RevertSharesProcessModal.

Double-check that refetchDelegations is effectively used in RevertSharesProcessModal to refresh delegation information post-reversion, ensuring the UI reflects the most current state.

web-ui/hooks/useQueries.ts Show resolved Hide resolved
web-ui/components/Staking/stakingBox.tsx Show resolved Hide resolved
web-ui/components/Staking/stakingBox.tsx Show resolved Hide resolved
web-ui/pages/assets.tsx Outdated Show resolved Hide resolved
web-ui/pages/assets.tsx Outdated Show resolved Hide resolved
web-ui/pages/assets.tsx Show resolved Hide resolved
web-ui/components/Assets/assetsGrid.tsx Show resolved Hide resolved
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.60%. Comparing base (db29fa1) to head (4c99211).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1374   +/-   ##
=======================================
  Coverage   63.60%   63.60%           
=======================================
  Files         171      171           
  Lines       11652    11652           
=======================================
  Hits         7411     7411           
  Misses       3497     3497           
  Partials      744      744           
Flag Coverage Δ
unittests 63.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between eb8f47c and 24a6536.
Files ignored due to path filters (1)
  • web-ui/package.json is excluded by !**/*.json
Files selected for processing (1)
  • web-ui/pages/_app.tsx (3 hunks)

web-ui/pages/_app.tsx Show resolved Hide resolved
web-ui/pages/_app.tsx Show resolved Hide resolved
web-ui/pages/assets.tsx Dismissed Show dismissed Hide dismissed
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 24a6536 and d8fe105.
Files selected for processing (1)
  • web-ui/pages/assets.tsx (6 hunks)
Additional comments not posted (1)
web-ui/pages/assets.tsx (1)

250-250: Verify the consistent application of responsive design styling across components.

Ensure that the responsive design styling, particularly the width properties, is consistently applied across components to maintain a uniform user experience on different devices.

web-ui/pages/assets.tsx Show resolved Hide resolved
web-ui/pages/assets.tsx Show resolved Hide resolved
web-ui/pages/assets.tsx Show resolved Hide resolved
web-ui/pages/assets.tsx Show resolved Hide resolved
@joe-bowman
Copy link
Contributor Author

This pull request has been deployed to Vercel.

Latest commit: 4c99211
✅ Preview: https://pr-1374.app-dev.quicksilver.zone
🔍 Inspect: https://vercel.com/quicksilver/quicksilver/HTptkqo6ouQFGVyRTfAqDKyTfAim

View Workflow Logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between d8fe105 and 4c99211.
Files ignored due to path filters (1)
  • web-ui/package.json is excluded by !**/*.json
Files selected for processing (7)
  • web-ui/components/Assets/modals/rewardsModal.tsx (1 hunks)
  • web-ui/components/Assets/portfolio.tsx (5 hunks)
  • web-ui/components/Assets/rewardsClaim.tsx (4 hunks)
  • web-ui/components/Assets/unbondingTable.tsx (2 hunks)
  • web-ui/hooks/useQueries.ts (16 hunks)
  • web-ui/hooks/useSkipExecute.ts (1 hunks)
  • web-ui/pages/assets.tsx (7 hunks)
Files skipped from review as they are similar to previous changes (2)
  • web-ui/components/Assets/modals/rewardsModal.tsx
  • web-ui/components/Assets/unbondingTable.tsx
Additional comments not posted (16)
web-ui/hooks/useSkipExecute.ts (2)

14-14: Consider adding type definitions for the route and userAddresses parameters to improve type safety.


77-77: Consider adding type definitions for the route parameter to improve type safety in useSkipMessages.

web-ui/components/Assets/portfolio.tsx (2)

10-10: The addition of the chainId field in PortfolioItemInterface supports enhanced functionality for handling assets across different chains.


80-169: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [49-123]

The adjustments to the rendering logic, including the use of SkeletonText for loading states and the restructuring of the portfolio display, contribute to a better user experience.

web-ui/components/Assets/rewardsClaim.tsx (3)

63-63: The increase in the reward amount from '50' to '1000000' reflects a significant change likely based on business or functional requirements.


72-85: The modifications to the transaction logic, including calls to both msgRevokeBad and msgGrant with separate fees, enhance the flexibility and robustness of transaction handling.


96-112: The addition of the transformProofs function supports new or updated transaction requirements by transforming proofs for submission.

web-ui/pages/assets.tsx (3)

13-22: The addition of new data querying hooks is necessary for fetching the required data for the assets page, including token prices, balances, APYs, redemption rates, and liquid rewards.


80-108: The restructuring of data processing functions, including the creation of portfolioItems and assetsData arrays using useMemo, contributes to more effective handling of the new data and optimized performance.


111-125: The updates to portfolio calculations and the display of asset information, including calculations for total portfolio value, average APY, and total yearly yield, enhance the functionality and user experience of the assets page.

web-ui/hooks/useQueries.ts (6)

152-152: Add a comment explaining the purpose of refetchBalance and under what circumstances it should be used. This will help future developers understand its intended use case.


215-215: Consider adding a brief comment explaining the purpose of authRefetch for clarity and maintainability.


283-283: Ensure that the refetch method is documented, explaining when and why it might be necessary to manually trigger a refetch of all balances.


644-655: Consider caching the results of fetchAPYs to improve performance, especially if this data does not change frequently. You can adjust the staleTime or use a more sophisticated caching strategy.


1017-1039: Ensure that the results from useSkipAssets are cached appropriately to avoid unnecessary network requests. Consider documenting the expected structure of the assets for better maintainability.


1042-1063: Consider adding error handling logic within the queryFn of useSkipReccomendedRoutes and useSkipRoutesData to gracefully handle any issues that may arise during the data fetching process.

web-ui/hooks/useQueries.ts Show resolved Hide resolved
web-ui/components/Assets/modals/rewardsModal.tsx Dismissed Show dismissed Hide dismissed
web-ui/components/Assets/modals/rewardsModal.tsx Dismissed Show dismissed Hide dismissed
web-ui/pages/assets.tsx Dismissed Show dismissed Hide dismissed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants