Skip to content

Nftlinks currency#2013

Merged
simo6529 merged 3 commits intomainfrom
nftlinks-currency
Feb 27, 2026
Merged

Nftlinks currency#2013
simo6529 merged 3 commits intomainfrom
nftlinks-currency

Conversation

@simo6529
Copy link
Copy Markdown
Collaborator

@simo6529 simo6529 commented Feb 27, 2026

Summary by CodeRabbit

  • New Features
    • Marketplace item previews now display price currency (ETH, USDC, etc.) separately from price values, improving clarity when viewing marketplace items.
    • Enhanced price parsing and normalization to properly handle currency tokens and prevent duplication in displayed prices.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 27, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f2699b7 and 68533e3.

📒 Files selected for processing (20)
  • __tests__/components/waves/MarketplaceItemPreviewCard.test.tsx
  • __tests__/components/waves/marketplace/MarketplaceManifoldListingPreview.test.tsx
  • __tests__/components/waves/marketplace/MarketplaceOpenseaAssetPreview.test.tsx
  • __tests__/components/waves/marketplace/common.test.ts
  • __tests__/components/waves/marketplace/useMarketplacePreviewState.test.tsx
  • __tests__/services/websocket/MarketplacePreviewWebSocketSync.test.tsx
  • components/waves/MarketplaceItemPreviewCard.tsx
  • components/waves/marketplace/MarketplaceCompactCta.tsx
  • components/waves/marketplace/MarketplaceFoundationMintPreview.tsx
  • components/waves/marketplace/MarketplaceFullFooter.tsx
  • components/waves/marketplace/MarketplaceItemPreviewCard.types.ts
  • components/waves/marketplace/MarketplaceManifoldListingPreview.tsx
  • components/waves/marketplace/MarketplaceOpenseaAssetPreview.tsx
  • components/waves/marketplace/MarketplaceOpenseaItemPreview.tsx
  • components/waves/marketplace/MarketplaceSuperrareArtworkPreview.tsx
  • components/waves/marketplace/MarketplaceTransientMintPreview.tsx
  • components/waves/marketplace/MarketplaceTransientNftPreview.tsx
  • components/waves/marketplace/common.ts
  • components/waves/marketplace/useMarketplacePreviewState.ts
  • helpers/Types.tsx

📝 Walkthrough

Walkthrough

The changes introduce a new priceCurrency field throughout the marketplace preview system, enabling separate handling of price values and currency denominations. This includes type definitions, state management, component props, and corresponding test updates to propagate currency data from API responses through preview components.

Changes

Cohort / File(s) Summary
Test Fixtures & Expectations
__tests__/components/waves/MarketplaceItemPreviewCard.test.tsx, __tests__/components/waves/marketplace/common.test.ts, __tests__/components/waves/marketplace/useMarketplacePreviewState.test.tsx, __tests__/components/waves/marketplace/MarketplaceManifoldListingPreview.test.tsx, __tests__/components/waves/marketplace/MarketplaceOpenseaAssetPreview.test.tsx, __tests__/services/websocket/MarketplacePreviewWebSocketSync.test.tsx
Updated test data and assertions to include price_currency (API) and priceCurrency (UI) fields; added new test for stripping trailing currency tokens from prices; updated aria-labels and expected rendered output to reflect split price/currency display.
Core Preview Component & Props
components/waves/MarketplaceItemPreviewCard.tsx, components/waves/marketplace/MarketplaceItemPreviewCard.types.ts
Added priceCurrency prop; introduced buildDisplayPriceParts() and normalizeSpaceSeparatedText() helpers to split price strings from currency, strip redundant tokens, and build aria-friendly labels; replaced single normalized price with separate priceValueText and priceCurrencyText.
Child Component Updates
components/waves/marketplace/MarketplaceCompactCta.tsx, components/waves/marketplace/MarketplaceFullFooter.tsx
Replaced normalizedPrice prop with priceValueText and added optional priceCurrencyText; updated rendering to display price and currency as separate elements; renamed price test ID from manifold-item-price to marketplace-item-price.
Marketplace Preview Implementations
components/waves/marketplace/MarketplaceManifoldListingPreview.tsx, components/waves/marketplace/MarketplaceOpenseaAssetPreview.tsx, components/waves/marketplace/MarketplaceOpenseaItemPreview.tsx, components/waves/marketplace/MarketplaceFoundationMintPreview.tsx, components/waves/marketplace/MarketplaceSuperrareArtworkPreview.tsx, components/waves/marketplace/MarketplaceTransientMintPreview.tsx, components/waves/marketplace/MarketplaceTransientNftPreview.tsx
Each component now passes priceCurrency={state.resolvedPriceCurrency} to MarketplaceItemPreviewCard, wiring the resolved currency from state to the preview card.
State Management & Type Definitions
components/waves/marketplace/common.ts, components/waves/marketplace/useMarketplacePreviewState.ts, helpers/Types.tsx
Added priceCurrency field to MarketplacePreviewData; added resolvedPriceCurrency to MarketplacePreviewState success variant; introduced parsing/propagation logic in fromNftLink(), mergeSeededMarketplacePreviewData(), and patchFromMediaLinkUpdate(); added price_currency to WsMediaLinkUpdatedData type.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • currency for nftlinks #1996 — The changes directly implement currency field propagation for NFT links from API through preview state and components, matching the "currency for nftlinks" requirement.

Possibly related PRs

  • Curation wave impro #1938 — Introduces foundational marketplace preview components and types that these changes extend by adding price currency handling and splitting price/currency display logic.

Suggested reviewers

  • ragnep

Poem

🐰✨ A rabbit's ode to currency clear
Price and coin now split without fear,
Through state and props the numbers flow,
From API depths to UI's glow,
ETH and USDC stand apart so bright,
The marketplace preview shines just right! 🎉

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch nftlinks-currency

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread components/waves/marketplace/MarketplaceCompactCta.tsx Outdated
prxt6529
prxt6529 previously approved these changes Feb 27, 2026
GelatoGenesis
GelatoGenesis previously approved these changes Feb 27, 2026
Signed-off-by: Simo <simo@6529.io>
@simo6529 simo6529 dismissed stale reviews from GelatoGenesis and prxt6529 via 68533e3 February 27, 2026 15:05
@simo6529 simo6529 merged commit 24c7879 into main Feb 27, 2026
5 of 6 checks passed
@simo6529 simo6529 deleted the nftlinks-currency branch February 27, 2026 15:06
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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