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: PFP Collection Page Design Updated #1090

Merged
merged 2 commits into from
Feb 28, 2025

Conversation

Luluameh
Copy link
Contributor

@Luluameh Luluameh commented Feb 28, 2025

Hello,
close: #977
I'm done with the changes
kindly review. Thank you :)

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enjoy a refreshed interface with dynamic tab navigation that streamlines the display of step-by-step content and associated NFT collections.
    • Experience improved modularity in rendering NFT collection cards based on selected tabs.
  • Style

    • Benefit from an enhanced responsive layout featuring a new grid display on mobile devices and refined tablet navigation styling for a consistently improved visual experience.
    • Visual enhancements include lighter font weights and new box-shadow effects for better aesthetics.

Copy link

vercel bot commented Feb 28, 2025

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

Name Status Preview Comments Updated (UTC)
app-starknet-id ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 28, 2025 8:01pm

Copy link

vercel bot commented Feb 28, 2025

@Luluameh is attempting to deploy a commit to the LFG Labs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Feb 28, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The changes refactor the PFPCollections component by introducing a new type definition for Collection and a dynamic tab configuration using a TABS array. The state variable for the current tab is renamed for clarity, and the rendering logic is encapsulated into two new functions: renderStep for generating step components and renderCollectionCards for displaying NFT collection cards. The CSS is updated to replace the old flex layout with a grid layout, enhancing responsiveness and clarity in media queries.

Changes

File(s) Change Summary
pages/pfpcollections.tsx Introduced new Collection type; defined TABS constant; renamed state variable from tab to currentTab; added renderStep and renderCollectionCards functions.
styles/pfpcollections.module.css Removed .nfts class; replaced with grid layout; adjusted mobile media query to max-width 765px; updated styles for .purchaseStepNav, .purchaseStepNavMobile, and .step.

Possibly related PRs

Suggested reviewers

  • Divineifed1

📜 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 f01e270 and 9c0bfe1.

📒 Files selected for processing (2)
  • pages/pfpcollections.tsx (2 hunks)
  • styles/pfpcollections.module.css (2 hunks)

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>, 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 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.

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 (4)
pages/pfpcollections.tsx (2)

8-24: Well-structured tab configuration with type improvement opportunity.

Creating a central TABS configuration is a good approach for maintainability. However, using any type for the collection parameter in onCardClick functions bypasses TypeScript's type checking benefits.

Consider defining a proper interface for the collection objects:

+ interface NftCollection {
+   infoPage?: string;
+   externalLink?: string;
+   imageUri: string;
+   name: string;
+   [key: string]: any; // For any additional properties
+ }

const TABS = [
  {
    index: 0,
    label: "Starknet ID Ecosystem",
    iconPrefix: "ecosystem",
    collections: ourNfts,
-   onCardClick: (collection: any) => window.open(collection.infoPage),
+   onCardClick: (collection: NftCollection) => window.open(collection.infoPage),
  },
  // ...

51-66: Good extraction of collection card rendering with minor syntax improvement.

The renderCollectionCards function effectively encapsulates the card rendering logic, improving modularity. However, there's an unnecessary string interpolation syntax.

  return (
-    <div className={'mx-auto flex flex-wrap gap-2 justify-center'}>
+    <div className="mx-auto flex flex-wrap gap-2 justify-center">
      {activeTab.collections.map((collection, index) => (
styles/pfpcollections.module.css (2)

52-81: Improved mobile styling with non-standard breakpoint.

The grid layout for NFT cards on mobile is a good improvement, but the breakpoint of 765px is unusual.

Consider using standard breakpoints (e.g., 768px for tablets) to maintain consistency with common design systems and frameworks like Tailwind CSS (which uses 768px as the "md" breakpoint):

- @media (max-width: 765px) {
+ @media (max-width: 767px) {

83-108: New tablet-specific styles with non-standard breakpoint.

Adding dedicated tablet styles improves the user experience on mid-sized devices, but the breakpoint choice is unconventional.

Consider adjusting the breakpoints to align with standard values:

- @media (min-width: 766px) and (max-width: 1279px) {
+ @media (min-width: 768px) and (max-width: 1279px) {

This would eliminate the 1px gap between your mobile and tablet media queries (current 765px and 766px).

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7a1c750 and f01e270.

📒 Files selected for processing (2)
  • pages/pfpcollections.tsx (2 hunks)
  • styles/pfpcollections.module.css (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Jest
🔇 Additional comments (6)
pages/pfpcollections.tsx (4)

27-28: Good state variable naming improvement.

Renaming from tab to currentTab improves readability and makes the code more self-documenting.


29-49: Excellent extraction of Step rendering logic.

The renderStep function encapsulates the logic for rendering a Step component, reducing code duplication. This approach improves maintainability and makes the code more modular.


69-69: Improved responsive container using Tailwind CSS.

The updated container class uses Tailwind's utility classes for responsive layout, ensuring better adaptability across different screen sizes.


92-96: Clean and consistent content section structure.

The content section now has a well-structured layout with appropriate max-width constraints and uses the new renderCollectionCards function for improved code organization.

styles/pfpcollections.module.css (2)

49-49: Consistent box-shadow application.

Moving the box-shadow property to the base .purchaseStepNavMobile class ensures consistent styling across all screen sizes.


110-133: Well-organized desktop styles with clear commenting.

Explicitly labeling the section as "Desktop styles" improves code readability and organization.

@Luluameh
Copy link
Contributor Author

Hello @Kevils
waiting for review

Copy link
Collaborator

@Marchand-Nicolas Marchand-Nicolas left a comment

Choose a reason for hiding this comment

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

Thanks! It's much cleaner with your changes! Really good work, LGTM

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.

PFP collection page - Overall Starknet Ecosystem
2 participants