added driverjs onboarding

This commit is contained in:
2026-03-16 11:52:33 +05:30
parent 07df39184e
commit ef52695bd9
10 changed files with 4917 additions and 4345 deletions

View File

@@ -4,6 +4,7 @@ import { getUserEntries, type JournalEntry } from '../lib/api'
import { decryptEntry } from '../lib/crypto'
import { formatIST, getISTDateComponents } from '../lib/timezone'
import BottomNav from '../components/BottomNav'
import { useOnboardingTour, hasPendingTourStep, clearPendingTourStep } from '../hooks/useOnboardingTour'
interface DecryptedEntry extends JournalEntry {
decryptedTitle?: string
@@ -19,6 +20,16 @@ export default function HistoryPage() {
const [loadingEntries, setLoadingEntries] = useState(false)
const [selectedEntry, setSelectedEntry] = useState<DecryptedEntry | null>(null)
const { continueTourOnHistory } = useOnboardingTour()
// Continue onboarding tour if navigated here from the home page tour
useEffect(() => {
if (hasPendingTourStep() === 'history') {
clearPendingTourStep()
continueTourOnHistory()
}
}, [])
// Fetch entries on mount and when userId changes
useEffect(() => {
if (!user || !userId) return
@@ -189,7 +200,7 @@ export default function HistoryPage() {
</header>
<main className="history-container">
<div className="calendar-card">
<div id="tour-calendar" className="calendar-card">
<div className="calendar-header">
<h2 className="calendar-month">{monthName}</h2>
<div className="calendar-nav">
@@ -239,7 +250,7 @@ export default function HistoryPage() {
</div>
</div>
<section className="recent-entries">
<section id="tour-entries-list" className="recent-entries">
<h3 className="recent-entries-title">
{selectedDate.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }).toUpperCase()}
</h3>