fix: add dashboard to navigation and set as default landing page (refs #2)
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 2m35s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 27s
Deploy to Staging / Verify Staging (pull_request) Successful in 6s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 5s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 2m35s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 27s
Deploy to Staging / Verify Staging (pull_request) Successful in 6s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 5s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
- Add Dashboard to desktop sidebar navigation (first item) - Add /garage/dashboard route for desktop - Change default redirect from /garage/vehicles to /garage/dashboard - Change mobile default screen from Vehicles to Dashboard - Create DashboardPage wrapper for desktop route 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
export { DashboardScreen } from './components/DashboardScreen';
|
||||
export { DashboardPage } from './pages/DashboardPage';
|
||||
export { SummaryCards, SummaryCardsSkeleton } from './components/SummaryCards';
|
||||
export { VehicleAttention, VehicleAttentionSkeleton } from './components/VehicleAttention';
|
||||
export { QuickActions, QuickActionsSkeleton } from './components/QuickActions';
|
||||
|
||||
53
frontend/src/features/dashboard/pages/DashboardPage.tsx
Normal file
53
frontend/src/features/dashboard/pages/DashboardPage.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* @ai-summary Desktop dashboard page wrapping the DashboardScreen component
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Box, Typography } from '@mui/material';
|
||||
import { DashboardScreen } from '../components/DashboardScreen';
|
||||
import { MobileScreen } from '../../../core/store';
|
||||
import { Vehicle } from '../../vehicles/types/vehicles.types';
|
||||
|
||||
export const DashboardPage: React.FC = () => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// Map mobile screen names to desktop routes
|
||||
const handleNavigate = (screen: MobileScreen) => {
|
||||
switch (screen) {
|
||||
case 'Vehicles':
|
||||
navigate('/garage/vehicles');
|
||||
break;
|
||||
case 'Log Fuel':
|
||||
navigate('/garage/fuel-logs');
|
||||
break;
|
||||
case 'Stations':
|
||||
navigate('/garage/stations');
|
||||
break;
|
||||
case 'Documents':
|
||||
navigate('/garage/documents');
|
||||
break;
|
||||
case 'Settings':
|
||||
navigate('/garage/settings');
|
||||
break;
|
||||
default:
|
||||
navigate('/garage/dashboard');
|
||||
}
|
||||
};
|
||||
|
||||
const handleVehicleClick = (vehicle: Vehicle) => {
|
||||
navigate(`/garage/vehicles/${vehicle.id}`);
|
||||
};
|
||||
|
||||
return (
|
||||
<Box sx={{ py: 2 }}>
|
||||
<Typography variant="h4" sx={{ fontWeight: 700, color: 'text.primary', mb: 4 }}>
|
||||
Dashboard
|
||||
</Typography>
|
||||
<DashboardScreen
|
||||
onNavigate={handleNavigate}
|
||||
onVehicleClick={handleVehicleClick}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user