fix: maintenance button navigates to maintenance screen (refs #2)
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 2m37s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 37s
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 2m37s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 37s
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 onViewMaintenance prop to DashboardScreen - Desktop: navigates to /garage/maintenance - Mobile: falls back to Vehicles (no dedicated mobile maintenance screen) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,11 +19,13 @@ import { Vehicle } from '../../vehicles/types/vehicles.types';
|
||||
interface DashboardScreenProps {
|
||||
onNavigate?: (screen: MobileScreen, metadata?: Record<string, any>) => void;
|
||||
onVehicleClick?: (vehicle: Vehicle) => void;
|
||||
onViewMaintenance?: () => void;
|
||||
}
|
||||
|
||||
export const DashboardScreen: React.FC<DashboardScreenProps> = ({
|
||||
onNavigate,
|
||||
onVehicleClick
|
||||
onVehicleClick,
|
||||
onViewMaintenance
|
||||
}) => {
|
||||
const { data: summary, isLoading: summaryLoading, error: summaryError } = useDashboardSummary();
|
||||
const { data: vehiclesNeedingAttention, isLoading: attentionLoading, error: attentionError } = useVehiclesNeedingAttention();
|
||||
@@ -118,7 +120,7 @@ export const DashboardScreen: React.FC<DashboardScreenProps> = ({
|
||||
<QuickActions
|
||||
onAddVehicle={() => onNavigate?.('Vehicles')}
|
||||
onLogFuel={() => onNavigate?.('Log Fuel')}
|
||||
onViewMaintenance={() => onNavigate?.('Vehicles')} // Navigate to vehicles then maintenance
|
||||
onViewMaintenance={onViewMaintenance ?? (() => onNavigate?.('Vehicles'))}
|
||||
onViewVehicles={() => onNavigate?.('Vehicles')}
|
||||
/>
|
||||
|
||||
|
||||
@@ -39,6 +39,10 @@ export const DashboardPage: React.FC = () => {
|
||||
navigate(`/garage/vehicles/${vehicle.id}`);
|
||||
};
|
||||
|
||||
const handleViewMaintenance = () => {
|
||||
navigate('/garage/maintenance');
|
||||
};
|
||||
|
||||
return (
|
||||
<Box sx={{ py: 2 }}>
|
||||
<Typography variant="h4" sx={{ fontWeight: 700, color: 'text.primary', mb: 4 }}>
|
||||
@@ -47,6 +51,7 @@ export const DashboardPage: React.FC = () => {
|
||||
<DashboardScreen
|
||||
onNavigate={handleNavigate}
|
||||
onVehicleClick={handleVehicleClick}
|
||||
onViewMaintenance={handleViewMaintenance}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user