Skip to content

Staging#168

Merged
afsar-dev merged 2 commits into
mainfrom
staging
Apr 18, 2026
Merged

Staging#168
afsar-dev merged 2 commits into
mainfrom
staging

Conversation

@afsar-dev

@afsar-dev afsar-dev commented Apr 18, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

New Features

  • Added Peerlist and Product Hunt badges to the footer
  • Badges automatically adapt to light and dark themes based on user preference
  • Display can be configured through environment variables

@vercel

vercel Bot commented Apr 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nurui Building Building Preview, Comment, Open in v0 Apr 18, 2026 7:04am

@afsar-dev afsar-dev merged commit 4b9fa87 into main Apr 18, 2026
4 of 6 checks passed
@coderabbitai

coderabbitai Bot commented Apr 18, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ac869da7-f280-497d-9724-9259f12d09aa

📥 Commits

Reviewing files that changed from the base of the PR and between 66badf3 and 966325a.

📒 Files selected for processing (11)
  • .env.example
  • next.config.ts
  • src/components/common/BadgeLink.tsx
  • src/components/common/BadgeSkeleton.tsx
  • src/components/common/LaunchpadBadges.tsx
  • src/components/layout/Footer.tsx
  • src/config/launchpad.config.ts
  • src/hooks/useBadgeSvg.ts
  • src/hooks/useMounted.ts
  • src/lib/launchpad.ts
  • src/types/launchpad.type.ts

📝 Walkthrough

Walkthrough

A new "Launchpad Badges" feature is introduced that dynamically renders Peerlist and Product Hunt badges in the footer. The implementation includes new components, hooks, utility functions, types, and environment-driven configuration, with support for theme-aware badge rendering and remote image loading from external badge providers.

Changes

Cohort / File(s) Summary
Environment & Configuration
.env.example, next.config.ts
Added two new public environment variables (NEXT_PUBLIC_PEERLIST_EMBED_ID, NEXT_PUBLIC_PRODUCT_HUNT_POST_ID) and two remote image hosts (peerlist.io, api.producthunt.com) to the Next.js images configuration.
Types & Utilities
src/types/launchpad.type.ts, src/lib/launchpad.ts
Introduced TBadgeTheme union type, IBadgeConfig interface, and two utility functions (getPeerlistBadgeSrc, getProductHuntBadgeSrc) for generating badge image URLs parameterized by theme.
Custom Hooks
src/hooks/useMounted.ts, src/hooks/useBadgeSvg.ts
Added useMounted hook to track component mount state and useBadgeSvg hook to asynchronously fetch SVG content from external URLs with loading state management.
Badge Components
src/components/common/BadgeLink.tsx, src/components/common/BadgeSkeleton.tsx, src/components/common/LaunchpadBadges.tsx
Created BadgeLink component to render external badge links with images, BadgeSkeleton component for animated skeleton placeholders during load, and LaunchpadBadges orchestrator component that conditionally renders skeletons or badge links with theme-aware styling.
Configuration & Integration
src/config/launchpad.config.ts, src/components/layout/Footer.tsx
Defined LAUNCHPAD_BADGES configuration array with three badge entries (Swag By Badge, Product Hunt, Peerlist) backed by environment variables, and integrated LaunchpadBadges component into the footer layout.

Sequence Diagram

sequenceDiagram
    participant User
    participant LaunchpadBadges
    participant useMounted
    participant next-themes
    participant BadgeLink
    participant useBadgeSvg
    participant ExternalAPI as External Badge API

    User->>LaunchpadBadges: Render component
    LaunchpadBadges->>useMounted: Check mounted status
    useMounted-->>LaunchpadBadges: mounted = false (initially)
    LaunchpadBadges->>LaunchpadBadges: Render BadgeSkeleton
    User->>LaunchpadBadges: Component mounts in DOM
    useMounted-->>LaunchpadBadges: mounted = true
    LaunchpadBadges->>next-themes: Get resolvedTheme
    next-themes-->>LaunchpadBadges: Return theme (e.g., "dark")
    LaunchpadBadges->>LaunchpadBadges: Invert theme (dark → light)
    LaunchpadBadges->>LaunchpadBadges: Render BadgeLink components
    BadgeLink->>useBadgeSvg: Fetch badge SVG from URL
    useBadgeSvg->>ExternalAPI: GET badge image (theme-parameterized)
    ExternalAPI-->>useBadgeSvg: Return SVG content
    useBadgeSvg-->>BadgeLink: Return svg & isLoading=false
    BadgeLink->>BadgeLink: Render Image with fetched SVG
    BadgeLink-->>User: Display badge link
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 Badges hop into the footer with grace,
Peerlist and Product Hunt find their place,
With themes that invert and SVGs that dance,
Skeletons pulse while loaders enhance,
A launchpad shines bright in the dark! 🚀

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch staging

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.

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.

1 participant