Skip to content

Commit 890d311

Browse files
Add journal history feature
Adds a "Show Past Entries" button to the journal page, allowing users to view their previous journal entries retrieved from Firebase.
1 parent fe10025 commit 890d311

File tree

3 files changed

+449
-2
lines changed

3 files changed

+449
-2
lines changed

src/App.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11

2-
32
import { Toaster } from "@/components/ui/toaster";
43
import { Toaster as Sonner } from "@/components/ui/sonner";
54
import { TooltipProvider } from "@/components/ui/tooltip";
@@ -24,6 +23,7 @@ import Navbar from "./components/Navbar";
2423
import Profile from "./pages/Profile";
2524
import Goodbye from "./pages/Goodbye";
2625
import Journal from "./pages/Journal";
26+
import JournalEntries from "./pages/JournalEntries";
2727

2828
const queryClient = new QueryClient();
2929

@@ -101,6 +101,14 @@ const App = () => (
101101
</AuthWrapper>
102102
}
103103
/>
104+
<Route
105+
path="/journal-entries"
106+
element={
107+
<AuthWrapper requireAuth>
108+
<JournalEntries />
109+
</AuthWrapper>
110+
}
111+
/>
104112

105113
{/* Admin routes */}
106114
<Route

src/pages/Journal.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import React, { useState, useEffect } from 'react';
32
import { useNavigate } from 'react-router-dom';
43
import { motion } from 'framer-motion';
@@ -307,6 +306,17 @@ const Journal: React.FC = () => {
307306
</div>
308307
</motion.div>
309308
)}
309+
310+
<div className="mt-12 text-center">
311+
<Button
312+
variant="outline"
313+
onClick={() => navigate('/journal-entries')}
314+
className="w-full py-6 text-white border-white/20 hover:bg-white/10"
315+
>
316+
<BookOpen className="mr-2 h-5 w-5" />
317+
Show Past Entries
318+
</Button>
319+
</div>
310320
</div>
311321
</div>
312322
);

0 commit comments

Comments
 (0)