Add Privacy Policy and Terms of Service pages with routing#29
Add Privacy Policy and Terms of Service pages with routing#29Mr-Technician wants to merge 1 commit into
Conversation
…footer integration
|
oops wrong branch |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
📝 WalkthroughWalkthroughThis PR restructures the footer layout and introduces legal policy pages. Footer rendering moves from App.js to AppRouter.js, new Privacy and Terms pages are added with full legal content, and the Footer component is updated to link to these pages instead of displaying an inline disclaimer dialog. ChangesLegal Pages and Footer Restructuring
🎯 2 (Simple) | ⏱️ ~12 minutes Possibly Related PRs
Suggested Reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/AppRouter.js (1)
29-31:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winReset scroll position when navigating to legal routes (/privacy, /terms).
src/AppRouter.js wraps
<Navbar />,<Routes />, and<Footer />inside<BrowserRouter>, and there’s no scroll restoration/scroll-to-top logic anywhere undersrc/(noScrollRestoration,window.scrollTo, or location-change scroll reset). Clicking footer links to/privacyor/termscan therefore land users partway down the page—add a small route-change scroll reset component next to<Routes />.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/AppRouter.js` around lines 29 - 31, Add a small route-change scroll reset component and mount it inside the existing BrowserRouter alongside <Routes /> so legal links always start at top: implement a ScrollToTop React component that uses useLocation() and useEffect() to call window.scrollTo(0, 0) whenever location.pathname changes, export it (e.g., ScrollToTop) and import it into src/AppRouter.js, then render <ScrollToTop /> directly under <BrowserRouter> and before or next to <Routes /> (keeping existing <Navbar /> and <Footer /> unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/AppRouter.js`:
- Line 48: AppRouter renders <Alerts /> but never imports it; add an import for
the Alerts component at the top of the file (or use React.lazy if you prefer
code-splitting) so the Route path="/alerts" can resolve. Locate AppRouter (where
Route is defined) and add a correct import statement referencing the Alerts
component name (matching the exported symbol from the Alerts module) and update
any relative path to the Alerts file accordingly.
---
Outside diff comments:
In `@src/AppRouter.js`:
- Around line 29-31: Add a small route-change scroll reset component and mount
it inside the existing BrowserRouter alongside <Routes /> so legal links always
start at top: implement a ScrollToTop React component that uses useLocation()
and useEffect() to call window.scrollTo(0, 0) whenever location.pathname
changes, export it (e.g., ScrollToTop) and import it into src/AppRouter.js, then
render <ScrollToTop /> directly under <BrowserRouter> and before or next to
<Routes /> (keeping existing <Navbar /> and <Footer /> unchanged).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b7a64974-784a-40ac-a101-df659300575f
📒 Files selected for processing (7)
src/App.jssrc/AppRouter.jssrc/Footer.csssrc/Footer.jssrc/Legal.csssrc/Privacy.jssrc/Terms.js
💤 Files with no reviewable changes (1)
- src/App.js
| } | ||
| /> | ||
| <Route path="/about" element={<About />} /> | ||
| <Route path="/alerts" element={<Alerts />} /> |
There was a problem hiding this comment.
Import Alerts before routing to it.
Line 48 renders <Alerts />, but this file never imports Alerts, so AppRouter.js will fail to compile and the new /alerts flow referenced from the legal copy cannot work.
Suggested fix
import About from "./About";
+import Alerts from "./Alerts";
import Footer from "./Footer";📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <Route path="/alerts" element={<Alerts />} /> | |
| import About from "./About"; | |
| import Alerts from "./Alerts"; | |
| import Footer from "./Footer"; |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/AppRouter.js` at line 48, AppRouter renders <Alerts /> but never imports
it; add an import for the Alerts component at the top of the file (or use
React.lazy if you prefer code-splitting) so the Route path="/alerts" can
resolve. Locate AppRouter (where Route is defined) and add a correct import
statement referencing the Alerts component name (matching the exported symbol
from the Alerts module) and update any relative path to the Alerts file
accordingly.
This pull request introduces a new legal section to the app, adding dedicated Privacy Policy and Terms of Service pages, updating the footer to link to these new pages, and refactoring related navigation and styling. The changes improve the app’s legal compliance and user transparency, while also simplifying the footer’s design and code.
Legal and Compliance Enhancements:
Privacy.jsandTerms.jscomponents, providing comprehensive Privacy Policy and Terms of Service pages, and included corresponding styles inLegal.css. [1] [2] [3]Navigation and Routing Updates:
/privacyand/terms(as well as/subscribedand/unsubscribed) inAppRouter.js, and moved theFootercomponent to be rendered within the router for consistent footer display across all pages. [1] [2] [3]FooterfromApp.js, as it is now handled byAppRouter.js. [1] [2]Styling Improvements:
Legal.cssfor the legal pages, and made minor adjustments toFooter.cssfor improved layout and mobile responsiveness. [1] [2]Summary by CodeRabbit
New Features
Style