fix: add vehicle button opens add vehicle form (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 36s
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 onAddVehicle prop to DashboardScreen
- Mobile: triggers setShowAddVehicle(true) in App.tsx
- Desktop: navigates to /garage/vehicles with showAddForm state
- VehiclesPage auto-opens form when receiving showAddForm state

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Eric Gullickson
2026-01-02 22:25:35 -06:00
parent 544428fca2
commit 98a4a62ea5
4 changed files with 24 additions and 5 deletions

View File

@@ -20,12 +20,14 @@ interface DashboardScreenProps {
onNavigate?: (screen: MobileScreen, metadata?: Record<string, any>) => void;
onVehicleClick?: (vehicle: Vehicle) => void;
onViewMaintenance?: () => void;
onAddVehicle?: () => void;
}
export const DashboardScreen: React.FC<DashboardScreenProps> = ({
onNavigate,
onVehicleClick,
onViewMaintenance
onViewMaintenance,
onAddVehicle
}) => {
const { data: summary, isLoading: summaryLoading, error: summaryError } = useDashboardSummary();
const { data: vehiclesNeedingAttention, isLoading: attentionLoading, error: attentionError } = useVehiclesNeedingAttention();
@@ -87,7 +89,7 @@ export const DashboardScreen: React.FC<DashboardScreenProps> = ({
<Button
variant="primary"
size="lg"
onClick={() => onNavigate?.('Vehicles')}
onClick={onAddVehicle ?? (() => onNavigate?.('Vehicles'))}
>
Add Your First Vehicle
</Button>
@@ -118,7 +120,7 @@ export const DashboardScreen: React.FC<DashboardScreenProps> = ({
{/* Quick Actions */}
<QuickActions
onAddVehicle={() => onNavigate?.('Vehicles')}
onAddVehicle={onAddVehicle ?? (() => onNavigate?.('Vehicles'))}
onLogFuel={() => onNavigate?.('Log Fuel')}
onViewMaintenance={onViewMaintenance ?? (() => onNavigate?.('Vehicles'))}
onViewVehicles={() => onNavigate?.('Vehicles')}