Skip to content

Designs changes in new token tiles#293

Merged
RanaBug merged 2 commits intostagingfrom
feat/PRO-3225/new-token-tiles
Apr 29, 2025
Merged

Designs changes in new token tiles#293
RanaBug merged 2 commits intostagingfrom
feat/PRO-3225/new-token-tiles

Conversation

@RanaBug
Copy link
Collaborator

@RanaBug RanaBug commented Apr 29, 2025

Description

  • Formatted price when too many zero in decimals
  • "Copied" pops up when copy token address
  • Token "age" now showing on mobile
  • Fix spacing between tokens
  • Slight increase of blockchain icon size

How Has This Been Tested?

  • Unit tests and manual testing

Screenshots (if appropriate):

Types of changes

  • 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 change)

Summary by CodeRabbit

  • New Features

    • Introduced a new component for displaying numbers with high decimal precision, visually emphasizing multiple leading zeros in the decimal part.
  • Style

    • Improved consistency and clarity of font weights and text sizing across market data rows.
    • Adjusted spacing and alignment for token logos and layout containers.
    • Refined responsive spacing and visibility for market data elements.
  • Refactor

    • Replaced standard price display with the new high-decimal formatting component for enhanced readability.

@RanaBug RanaBug requested a review from IAmKio April 29, 2025 16:42
@RanaBug RanaBug self-assigned this Apr 29, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 29, 2025

Walkthrough

A new React component, HighDecimalsFormatted, has been introduced to format numbers with special handling for multiple leading zeros in the decimal part. This component is now used in the RightColumnTokenMarketDataRow to display prices with enhanced formatting. Several components across the token market data row and related tiles have had their styling and class names updated, focusing on text weight consistency, spacing, and responsive design. No changes were made to the logic or signatures of existing exported entities, except for the addition of the new component.

Changes

File(s) Change Summary
src/apps/pillarx-app/components/HighDecimalsFormatted/HighDecimalsFormatted.tsx Added a new HighDecimalsFormatted React component for displaying numbers with special formatting for multiple leading zeros in the decimal part. Exports the component as default.
src/apps/pillarx-app/components/TokenMarketDataRow/RightColumnTokenMarketDataRow.tsx Replaced the price display with the new HighDecimalsFormatted component, passing styling props for number and zeros. Updated percentage and transaction count text to use consistent font-normal styling.
src/apps/pillarx-app/components/TokenMarketDataRow/LeftColumnTokenMarketDataRow.tsx Updated styling: changed spacing classes to horizontal gaps, unified text styling to font-normal, removed device-specific text size classes, and adjusted responsive visibility for timestamp and volume text.
src/apps/pillarx-app/components/TokenMarketDataRow/TokenLogoMarketDataRow.tsx Adjusted container margin, resized blockchain logo overlay, and updated its translation transform for improved spacing and positioning. No logic changes.
src/apps/pillarx-app/components/TileTitle/TileTitle.tsx Removed the explicit font-normal class from the Body component rendering the title. No logic changes.
src/apps/pillarx-app/components/TokensWithMarketDataTile/TokensWithMarketDataTile.tsx Removed vertical spacing classes (gap-4, desktop:gap-y-4) from mobile and desktop containers, altering the layout’s vertical spacing. No logic changes.

Sequence Diagram(s)

sequenceDiagram
    participant ParentComponent
    participant RightColumnTokenMarketDataRow
    participant HighDecimalsFormatted

    ParentComponent->>RightColumnTokenMarketDataRow: Render with price value
    RightColumnTokenMarketDataRow->>HighDecimalsFormatted: Render with value, moneySymbol, styles
    HighDecimalsFormatted-->>RightColumnTokenMarketDataRow: Formatted price JSX
    RightColumnTokenMarketDataRow-->>ParentComponent: Rendered output with formatted price
Loading

Possibly related PRs

  • feat/PRO-3225/new-token-tiles #290: Introduced the RightColumnTokenMarketDataRow component, which is now updated in this PR to use the new HighDecimalsFormatted component for price display.

Poem

In the garden of decimals, zeros line up in a row,
A new component hops in, putting on a dazzling show.
Prices now sparkle, formatted with care,
While market data tiles breathe a tidier air.
With styles unified and layouts refined,
This bunny’s code leaves no zero behind!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e04dd0 and 547e9da.

⛔ Files ignored due to path filters (3)
  • src/apps/pillarx-app/components/PointsTile/test/__snapshots__/PointsTile.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pillarx-app/components/TokenMarketDataRow/tests/__snapshots__/LeftColumnTokenMarketDataRow.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pillarx-app/components/TokensWithMarketDataTile/test/__snapshots__/TokensWithMarketDataTile.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • src/apps/pillarx-app/components/TokenMarketDataRow/LeftColumnTokenMarketDataRow.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/apps/pillarx-app/components/TokenMarketDataRow/LeftColumnTokenMarketDataRow.tsx
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: unit-tests
  • GitHub Check: build
  • GitHub Check: Cloudflare Pages
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Apr 29, 2025

Deploying x with  Cloudflare Pages  Cloudflare Pages

Latest commit: 547e9da
Status: ✅  Deploy successful!
Preview URL: https://71663a79.x-e62.pages.dev
Branch Preview URL: https://feat-pro-3225-new-token-tile.x-e62.pages.dev

View 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: 0

🧹 Nitpick comments (1)
src/apps/pillarx-app/components/HighDecimalsFormatted/HighDecimalsFormatted.tsx (1)

13-38: Good implementation of the specialized number formatting logic

The formatNumber function handles the leading zeros in decimals well, with clear logic to identify and format numbers with 2+ leading zeros differently. This addresses the PR objective of "formatting the price display to handle cases with many zeros in the decimal part".

Consider adding a test case to verify behavior with negative numbers, as they would be handled implicitly by this implementation.

You might want to add a brief comment explaining why 2 is the threshold for special formatting:

 if (zeroCount < 2) {
+  // Use standard formatting for numbers with fewer than 2 leading zeros
   return num.toString();
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a46c2ac and 5e04dd0.

⛔ Files ignored due to path filters (5)
  • src/apps/pillarx-app/components/MediaGridCollection/tests/__snapshots__/DisplayCollectionImage.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pillarx-app/components/PointsTile/test/__snapshots__/PointsTile.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pillarx-app/components/TokenMarketDataRow/tests/__snapshots__/LeftColumnTokenMarketDataRow.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pillarx-app/components/TokenMarketDataRow/tests/__snapshots__/RightColumnTokenMarketDataRow.test.tsx.snap is excluded by !**/*.snap
  • src/apps/pillarx-app/components/TokensWithMarketDataTile/test/__snapshots__/TokensWithMarketDataTile.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (6)
  • src/apps/pillarx-app/components/HighDecimalsFormatted/HighDecimalsFormatted.tsx (1 hunks)
  • src/apps/pillarx-app/components/TileTitle/TileTitle.tsx (1 hunks)
  • src/apps/pillarx-app/components/TokenMarketDataRow/LeftColumnTokenMarketDataRow.tsx (1 hunks)
  • src/apps/pillarx-app/components/TokenMarketDataRow/RightColumnTokenMarketDataRow.tsx (3 hunks)
  • src/apps/pillarx-app/components/TokenMarketDataRow/TokenLogoMarketDataRow.tsx (2 hunks)
  • src/apps/pillarx-app/components/TokensWithMarketDataTile/TokensWithMarketDataTile.tsx (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: lint
  • GitHub Check: unit-tests
  • GitHub Check: build
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (15)
src/apps/pillarx-app/components/HighDecimalsFormatted/HighDecimalsFormatted.tsx (2)

1-6: Well-structured props interface for number formatting component

Your props definition is clean and properly typed, with good use of optional properties where appropriate.


40-46: Clean component implementation

The component wrapping and rendering logic is straightforward and effective. Good use of className prop passing for styling flexibility.

src/apps/pillarx-app/components/TileTitle/TileTitle.tsx (1)

29-29: Consistent typography styling

Removing the explicit font-normal class aligns with the broader styling consistency updates in the PR, where typography weight is managed at a higher level.

src/apps/pillarx-app/components/TokensWithMarketDataTile/TokensWithMarketDataTile.tsx (2)

42-42: Improved mobile layout spacing

Removing the gap-4 class adjusts the vertical spacing between token rows in mobile view, addressing the PR objective of "fixing spacing between tokens".


55-55: Refined desktop grid layout

Removing the desktop:gap-y-4 class creates more consistent vertical spacing in the desktop grid. This change, combined with the mobile spacing adjustment, ensures uniform token spacing across device sizes.

src/apps/pillarx-app/components/TokenMarketDataRow/TokenLogoMarketDataRow.tsx (2)

21-21: Improved component spacing

Adding the mr-2 class creates consistent spacing between the token logo and adjacent content, which aligns with the PR objective of "fixing spacing between tokens".


45-45: Enhanced blockchain logo presentation

The changes to the blockchain logo implementation improve the UI in two ways:

  1. Using explicit pixel dimensions (18px/14px) instead of relative sizes provides more precise control over the blockchain icon size
  2. Simplifying the transform to only horizontal translation (30%) creates a cleaner overlay positioning

These changes align with the PR objective of "slightly increasing the size of the blockchain icon".

src/apps/pillarx-app/components/TokenMarketDataRow/RightColumnTokenMarketDataRow.tsx (4)

7-7: Good addition of the HighDecimalsFormatted component.

This new import aligns with the PR objective to improve the formatting of prices with many zeros in the decimal part.


23-28: Excellent implementation of high decimal formatting.

The implementation uses the new HighDecimalsFormatted component to improve the display of price values, especially those with many leading zeros. The styling props are well-defined with appropriate responsive classes and conditional styling based on price direction.


49-49: Consistent font weight styling applied.

Adding font-normal ensures consistent font weight styling across the component.


56-56: Font weight consistency improved.

The addition of font-normal to this BodySmall component maintains styling consistency with other typography elements.

src/apps/pillarx-app/components/TokenMarketDataRow/LeftColumnTokenMarketDataRow.tsx (4)

67-67: Improved horizontal spacing.

Changed from a general gap to more specific horizontal gaps (gap-x-2 and mobile:gap-x-1.5), providing better control over the spacing between elements.


69-69: Enhanced mobile experience for token age display.

The timestamp (token age) is now visible on mobile devices by removing the mobile:hidden class. This directly implements the PR objective to "display the token age on mobile devices."


72-72: Consistent font styling applied.

Added font-normal to maintain consistent font weight across typography elements.


78-78: Consistent typography styling.

Added font-normal for consistent font weight across all text elements in the component.

@github-actions github-actions bot temporarily deployed to Preview (feat/PRO-3225/new-token-tiles) April 29, 2025 17:07 Inactive
Copy link
Collaborator

@IAmKio IAmKio left a comment

Choose a reason for hiding this comment

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

LGTM

@RanaBug RanaBug merged commit 47e6dfb into staging Apr 29, 2025
7 checks passed
@coderabbitai coderabbitai bot mentioned this pull request May 1, 2025
3 tasks
@coderabbitai coderabbitai bot mentioned this pull request Oct 14, 2025
3 tasks
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