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(ui): #2051: TransactionSummary #2083

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

VanishMax
Copy link
Contributor

@VanishMax VanishMax commented Feb 26, 2025

Closes #2051

An independent PR but only #2000 will allow applying this component to the DEX or other products.

Preview of the component: https://penumbra-ui-preview--pr2083-feat-2051-tx-summar-rkethfkg.web.app/?path=/docs/ui-library-transactionsummary--docs

Needs a follow up work to support the whole range of transaction types but I'd like to switch to other features. At least this component works well on Send/Receive/Swap transaction types and partially on the rest of them.

image image

@VanishMax VanishMax self-assigned this Feb 26, 2025
Copy link
Contributor

github-actions bot commented Feb 26, 2025

Visit the preview URL for this PR (updated for commit db3536d):

https://penumbra-ui-preview--pr2083-feat-2051-tx-summar-rkethfkg.web.app

(expires Fri, 07 Mar 2025 08:22:17 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 709d729610ef7a6369b23f1cb2b820a60cc685b1

@TalDerei TalDerei mentioned this pull request Feb 26, 2025
1 task
@VanishMax VanishMax requested a review from a team February 28, 2025 08:10
@VanishMax VanishMax marked this pull request as ready for review February 28, 2025 08:13
/**
* Takes a transaction view, finds the most relevant action that defines its type, and returns it.
*/
export const classifyTransaction = (txv?: TransactionView): ClassificationReturn => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

a powerful function, it was returning only a classified type of a transaction. I added the return of the most relevant action type given transaction

export interface AddressViewProps {
addressView: AddressView | undefined;
copyable?: boolean;
hideIcon?: boolean;
truncate?: boolean;
/** If true, takes the `altBech32m` field from the address and renders it as-is */
external?: boolean;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added support for AddressView component to render addresses from other blockchains like osmo1awefasdf...

Comment on lines +63 to +66
export const useClassification = (
info: TransactionInfo,
getMetadataByAssetId?: GetMetadataByAssetId,
) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the main data modeling logic is here - the hook prepares a transaction for rendering

@TalDerei TalDerei self-requested a review February 28, 2025 10:24
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.

Transaction Summary Component
1 participant