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: transaction thumbnail component #3301

Merged
merged 10 commits into from
Dec 25, 2024

Conversation

magiziz
Copy link
Contributor

@magiziz magiziz commented Nov 21, 2024

Description

Added transaction thumbnail component

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-1510

Showcase (Optional)

Screenshot 2024-11-21 at 12 55 34 Screenshot 2024-11-21 at 12 55 03 Screenshot 2024-11-21 at 12 54 28 Screenshot 2024-11-21 at 12 52 27 Screenshot 2024-11-21 at 12 34 03

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

linear bot commented Nov 21, 2024

Copy link

vercel bot commented Nov 21, 2024

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

Name Status Preview Comments Updated (UTC)
appkit-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 25, 2024 4:39pm
appkit-gallery-new 🛑 Canceled (Inspect) Dec 25, 2024 4:39pm
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 25, 2024 4:39pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-vue-solana ⬜️ Ignored (Inspect) Visit Preview Dec 25, 2024 4:39pm
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Visit Preview Dec 25, 2024 4:39pm
vue-wagmi-example ⬜️ Ignored (Inspect) Visit Preview Dec 25, 2024 4:39pm

Copy link

changeset-bot bot commented Nov 21, 2024

⚠️ No Changeset found

Latest commit: 4c49931

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@magiziz magiziz changed the title Feat/transaction thumbnail component feat: transaction thumbnail Nov 21, 2024
@magiziz magiziz changed the title feat: transaction thumbnail feat: transaction thumbnail component Nov 21, 2024
Copy link
Contributor

github-actions bot commented Nov 21, 2024

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 335.71% 4838 / 23582
🔵 Statements 335.71% 4838 / 23582
🔵 Functions 368.84000000000003% 388 / 1434
🔵 Branches 475.71% 745 / 1727
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/ui-new/index.ts 0% 0% 0% 0%
packages/ui-new/src/assets/svg/arrow-bottom.ts 0% 0% 0% 0%
packages/ui-new/src/assets/svg/arrows-clock-wise.ts 0% 0% 0% 0%
packages/ui-new/src/assets/svg/coinPlaceholder.ts 0% 0% 0% 0%
packages/ui-new/src/assets/svg/dollar.ts 0% 0% 0% 0%
packages/ui-new/src/assets/svg/image.ts 0% 0% 0% 0%
packages/ui-new/src/assets/svg/question-mark.ts 0% 0% 0% 0%
packages/ui-new/src/components/wui-icon/index.ts 0% 0% 0% 0%
packages/ui-new/src/composites/wui-transaction-list-item/index.ts 0% 0% 0% 0%
packages/ui-new/src/composites/wui-transaction-list-item-loader/index.ts 0% 0% 0% 0%
packages/ui-new/src/composites/wui-transaction-thumbnail/index.ts 0% 0% 0% 0%
packages/ui-new/src/composites/wui-transaction-thumbnail/styles.ts 0% 0% 0% 0%
packages/ui-new/src/utils/JSXTypeUtil.ts 100% 100% 100% 100%
packages/ui-new/src/utils/ThemeConstantsUtil.ts 100% 100% 100% 100%
packages/ui-new/src/utils/TypeUtil.ts 0% 100% 100% 0%
Generated in workflow #7514 for commit 75925e5 by the Vitest Coverage Report Action

@@ -2,7 +2,7 @@ import { html, LitElement } from 'lit'
import { customElement } from '../../utils/WebComponentsUtil.js'
import { resetStyles } from '../../utils/ThemeUtil.js'
import '../../components/wui-text/index.js'
import '../wui-transaction-visual/index.js'
import '../wui-transaction-thumbnail/index.js'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Imported it like this so it doesn't throw ts error

Comment on lines 306 to 312
export const transactionThumbnailOptions: TransactionThumbnailType[] = [
'token',
'nft',
'swap',
'fiat',
'unknown'
]
Copy link
Contributor

Choose a reason for hiding this comment

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

The previous values are coming from the possible values of Zerion API, so we might want to keep the same array because we don't control this value manually on parent component

@@ -245,6 +248,10 @@ export type ButtonVariant =
export type ButtonShortcutVariant = 'accent' | 'secondary'
export type ButtonLinkVariant = 'accent' | 'secondary'

export type TransactionThumbnailType = TransactionType | 'fiat' | 'unknown' | 'nft'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I included both TransactionType and 'fiat' | 'unknown' | 'nft' in case we need it

export const spacing = {
'0.5': '2px',
'01': '2px',
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not 0.5?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CSS variables cannot have decimals, so something like --apkt-spacing-0.5 will break

Copy link
Collaborator

@lukaisailovic lukaisailovic left a comment

Choose a reason for hiding this comment

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

@magiziz Can we add tests and merge?

@magiziz
Copy link
Contributor Author

magiziz commented Dec 3, 2024

@magiziz Can we add tests and merge?

I'll mark this PR as draft since we need to re-design this component a bit.

@magiziz magiziz marked this pull request as draft December 3, 2024 18:16
@magiziz magiziz marked this pull request as ready for review December 23, 2024 15:25
Copy link
Contributor

github-actions bot commented Dec 23, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 63.15% 17626 / 27911
🔵 Statements 63.15% 17626 / 27911
🔵 Functions 53.19% 1498 / 2816
🔵 Branches 77.9% 2806 / 3602
File CoverageNo changed files found.
Generated in workflow #8444 for commit 4c49931 by the Vitest Coverage Report Action

@magiziz magiziz merged commit bd64718 into main Dec 25, 2024
19 checks passed
@magiziz magiziz deleted the feat/transaction-thumbnail-component branch December 25, 2024 18:13
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.

3 participants