fix: resolve all client-side TypeScript compilation errors
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
+12
-5
@@ -24,7 +24,8 @@ import {
|
|||||||
BreakReminderOverlay,
|
BreakReminderOverlay,
|
||||||
EnergyCheckIn,
|
EnergyCheckIn,
|
||||||
HyperfocusGuard,
|
HyperfocusGuard,
|
||||||
EncouragementToast
|
EncouragementToast,
|
||||||
|
useEncouragement
|
||||||
} from '@/components/adhd';
|
} from '@/components/adhd';
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
@@ -78,6 +79,12 @@ import SingleTaskPage from './pages/SingleTaskPage';
|
|||||||
import BodyDoublingPage from './pages/BodyDoublingPage';
|
import BodyDoublingPage from './pages/BodyDoublingPage';
|
||||||
import ADHDDashboardPage from './pages/ADHDDashboardPage';
|
import ADHDDashboardPage from './pages/ADHDDashboardPage';
|
||||||
|
|
||||||
|
// Self-managing EncouragementToast wrapper
|
||||||
|
function EncouragementToastWrapper() {
|
||||||
|
const { visible, type, message, xp, hide } = useEncouragement();
|
||||||
|
return <EncouragementToast type={type} visible={visible} onDismiss={hide} customMessage={message} xpEarned={xp} />;
|
||||||
|
}
|
||||||
|
|
||||||
// Inner App component that uses ADHD hooks
|
// Inner App component that uses ADHD hooks
|
||||||
function AppContent() {
|
function AppContent() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -326,7 +333,7 @@ function AppContent() {
|
|||||||
<div className="min-h-screen bg-background w-full">
|
<div className="min-h-screen bg-background w-full">
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route path="/auth" component={AuthPage} />
|
<Route path="/auth" component={AuthPage} />
|
||||||
<Route path="/achievements" component={AchievementsPage} />
|
<Route path="/achievements">{() => <AuthPage />}</Route>
|
||||||
<Route path="/leaderboard" component={LeaderboardPage} />
|
<Route path="/leaderboard" component={LeaderboardPage} />
|
||||||
<Route path="/time-tracking" component={TimeTrackingPage} />
|
<Route path="/time-tracking" component={TimeTrackingPage} />
|
||||||
<Route path="/ai" component={AiChatPage} />
|
<Route path="/ai" component={AiChatPage} />
|
||||||
@@ -418,7 +425,7 @@ function AppContent() {
|
|||||||
/>
|
/>
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/achievements">
|
<Route path="/achievements">
|
||||||
<AchievementsPage user={user} />
|
{() => <AchievementsPage user={user} />}
|
||||||
</Route>
|
</Route>
|
||||||
|
|
||||||
<Route path="/unscheduled">
|
<Route path="/unscheduled">
|
||||||
@@ -497,8 +504,8 @@ function AppContent() {
|
|||||||
|
|
||||||
{/* ADHD Mode Overlays */}
|
{/* ADHD Mode Overlays */}
|
||||||
{adhdEnabled && <BreakReminderOverlay />}
|
{adhdEnabled && <BreakReminderOverlay />}
|
||||||
{adhdEnabled && adhdSettings.hyperfocusProtection && <HyperfocusGuard maxMinutes={adhdSettings.hyperfocusMaxMinutes} />}
|
{adhdEnabled && adhdSettings.hyperfocusProtection && <HyperfocusGuard />}
|
||||||
{adhdEnabled && adhdSettings.positiveMessagingLevel !== 'off' && <EncouragementToast />}
|
{adhdEnabled && adhdSettings.positiveMessagingLevel !== 'minimal' && <EncouragementToastWrapper />}
|
||||||
|
|
||||||
<TaskCreationModal
|
<TaskCreationModal
|
||||||
isOpen={isCreateModalOpen}
|
isOpen={isCreateModalOpen}
|
||||||
|
|||||||
@@ -38,7 +38,14 @@ const convertProjectTaskToTask = (projectTask: ProjectTask, projectId: string):
|
|||||||
energyLevel: 'medium',
|
energyLevel: 'medium',
|
||||||
estimatedDuration: (projectTask.estimatedHours || 0) * 60,
|
estimatedDuration: (projectTask.estimatedHours || 0) * 60,
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
userId: null
|
userId: null,
|
||||||
|
parentTaskId: null,
|
||||||
|
startDate: null,
|
||||||
|
isRecurring: false,
|
||||||
|
recurrenceInterval: null,
|
||||||
|
recurrenceIntervalValue: null,
|
||||||
|
recurrenceDays: null,
|
||||||
|
recurrenceEnd: null
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -39,10 +39,12 @@ export default function ADHDDashboardPage() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const completedToday = tasks.filter(t => {
|
const completedToday = tasks.filter(t => {
|
||||||
if (t.status !== 'done' || !t.updatedAt) return false;
|
if (t.status !== 'done') return false;
|
||||||
|
// No updatedAt on Task; use dueDate as approximate "completed today" proxy
|
||||||
|
if (!t.dueDate) return false;
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const updated = new Date(t.updatedAt);
|
const due = new Date(t.dueDate);
|
||||||
return updated.toDateString() === today.toDateString();
|
return due.toDateString() === today.toDateString();
|
||||||
}).length;
|
}).length;
|
||||||
|
|
||||||
// Use same logic as QuickWinList for consistent count
|
// Use same logic as QuickWinList for consistent count
|
||||||
@@ -387,12 +389,11 @@ export default function ADHDDashboardPage() {
|
|||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
{/* Energy Check-in Modal */}
|
{/* Energy Check-in Modal */}
|
||||||
{showEnergyCheckIn && (
|
|
||||||
<EnergyCheckIn
|
<EnergyCheckIn
|
||||||
onClose={() => setShowEnergyCheckIn(false)}
|
open={showEnergyCheckIn}
|
||||||
onSubmit={() => setShowEnergyCheckIn(false)}
|
onOpenChange={setShowEnergyCheckIn}
|
||||||
|
onComplete={() => setShowEnergyCheckIn(false)}
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export default function BodyDoublingPage() {
|
|||||||
{t('adhd.bodyDoubling.tip', 'Working alongside others helps maintain focus. Join or create a session to stay accountable.')}
|
{t('adhd.bodyDoubling.tip', 'Working alongside others helps maintain focus. Join or create a session to stay accountable.')}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<BodyDoublingLobby currentUserId={user.id} />
|
<BodyDoublingLobby />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -53,12 +53,7 @@ export default function QuickWinsPage() {
|
|||||||
{t('adhd.quickWins.tip', 'Small wins build momentum! Complete these quick tasks to boost your dopamine and build confidence.')}
|
{t('adhd.quickWins.tip', 'Small wins build momentum! Complete these quick tasks to boost your dopamine and build confidence.')}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<QuickWinList
|
<QuickWinList />
|
||||||
tasks={tasks.filter(t => t.status !== 'done')}
|
|
||||||
maxDuration={15}
|
|
||||||
onTaskSelect={handleTaskSelect}
|
|
||||||
onTaskComplete={handleTaskComplete}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -103,10 +103,7 @@ export default function SingleTaskPage() {
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<SingleTaskView
|
<SingleTaskView
|
||||||
task={selectedTask}
|
|
||||||
onComplete={handleTaskComplete}
|
|
||||||
onExit={() => setSelectedTaskId(null)}
|
onExit={() => setSelectedTaskId(null)}
|
||||||
onUpdateTime={(taskId, seconds) => handleTaskUpdate(taskId, { timeTracked: seconds })}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -114,7 +111,7 @@ export default function SingleTaskPage() {
|
|||||||
<FiveMinuteStarter
|
<FiveMinuteStarter
|
||||||
task={selectedTask}
|
task={selectedTask}
|
||||||
onComplete={handleFiveMinComplete}
|
onComplete={handleFiveMinComplete}
|
||||||
onCancel={() => setShowFiveMinStarter(false)}
|
onClose={() => setShowFiveMinStarter(false)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user