Skip to content

feat(legal): rewrite privacy, add T&C, hide chat on legal pages#62

Merged
Aswinmcw merged 1 commit into
mainfrom
legal/privacy-terms-update
May 26, 2026
Merged

feat(legal): rewrite privacy, add T&C, hide chat on legal pages#62
Aswinmcw merged 1 commit into
mainfrom
legal/privacy-terms-update

Conversation

@Aswinmcw
Copy link
Copy Markdown
Member

Summary

  • Privacy Policy rewritten to reflect the site's actual data flows: contact form via Resend, Google Analytics 4 with cookie names, Cloudflare hosting logs, and the portfolio_errors localStorage diagnostic key. Adds retention windows, user rights (GDPR / UK GDPR / DPDP), cookies, security, and a children policy.
  • New Terms & Conditions page at /terms covering 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).
  • Live chat hidden on /privacy and /termsLayout uses useLocation to toggle the chat elements, with matching pathname guards in index.html so the inline scroll handler stops rewriting cssText on those routes.
  • T&C linked from the footer; both pages added to sitemap.xml with refreshed lastmod.

Test plan

  • CF preview: / still loads, chat button visible and behaves normally on scroll
  • CF preview: /privacy renders new content, chat button + modal absent
  • CF preview: /terms renders new content, chat button + modal absent
  • SPA navigation //privacy/ correctly hides then restores the chat button
  • Footer link to Terms & Conditions works
  • Cross-links between /privacy and /terms work
  • Mobile width (375px) reads cleanly on both pages
  • No console errors on either page

🤖 Generated with Claude Code

- 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>
Copilot AI review requested due to automatic review settings May 26, 2026 06:47
@Aswinmcw Aswinmcw requested review from a team and Aswin-coder as code owners May 26, 2026 06:47
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 /terms page component and linked it from the footer and Privacy Policy.
  • Rewrote /privacy content and added cross-linking between legal pages.
  • Implemented chat hiding on /privacy and /terms via React route effects + index.html guards; updated sitemap.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 thread src/App.jsx
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 thread index.html
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 thread index.html
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 &amp; Conditions
Comment thread src/App.jsx
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;
}
});
@Aswinmcw Aswinmcw merged commit 940a838 into main May 26, 2026
6 checks passed
@Aswinmcw Aswinmcw deleted the legal/privacy-terms-update branch May 26, 2026 06:59
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