feat(legal): rewrite privacy, add T&C, hide chat on legal pages#62
Merged
Conversation
- Rewrite PrivacyPolicy to reflect actual data flows (Resend, GA4 cookies, Cloudflare logs, localStorage diagnostics), retention, user rights (GDPR/UK GDPR/DPDP), security, and children policy - Add TermsConditions page at /terms covering acceptance, IP, contact form rules, third-party links, warranty disclaimer, liability cap, indemnity, termination, and governing law (Pondicherry, India) - Hide the floating live-chat button + modal on /privacy and /terms via a useLocation-driven hook in Layout, with matching pathname guards in index.html so the inline scroll handler stops rewriting cssText on those routes - Link T&C from the footer and sitemap; refresh sitemap lastmod Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
aswin-portfolio | ccf0b7d | Commit Preview URL Branch Preview URL |
May 26 2026, 06:47 AM |
There was a problem hiding this comment.
Pull request overview
Adds/updates legal pages (Privacy Policy + new Terms & Conditions), wires a new /terms route, updates sitemap, and conditionally hides the live chat UI on legal routes.
Changes:
- Added new
/termspage component and linked it from the footer and Privacy Policy. - Rewrote
/privacycontent and added cross-linking between legal pages. - Implemented chat hiding on
/privacyand/termsvia React route effects +index.htmlguards; updatedsitemap.xml.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/TermsConditions.jsx | New Terms & Conditions page component with internal cross-links. |
| src/components/sections/Footer.jsx | Adds footer link to Terms & Conditions. |
| src/components/PrivacyPolicy.jsx | Rewrites Privacy Policy and adds link to Terms & Conditions. |
| src/App.jsx | Adds /terms route and route-based DOM toggling to hide chat on legal pages. |
| public/sitemap.xml | Adds /terms and updates /privacy lastmod/metadata. |
| index.html | Adds route guards to prevent chat scroll/click behavior on legal pages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+85
to
+89
| el.dataset.prevDisplay = el.style.display; | ||
| el.style.display = 'none'; | ||
| } else if ('prevDisplay' in el.dataset) { | ||
| el.style.display = el.dataset.prevDisplay; | ||
| delete el.dataset.prevDisplay; |
Comment on lines
331
to
335
| window.addEventListener('load', () => { | ||
| setTimeout(() => { | ||
| if (window.__isChatHiddenRoute()) return; | ||
| const chatButton = document.getElementById('openChat'); | ||
| const chatButtonText = document.getElementById('chatButtonText'); |
Comment on lines
+326
to
+327
| const p = window.location.pathname; | ||
| return p === '/privacy' || p === '/terms'; |
Comment on lines
+28
to
+32
| <a | ||
| href='/terms' | ||
| className='text-gray-500 hover:text-secondary-600 transition-colors duration-200' | ||
| > | ||
| Terms & Conditions |
Comment on lines
+73
to
+91
| const CHAT_ELEMENT_IDS = ['openChat', 'chatModal', 'chatModalOverlay']; | ||
| const LEGAL_ROUTES = ['/privacy', '/terms']; | ||
|
|
||
| const useChatVisibility = () => { | ||
| const { pathname } = useLocation(); | ||
|
|
||
| useEffect(() => { | ||
| const hide = LEGAL_ROUTES.includes(pathname); | ||
| CHAT_ELEMENT_IDS.forEach(id => { | ||
| const el = document.getElementById(id); | ||
| if (!el) return; | ||
| if (hide) { | ||
| el.dataset.prevDisplay = el.style.display; | ||
| el.style.display = 'none'; | ||
| } else if ('prevDisplay' in el.dataset) { | ||
| el.style.display = el.dataset.prevDisplay; | ||
| delete el.dataset.prevDisplay; | ||
| } | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
portfolio_errorslocalStorage diagnostic key. Adds retention windows, user rights (GDPR / UK GDPR / DPDP), cookies, security, and a children policy./termscovering acceptance, IP (including ML-training opt-out), contact form rules, third-party links, warranty disclaimer, liability cap (INR 1,000), indemnity, termination, and governing law (Pondicherry, India)./privacyand/terms—LayoutusesuseLocationto toggle the chat elements, with matching pathname guards inindex.htmlso the inline scroll handler stops rewritingcssTexton those routes.sitemap.xmlwith refreshedlastmod.Test plan
/still loads, chat button visible and behaves normally on scroll/privacyrenders new content, chat button + modal absent/termsrenders new content, chat button + modal absent/→/privacy→/correctly hides then restores the chat button/privacyand/termswork🤖 Generated with Claude Code