Conversation
Signed-off-by: ragnep <ragneinfo@gmail.com>
📝 WalkthroughWalkthroughAdd touch-device gating and a user-activated overlay for interactive HTML media across multiple components, introduce an InteractiveIcon component, update overlay markup/styling, adjust padding in NowMintingSection, and remove an icon usage in BoostedDropCardHome. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Component
participant DeviceDetection
participant UI
User->>Component: Open page / media item
Component->>DeviceDetection: Query touch capability (useDeviceInfo)
DeviceDetection-->>Component: Return hasTouch (true/false)
alt Touch device && media type is HTML
Component->>UI: Render gated overlay button ("Tap to load")
UI-->>User: Show semi-transparent overlay with InteractiveIcon
User->>UI: Tap overlay button
UI->>Component: Set interactiveEnabled = true
Component->>UI: Render interactive HTML media
UI-->>User: Interactive media displayed
else Non-touch device or non-HTML media
Component->>UI: Render media directly
UI-->>User: Media displayed immediately
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@components/home/next-mint-leading/LeadingCard.tsx`:
- Around line 104-111: The preview image prop is being passed to MediaDisplay
for non‑touch (shouldGate === false) even when the media is HTML, causing the
iframe to never render; update the previewImageUrl expression so that when
media.mime_type indicates HTML (e.g., equals or startsWith "text/html") you pass
undefined (suppress the preview) in the non‑gated path; locate the MediaDisplay
usage in LeadingCard.tsx and change the previewImageUrl assignment to check
media.mime_type for HTML before returning previewImageUrlFallback.
Signed-off-by: ragnep <ragneinfo@gmail.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@components/home/next-mint-leading/LeadingCard.tsx`:
- Around line 29-46: The HTML iframe is being rendered on the server because
useDeviceInfo returns hasTouchScreen=false in SSR; to prevent preloading you
should gate HTML until the component hydrates: add a local "hydrated" state
(useState(false)) and set it to true in a useEffect that runs on mount, compute
shouldGate as hydrated && hasTouchScreen && isHtml, and control
interactiveEnabled via setInteractiveEnabled(!shouldGate). Initialize
interactiveEnabled conservatively for SSR (e.g., !isHtml) so HTML is not
interactive server-side, and update it inside the existing useEffect (watching
drop.id, hydrated, hasTouchScreen, isHtml) to enable interaction post-hydration
when appropriate; reference LeadingCard, useDeviceInfo, shouldGate,
interactiveEnabled, setInteractiveEnabled.
|



Summary by CodeRabbit
New Features
Style
✏️ Tip: You can customize this high-level summary in your review settings.