Skip to content

feat: peanut wallet landing page#684

Merged
kushagrasarathe merged 3 commits intopeanut-wallet-devfrom
feat/wallet-lp
Feb 12, 2025
Merged

feat: peanut wallet landing page#684
kushagrasarathe merged 3 commits intopeanut-wallet-devfrom
feat/wallet-lp

Conversation

@kushagrasarathe
Copy link
Copy Markdown
Contributor

@kushagrasarathe kushagrasarathe commented Feb 11, 2025

fixes TASK-8772

Summary by CodeRabbit

  • New Features

    • Updated landing page now emphasizes a waitlist and cashout experience with refreshed call-to-action buttons.
    • The animated marquee now supports multiple messages with customizable backgrounds.
    • Enhanced setup messaging highlights pre-launch rewards to incentivize signups.
    • Streamlined user authentication redirects authenticated users directly for a smoother experience.
  • Refactor

    • Simplified the overall page layout by removing extraneous sections, including footer links and header elements for a cleaner look.

@vercel
Copy link
Copy Markdown

vercel bot commented Feb 11, 2025

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

Name Status Preview Comments Updated (UTC)
peanut-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 12, 2025 10:47am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 11, 2025

Walkthrough

This pull request updates several key components and middleware logic. The LandingPage and Hero components are revised to remove unused sections and update properties, including replacing the single CTA with primary and secondary CTAs. Footer elements have been commented out and removed, while the Layout component is streamlined by removing the header and adjusting import order. Additional modifications include enhancing the Marquee component to accept multiple messages, refining the HomeWaitlist view, updating setup step descriptions, and revising middleware authentication redirection.

Changes

File(s) Change Summary
src/app/page.tsx Updated LandingPage: Removed components (BuildOnUs, Features, Mike, Story) and updated the hero and faqs objects (switched from cta to primaryCta/secondaryCta, adjusted FAQ content, disabled marquee).
src/.../Footer/consts.ts, src/.../Footer/index.tsx In Footer files: Commented out the 'gitbook' social link and disabled the code block that rendered external links, with comments explaining the temporary removal.
src/.../Layout/index.tsx Layout update: Removed the Header component, added FooterVisibilityObserver, reorganized and consolidated import statements, and adjusted hooks usage.
src/.../MarqueeWrapper/index.tsx Modified MarqueeComp: Changed message prop type from a string to `string
src/.../LandingPage/hero.tsx Updated Hero component: Introduced a new CTAButton type; replaced the cta property with distinct primaryCta and secondaryCta properties; refactored CTA rendering via a dedicated helper function.
src/.../Home/HomeWaitlist.tsx Removed the registration and login UI elements, thereby simplifying the user interface for the waitlist view.
src/.../Setup/Setup.consts.tsx Updated the first setup step's description to include additional call-to-action text and reward information for pre-launch sign-ups.
src/middleware.ts Revised middleware logic: Removed outdated preview redirects and introduced a JWT cookie check to redirect authenticated users from the root ('/') or setup ('/setup') paths to '/home', while retaining promo link and caching behavior.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant M as Middleware
    participant C as Cookie Storage
    U->>M: Request page (e.g., "/")
    M->>C: Check for JWT token
    alt Token Exists
        M->>U: Redirect to "/home"
    else No Token
        M->>U: Continue normal processing
    end
Loading
sequenceDiagram
    participant H as Hero Component
    participant R as renderCTAButton Function
    H->>R: Check for primaryCta and secondaryCta props
    alt primaryCta exists
        R->>H: Render primary CTA button
    end
    alt secondaryCta exists
        R->>H: Render secondary CTA button
    end
Loading

Possibly related PRs

  • fix: landing page, broken docs links #543: Addresses LandingPage component updates focusing on structural changes and FAQ modifications.
  • Develop #648: Involves modifications to the hero object, transitioning the CTA property into primary and secondary CTAs.
  • sync #544: Concerns similar LandingPage adjustments including component removal and hero object updates.

Suggested reviewers

  • Hugo0

Poem

I'm a hopper, a coding rabbit so spry,
Leaping through changes as the code runs by.
Out with the old, in with the new light,
Two CTAs shine, guiding day and night.
With middleware magic and a bounce so true—
Happy commits, dear devs, this one's for you!
🐇💻

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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. (Beta)
  • @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.

@notion-workspace
Copy link
Copy Markdown

Implement Landing Page

@kushagrasarathe kushagrasarathe marked this pull request as ready for review February 11, 2025 17:57
Copy link
Copy Markdown
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: 1

🧹 Nitpick comments (4)
src/components/Global/Footer/consts.ts (1)

14-14: Fix typo in comment and add more context.

The comment contains a typo ("fotter" instead of "footer") and could be more descriptive about the timeline for restoration.

-    // note: temporarily removed docs link from fotter, as it points to old docs
+    // note: temporarily removed docs link from footer until new documentation is ready (ETA: TBD)
src/middleware.ts (1)

17-19: Consider adding a comment explaining the setup page redirection.

While the logic is correct, adding a comment explaining why authenticated users are redirected from the setup page would improve code maintainability.

+    // Redirect authenticated users from setup page as they have already completed onboarding
     if (isAuthenticated && request.nextUrl.pathname === '/setup') {
         return NextResponse.redirect(new URL('/home', request.url))
     }
src/components/Global/MarqueeWrapper/index.tsx (1)

50-72: Consider extracting message rendering logic.

While the implementation is correct, the rendering logic could be simplified by extracting it into a separate component.

+const MarqueeMessage = ({ message, imageSrc, imageAnimationClass }) => (
+    <div className="mx-3 inline-flex min-h-12 items-center gap-3 py-2">
+        <div className="text-lg font-bold uppercase md:text-xl">{message}</div>
+        <img
+            src={imageSrc}
+            alt="Marquee Image"
+            className={`${imageAnimationClass || ''} ml-2 h-auto w-8`}
+        />
+    </div>
+);

 {Array.isArray(message)
     ? message.map((msg, index) => (
-          <div key={index} className="mx-3 inline-flex min-h-12 items-center gap-3 py-2">
-              <div className="text-lg font-bold uppercase md:text-xl">{msg}</div>
-              {index < message.length && (
-                  <img
-                      src={imageSrc}
-                      alt="Marquee Image"
-                      className={`${imageAnimationClass || ''} ml-2 h-auto w-8`}
-                  />
-              )}
-          </div>
+          <MarqueeMessage
+              key={index}
+              message={msg}
+              imageSrc={imageSrc}
+              imageAnimationClass={imageAnimationClass}
+          />
       ))
     : message && (
-          <div className="mx-3 inline-flex min-h-12 items-center py-2">
-              <div className="text-lg font-bold uppercase md:text-xl">{message}</div>
-              <img
-                  src={imageSrc}
-                  alt="Marquee Image"
-                  className={`${imageAnimationClass || ''} ml-2 h-auto w-8`}
-              />
-          </div>
+          <MarqueeMessage
+              message={message}
+              imageSrc={imageSrc}
+              imageAnimationClass={imageAnimationClass}
+          />
       )}
src/components/LandingPage/hero.tsx (1)

41-84: Consider extracting animation values into constants.

The animation values are duplicated between the initial, animate, and whileHover states. Consider extracting these into constants for better maintainability.

+const ANIMATION_VALUES = {
+    translateY: 4,
+    translateX: 4,
+    rotate: 0.75,
+}

 const renderCTAButton = (cta: CTAButton, variant: 'primary' | 'secondary') => (
     <motion.div
         className={`fixed bottom-4 z-20 sm:bottom-8 ${
             variant === 'primary' ? 'right-[calc(50%)]' : 'right-[calc(50%-120px)]'
         }`}
         initial={{
             opacity: 0,
-            translateY: 4,
-            translateX: 4,
-            rotate: 0.75,
+            ...ANIMATION_VALUES,
         }}
         animate={{
             opacity: buttonVisible ? 1 : 0,
             translateY: buttonVisible ? 0 : 20,
             translateX: buttonVisible ? 0 : 20,
             rotate: buttonVisible ? 0 : 1,
             pointerEvents: buttonVisible ? 'auto' : 'none',
         }}
         whileHover={{
-            translateY: 6,
-            translateX: 3,
-            rotate: 0.75,
+            translateY: ANIMATION_VALUES.translateY + 2,
+            translateX: ANIMATION_VALUES.translateX - 1,
+            rotate: ANIMATION_VALUES.rotate,
         }}
         transition={{ type: 'spring', damping: 15 }}
     >
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5216e94 and 0acbd05.

📒 Files selected for processing (9)
  • src/app/page.tsx (3 hunks)
  • src/components/Global/Footer/consts.ts (1 hunks)
  • src/components/Global/Footer/index.tsx (2 hunks)
  • src/components/Global/Layout/index.tsx (1 hunks)
  • src/components/Global/MarqueeWrapper/index.tsx (2 hunks)
  • src/components/Home/HomeWaitlist.tsx (0 hunks)
  • src/components/LandingPage/hero.tsx (4 hunks)
  • src/components/Setup/Setup.consts.tsx (1 hunks)
  • src/middleware.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • src/components/Home/HomeWaitlist.tsx
✅ Files skipped from review due to trivial changes (1)
  • src/components/Global/Footer/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Deploy-Preview
🔇 Additional comments (10)
src/middleware.ts (1)

9-15: LGTM! Authentication flow enhancement.

The addition of JWT token verification and redirection logic improves the user experience by automatically directing authenticated users to the home page.

src/app/page.tsx (2)

18-26: LGTM! Enhanced CTA structure.

The split between primary (waitlist) and secondary (cashout) CTAs provides clear user paths while maintaining focus on the waitlist feature.


32-46: LGTM! Improved FAQ content.

The FAQ content has been updated to better reflect the current state of the product and provide clear next steps for waitlisted users.

src/components/Setup/Setup.consts.tsx (1)

22-24: LGTM! Enhanced welcome message.

The updated description effectively communicates the value proposition and incentivizes early signup through pre-launch rewards.

src/components/Global/Layout/index.tsx (3)

4-9: LGTM! Import statements are well organized.

The imports are now better organized, with related imports grouped together.


31-53: LGTM! Layout structure aligns with landing page requirements.

The removal of the Header component and addition of FooterVisibilityObserver aligns well with the PR objectives for implementing a new landing page.


80-110: LGTM! FooterVisibilityObserver implementation follows best practices.

The component:

  • Uses IntersectionObserver API efficiently
  • Has proper cleanup on unmount
  • Uses a reasonable threshold value
src/components/LandingPage/hero.tsx (3)

9-24: LGTM! Well-structured type definitions.

The types provide good type safety and the isExternal option in CTAButton is a nice addition for handling external links properly.


26-26: LGTM! Clean implementation of dual CTA support.

The Hero component now cleanly supports both primary and secondary CTAs, with proper optional rendering and improved marquee visibility check.

Also applies to: 117-120


74-81: LGTM! Good accessibility implementation.

The component follows accessibility best practices:

  • External links have proper target and rel attributes
  • Images have descriptive alt text

Also applies to: 90-94

Comment on lines +14 to +19
// note: temporarily removed docs link from fotter, as it points to old docs
// {
// name: 'gitbook',
// url: 'https://docs.peanut.to',
// logoSrc: icons.GITBOOK_ICON.src,
// },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Resolve inconsistency with documentation links.

The gitbook social link is commented out due to outdated documentation, but the same URL is still active in the LINKS array. This inconsistency could confuse users.

Consider either:

  1. Commenting out both links until the new documentation is ready
  2. Updating both links to point to the new documentation URL

Also applies to: 27-31

Copy link
Copy Markdown
Contributor

@Hugo0 Hugo0 left a comment

Choose a reason for hiding this comment

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

I have no code issues, but please make a review task for konrad to review https://peanut-ui-git-feat-wallet-lp-squirrellabs.vercel.app/

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