Skip to content

added disclaimer, and added share campaign feature#16

Open
OmRudraprasanna wants to merge 1 commit intoStabilityNexus:mainfrom
OmRudraprasanna:main
Open

added disclaimer, and added share campaign feature#16
OmRudraprasanna wants to merge 1 commit intoStabilityNexus:mainfrom
OmRudraprasanna:main

Conversation

@OmRudraprasanna
Copy link
Copy Markdown

@OmRudraprasanna OmRudraprasanna commented Dec 13, 2025

Added a Disclaimer popup on the home page.
Added a Disclaimer popup on the home page.

Summary by CodeRabbit

  • New Features
    • A disclaimer modal now appears when users first access the app, presenting important information they should review before continuing.
    • A new share button has been added to campaign detail pages, allowing users to easily copy campaign URLs to their clipboard with instant visual confirmation of successful copying.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 13, 2025

Walkthrough

Two new React components are introduced: a Disclaimer modal that auto-opens on app load with a closeable overlay, and a ShareBtn that copies the current campaign URL to the clipboard with user feedback. These components are integrated into the App and Details pages respectively.

Changes

Cohort / File(s) Summary
New UI Components
src/Disclaimer.tsx, src/ShareBtn.tsx
Disclaimer: New modal component that displays full-screen with dark overlay, auto-opens on mount via useEffect, and closes via button click. ShareBtn: New button component that copies current URL to clipboard, displays success feedback with checkmark for 2 seconds, and toggles label between "Share This Campaign" and "Link Copied!".
App Integration
src/App.tsx
Adds import for Disclaimer component and renders it globally before Router, ensuring the disclaimer displays on app load.
Details Page Integration
src/Details.tsx
Imports and renders ShareBtn alongside VaultActions when vault data is available; wraps both in fragment for clean DOM structure. Removes redundant commented code.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Focus areas: Verify Disclaimer auto-opens correctly and modal close behavior works as expected; confirm ShareBtn clipboard API usage and timeout reset mechanism; test integrations in App.tsx and Details.tsx render paths.

Poem

🐰 A disclaimer hops onto the scene,
With warnings displayed in between,
And now users can share,
The campaign they care,
With a click and a link so pristine!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'added disclaimer, and added share campaign feature' accurately captures the two main changes in the pull request: the new Disclaimer component and the new ShareBtn component for sharing campaigns.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link
Copy Markdown

@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 (6)
src/Disclaimer.tsx (2)

3-11: Avoid the “mount → open” state flip; consider persisting acknowledgement.
The useEffect that immediately sets isOpen(true) adds an extra render and can create a brief flash; you can initialize open state directly. Also consider storing an “accepted” flag (e.g., localStorage) so users don’t see this on every reload.


12-34: Modal needs basic a11y + keyboard handling (dialog role, labels, ESC, focus).
Right now it’s visually a modal but missing role="dialog", aria-modal, label/description wiring, and an ESC close path / initial focus management.

src/App.tsx (1)

19-19: Top-level Disclaimer integration looks fine; watch z-index conflicts.
Rendering it above the router is reasonable for a global gate, but z-[9999] may mask other overlays (e.g., RainbowKit modals) if both ever show at once.

Also applies to: 50-55

src/ShareBtn.tsx (1)

22-43: Add minimal a11y for the “copied” feedback.
Consider aria-live="polite" (or an offscreen status element) so “Link Copied!” is announced, and optionally type="button" to avoid unintended form submits if used inside a <form>.

src/Details.tsx (2)

14-15: Drop the “Already imported correctly” comment.
It’ll age poorly and doesn’t add intent.


255-263: Remove the redundant nested condition around VaultActions / ShareBtn.
This block is already inside the same {balanceOfVault.data && symbol && vaultDetails && (...)} check earlier, so the extra guard is duplicative and makes future edits riskier.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b816112 and 4f84b7a.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • src/App.tsx (5 hunks)
  • src/Details.tsx (5 hunks)
  • src/Disclaimer.tsx (1 hunks)
  • src/ShareBtn.tsx (1 hunks)
🔇 Additional comments (1)
src/App.tsx (1)

26-31: No SSR violations detected in current codebase.

The window and navigator usage in ShareBtn.tsx is confined to the handleShare event handler, which only executes on click (client-side). The document reference in main.tsx is the standard React entry point hydration. No render-time or module-initialization browser API usage was found that would break SSR.

Likely an incorrect or invalid review comment.

Comment on lines +6 to +20
const handleShare = () => {
// 1. Get the current URL
const currentUrl = window.location.href;

// 2. Copy to clipboard
navigator.clipboard.writeText(currentUrl).then(() => {
// 3. Change button state to show feedback
setCopied(true);

// 4. Reset after 2 seconds
setTimeout(() => {
setCopied(false);
}, 2000);
});
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Handle clipboard failures + clear/reset timers to avoid stale updates.
writeText can reject (permissions/unsupported), and repeated clicks can stack timeouts; consider try/catch + fallback and clearing the previous timer (and on unmount).

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