alpha
Login
or
Join now
atpota.to
/
cred.blue
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
add analytics
author
damedotblog
date
1 year ago
(Feb 19, 2025, 9:17 PM -0500)
commit
36541097
36541097f112c326bfaeab595b46d2030500fa81
parent
088d4fd4
088d4fd4f04ab442f8a004c30dcd02be1510561f
+27
-28
3 changed files
Expand all
Collapse all
Unified
Split
package.json
src
App.jsx
index.js
+1
-1
package.json
Reviewed
···
56
56
"devDependencies": {
57
57
"cross-env": "^7.0.3"
58
58
}
59
59
-
}
59
59
+
}
+26
-24
src/App.jsx
Reviewed
···
1
1
-
// App.jsx
2
1
import React from 'react';
2
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
19
-
<Router>
20
20
-
<div className="app-container" style={{ display: 'flex', flexDirection: 'column', minHeight: '100vh' }}>
21
21
-
<Navbar />
22
22
-
<div className="main-container" style={{ flex: 1 }}>
23
23
-
<Routes>
24
24
-
{/* All routes are now public */}
25
25
-
<Route path="/home" element={<Home />} />
26
26
-
<Route path="/compare" element={<CompareScores />} />
27
27
-
<Route path="/alt-text" element={<AltTextRatingTool />} />
28
28
-
<Route path="/about" element={<About />} />
29
29
-
<Route path="/privacy" element={<Privacy />} />
30
30
-
<Route path="/terms" element={<Terms />} />
31
31
-
<Route path="/newsletter" element={<Newsletter />} />
32
32
-
<Route path="/:username" element={<UserProfile />} />
33
33
-
<Route path="/zen" element={<ZenPage />} />
34
34
-
35
35
-
{/* Default routes */}
36
36
-
<Route path="/" element={<Navigate to="/home" replace />} />
37
37
-
<Route path="*" element={<Navigate to="/home" replace />} />
38
38
-
</Routes>
19
19
+
<>
20
20
+
<Router>
21
21
+
<div className="app-container" style={{ display: 'flex', flexDirection: 'column', minHeight: '100vh' }}>
22
22
+
<Navbar />
23
23
+
<div className="main-container" style={{ flex: 1 }}>
24
24
+
<Routes>
25
25
+
{/* All routes are now public */}
26
26
+
<Route path="/home" element={<Home />} />
27
27
+
<Route path="/compare" element={<CompareScores />} />
28
28
+
<Route path="/alt-text" element={<AltTextRatingTool />} />
29
29
+
<Route path="/about" element={<About />} />
30
30
+
<Route path="/privacy" element={<Privacy />} />
31
31
+
<Route path="/terms" element={<Terms />} />
32
32
+
<Route path="/newsletter" element={<Newsletter />} />
33
33
+
<Route path="/:username" element={<UserProfile />} />
34
34
+
<Route path="/zen" element={<ZenPage />} />
35
35
+
{/* Default routes */}
36
36
+
<Route path="/" element={<Navigate to="/home" replace />} />
37
37
+
<Route path="*" element={<Navigate to="/home" replace />} />
38
38
+
</Routes>
39
39
+
</div>
40
40
+
<Footer />
39
41
</div>
40
40
-
<Footer />
41
41
-
</div>
42
42
-
</Router>
42
42
+
</Router>
43
43
+
<Analytics />
44
44
+
</>
43
45
);
44
46
};
45
47
-3
src/index.js
Reviewed
···
4
4
import App from './App';
5
5
import { ThemeProvider } from './contexts/ThemeContext';
6
6
import "./index.css";
7
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
15
-
<Analytics>
16
14
<App />
17
17
-
</Analytics>
18
15
</ThemeProvider>
19
16
</React.StrictMode>
20
17
);