Updated packages. Changed date picker package to Day.JS and applied it across whole app.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import { Box, Typography, Button, Card, CardContent, Divider, FormControl, InputLabel, Select, MenuItem, List, ListItem } from '@mui/material';
|
||||
import { Box, Typography, Button, Card, CardContent, Divider, FormControl, InputLabel, Select, MenuItem, List, ListItem, ListItemButton } from '@mui/material';
|
||||
import { useQueryClient } from '@tanstack/react-query';
|
||||
import { Vehicle } from '../types/vehicles.types';
|
||||
import { useFuelLogs } from '../../fuel-logs/hooks/useFuelLogs';
|
||||
@@ -250,22 +250,24 @@ export const VehicleDetailMobile: React.FC<VehicleDetailMobileProps> = ({
|
||||
) : (
|
||||
<List disablePadding>
|
||||
{filteredRecords.map(rec => (
|
||||
<ListItem key={rec.id} divider button onClick={() => openEditLog(rec.id, rec.type)}>
|
||||
<Box sx={{ flexGrow: 1 }}>
|
||||
{/* Primary line: MPG/km-L and amount */}
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<Typography variant="body1" color="text.primary">
|
||||
{rec.summary || 'MPG: —'}
|
||||
</Typography>
|
||||
<Typography variant="body1" color="text.primary">
|
||||
{rec.amount || '—'}
|
||||
<ListItem key={rec.id} divider disablePadding>
|
||||
<ListItemButton onClick={() => openEditLog(rec.id, rec.type)}>
|
||||
<Box sx={{ flexGrow: 1 }}>
|
||||
{/* Primary line: MPG/km-L and amount */}
|
||||
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
|
||||
<Typography variant="body1" color="text.primary">
|
||||
{rec.summary || 'MPG: —'}
|
||||
</Typography>
|
||||
<Typography variant="body1" color="text.primary">
|
||||
{rec.amount || '—'}
|
||||
</Typography>
|
||||
</Box>
|
||||
{/* Secondary line: Grade • Date • Type */}
|
||||
<Typography variant="body2" color="text.secondary" sx={{ mt: 0.25 }}>
|
||||
{rec.secondary || `${new Date(rec.date).toLocaleDateString()} • ${rec.type}`}
|
||||
</Typography>
|
||||
</Box>
|
||||
{/* Secondary line: Grade • Date • Type */}
|
||||
<Typography variant="body2" color="text.secondary" sx={{ mt: 0.25 }}>
|
||||
{rec.secondary || `${new Date(rec.date).toLocaleDateString()} • ${rec.type}`}
|
||||
</Typography>
|
||||
</Box>
|
||||
</ListItemButton>
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
|
||||
Reference in New Issue
Block a user