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

[draft] Mattupham/fe 785 portfolio recent withdrawals / deposits #3690

Draft
wants to merge 23 commits into
base: stage
Choose a base branch
from

Conversation

mattupham
Copy link
Contributor

What is the purpose of the change:

Linear Task

Brief Changelog

Testing and Verifying

Copy link

vercel bot commented Aug 7, 2024

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

Name Status Preview Comments Updated (UTC)
osmosis-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 9, 2024 3:18pm
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
osmosis-frontend-datadog ⬜️ Ignored (Inspect) Visit Preview Aug 9, 2024 3:18pm
osmosis-frontend-dev ⬜️ Ignored (Inspect) Visit Preview Aug 9, 2024 3:18pm
osmosis-frontend-edgenet ⬜️ Ignored (Inspect) Aug 9, 2024 3:18pm
osmosis-testnet ⬜️ Ignored (Inspect) Visit Preview Aug 9, 2024 3:18pm

@mattupham mattupham marked this pull request as draft August 7, 2024 07:10
Copy link
Contributor

coderabbitai bot commented Aug 7, 2024

Walkthrough

The recent changes enhance the usability and flexibility of several components within the web application. Notably, the LinkButton component now supports customizable sizes and optional icons, improving user interface options. A new PortfolioPage component provides a comprehensive management interface for blockchain assets, while various transaction components were introduced to track user activity more effectively. These updates aim to streamline user interactions and improve overall experience within the application.

Changes

File(s) Change Summary
packages/web/components/buttons/link-button.tsx Introduced an optional size prop and modified the icon prop to be optional, enhancing button customization.
packages/web/components/complex/portfolio-page.tsx Introduced a portfolio management interface with hooks for asset management and transaction facilitation.
packages/web/components/complex/portfolio/portfolio-page.tsx Replaced RecentTransfers with RecentActivity, adjusted loading logic, and enhanced layout structure.
packages/web/components/transactions/recent-activity/recent-activity-transaction-row.tsx Introduced components for displaying transaction activities, defining transaction status and effects.
packages/web/components/transactions/recent-activity/recent-activity.tsx New component to display recent transaction activities, integrating loading states and data fetching functionalities.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PortfolioPage
    participant RecentActivity
    participant RecentActivityTransferRow

    User->>PortfolioPage: Open Portfolio
    PortfolioPage->>RecentActivity: Fetch Recent Transactions
    RecentActivity->>RecentActivityTransferRow: Display Transactions
    RecentActivity->>User: Show Recent Activity
Loading

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.
    • @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 Configuration 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/schema.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
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

Outside diff range, codebase verification and nitpick comments (4)
packages/web/components/transactions/recent-activity/recent-activity-transaction-row.tsx (2)

81-82: Ensure consistent class names.

The class names should be consistent with the project's naming conventions.

- className={classNames("-mx-4 flex justify-between gap-4 rounded-2xl p-2")}
+ className={classNames("mx-4 flex justify-between gap-4 rounded-2xl p-2")}

134-135: Ensure consistent class names.

The class names should be consistent with the project's naming conventions.

- className={classNames("-mx-4 flex justify-between gap-4 rounded-2xl p-2")}
+ className={classNames("mx-4 flex justify-between gap-4 rounded-2xl p-2")}
packages/web/components/complex/portfolio-page.tsx (2)

87-88: Ensure consistent class names.

The class names should be consistent with the project's naming conventions.

- className={classNames("-mx-4 flex justify-between gap-4 rounded-2xl p-2")}
+ className={classNames("mx-4 flex justify-between gap-4 rounded-2xl p-2")}

174-175: Ensure consistent class names.

The class names should be consistent with the project's naming conventions.

- className={classNames("-mx-4 flex justify-between gap-4 rounded-2xl p-2")}
+ className={classNames("mx-4 flex justify-between gap-4 rounded-2xl p-2")}
Tools
Biome

[error] 175-175: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

Comment on lines 109 to 110
{/* {!isTotalValueFetched ? ( */}
{true ? (
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the spinner's conditional rendering logic.

The hardcoded true condition causes the spinner to always display, which can mislead users about the loading state of data. Revert to the original condition.

-  {true ? (
+  {!isTotalValueFetched ? (
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{/* {!isTotalValueFetched ? ( */}
{true ? (
{/* {!isTotalValueFetched ? ( */}
{!isTotalValueFetched ? (
Tools
Biome

[error] 110-110: Unexpected constant condition.

(lint/correctness/noConstantCondition)

Comment on lines 120 to 196
export const RecentActivityTransactionRow: FunctionComponent<Transaction> = ({
status,
effect,
title,
caption,
tokenConversion,
transfer,
}) => {
const effectIconId = effect === "swap" ? "swap" : "down-arrow";

const { t } = useTranslation();

return (
<div
className={classNames("-mx-4 flex justify-between gap-4 rounded-2xl p-2")}
>
<div className="flex items-center gap-4 md:w-1/2 md:gap-2">
{status === "pending" ? (
<Spinner className="h-8 w-8 pb-4 text-wosmongton-500" />
) : (
<div className="flex h-12 w-12 items-center justify-center rounded-full bg-osmoverse-825 p-3">
{status === "success" ? (
effect === "withdraw" ? (
<Icon
className="rotate-180 transform"
id={effectIconId}
width="100%"
height="100%"
/>
) : (
<Icon id={effectIconId} width="100%" height="100%" />
)
) : (
<Icon
width="100%"
height="100%"
id="alert-circle"
color={theme.colors.rust[400]}
/>
)}
</div>
)}

<div>
<div className="flex flex-col">
<p className="subtitle1 text-osmoverse-100">{title[status]}</p>
{tokenConversion && (
<div className="caption flex gap-1 text-osmoverse-300">
{displayFiatPrice(tokenConversion.tokenIn?.value, "", t)}{" "}
{tokenConversion.tokenOut.amount.denom}{" "}
<Icon id="arrow-right" width={14} height={14} />{" "}
{tokenConversion.tokenIn.amount.denom}
</div>
)}
</div>
{tokenConversion && (
<div className="caption mt-1 hidden text-osmoverse-300 md:flex md:items-center">
{formatPretty(tokenConversion.tokenOut.amount, {
maxDecimals: 6,
})}
<Icon
id="arrow-right"
width={12}
height={12}
className="ml-1 inline-block"
/>
</div>
)}
</div>
</div>
{caption && <p className="body1 text-osmoverse-300">{caption}</p>}
{tokenConversion && (
<TokenConversion status={status} effect={effect} {...tokenConversion} />
)}
{transfer && <TokenTransfer status={status} {...transfer} />}
</div>
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Use optional chaining for better safety.

Use optional chaining to safely access properties.

- {status === "pending" ? (
+ {status?. === "pending" ? (

Committable suggestion was skipped due to low confidence.

@mattupham mattupham changed the title [draft] Mattupham/fe 785 portfolio recent transfers [draft] Mattupham/fe 785 portfolio recent withdrawals / deposits Aug 14, 2024
@MaxMillington
Copy link
Collaborator

@mattupham do we still need this or can it be deleted?

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