This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

add analytics

+27 -28
+1 -1
package.json
··· 56 56 "devDependencies": { 57 57 "cross-env": "^7.0.3" 58 58 } 59 - } 59 + }
+26 -24
src/App.jsx
··· 1 - // App.jsx 2 1 import React from 'react'; 2 + import { Analytics } from '@vercel/analytics/react'; 3 3 import { BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom'; 4 4 import Navbar from './components/Navbar/Navbar'; 5 5 import Footer from './components/Footer/Footer'; ··· 16 16 17 17 const App = () => { 18 18 return ( 19 - <Router> 20 - <div className="app-container" style={{ display: 'flex', flexDirection: 'column', minHeight: '100vh' }}> 21 - <Navbar /> 22 - <div className="main-container" style={{ flex: 1 }}> 23 - <Routes> 24 - {/* All routes are now public */} 25 - <Route path="/home" element={<Home />} /> 26 - <Route path="/compare" element={<CompareScores />} /> 27 - <Route path="/alt-text" element={<AltTextRatingTool />} /> 28 - <Route path="/about" element={<About />} /> 29 - <Route path="/privacy" element={<Privacy />} /> 30 - <Route path="/terms" element={<Terms />} /> 31 - <Route path="/newsletter" element={<Newsletter />} /> 32 - <Route path="/:username" element={<UserProfile />} /> 33 - <Route path="/zen" element={<ZenPage />} /> 34 - 35 - {/* Default routes */} 36 - <Route path="/" element={<Navigate to="/home" replace />} /> 37 - <Route path="*" element={<Navigate to="/home" replace />} /> 38 - </Routes> 19 + <> 20 + <Router> 21 + <div className="app-container" style={{ display: 'flex', flexDirection: 'column', minHeight: '100vh' }}> 22 + <Navbar /> 23 + <div className="main-container" style={{ flex: 1 }}> 24 + <Routes> 25 + {/* All routes are now public */} 26 + <Route path="/home" element={<Home />} /> 27 + <Route path="/compare" element={<CompareScores />} /> 28 + <Route path="/alt-text" element={<AltTextRatingTool />} /> 29 + <Route path="/about" element={<About />} /> 30 + <Route path="/privacy" element={<Privacy />} /> 31 + <Route path="/terms" element={<Terms />} /> 32 + <Route path="/newsletter" element={<Newsletter />} /> 33 + <Route path="/:username" element={<UserProfile />} /> 34 + <Route path="/zen" element={<ZenPage />} /> 35 + {/* Default routes */} 36 + <Route path="/" element={<Navigate to="/home" replace />} /> 37 + <Route path="*" element={<Navigate to="/home" replace />} /> 38 + </Routes> 39 + </div> 40 + <Footer /> 39 41 </div> 40 - <Footer /> 41 - </div> 42 - </Router> 42 + </Router> 43 + <Analytics /> 44 + </> 43 45 ); 44 46 }; 45 47
-3
src/index.js
··· 4 4 import App from './App'; 5 5 import { ThemeProvider } from './contexts/ThemeContext'; 6 6 import "./index.css"; 7 - import { Analytics } from '@vercel/analytics/next'; 8 7 9 8 const container = document.getElementById('root'); 10 9 const root = ReactDOM.createRoot(container); ··· 12 11 root.render( 13 12 <React.StrictMode> 14 13 <ThemeProvider> 15 - <Analytics> 16 14 <App /> 17 - </Analytics> 18 15 </ThemeProvider> 19 16 </React.StrictMode> 20 17 );