chore: UX design audit cleanup and receipt flow improvements #186
@@ -47,11 +47,17 @@ export const AddReceiptDialog: React.FC<AddReceiptDialogProps> = ({
|
||||
file.name.toLowerCase().endsWith('.heif')
|
||||
);
|
||||
}
|
||||
if (format === 'application/pdf') {
|
||||
return (
|
||||
file.type === 'application/pdf' ||
|
||||
file.name.toLowerCase().endsWith('.pdf')
|
||||
);
|
||||
}
|
||||
return file.type === format;
|
||||
});
|
||||
|
||||
if (!isValidType) {
|
||||
return 'Invalid file type. Accepted formats: JPEG, PNG, HEIC';
|
||||
return 'Invalid file type. Accepted formats: JPEG, PNG, HEIC, PDF';
|
||||
}
|
||||
|
||||
if (file.size > DEFAULT_MAX_FILE_SIZE) {
|
||||
@@ -207,10 +213,10 @@ export const AddReceiptDialog: React.FC<AddReceiptDialogProps> = ({
|
||||
textAlign="center"
|
||||
fontWeight={500}
|
||||
>
|
||||
{isDragging ? 'Drop image here' : 'Drag and drop an image, or tap to browse'}
|
||||
{isDragging ? 'Drop file here' : 'Drag and drop an image or PDF, or tap to browse'}
|
||||
</Typography>
|
||||
<Typography variant="caption" color="text.secondary" textAlign="center">
|
||||
JPEG, PNG, HEIC -- up to 10MB
|
||||
JPEG, PNG, HEIC, PDF -- up to 10MB
|
||||
</Typography>
|
||||
</Box>
|
||||
|
||||
@@ -265,7 +271,7 @@ export const AddReceiptDialog: React.FC<AddReceiptDialogProps> = ({
|
||||
accept={DEFAULT_ACCEPTED_FORMATS.join(',')}
|
||||
onChange={handleInputChange}
|
||||
style={{ display: 'none' }}
|
||||
aria-label="Select receipt image"
|
||||
aria-label="Select receipt file"
|
||||
/>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
@@ -127,6 +127,7 @@ export const DEFAULT_ACCEPTED_FORMATS = [
|
||||
'image/png',
|
||||
'image/heic',
|
||||
'image/heif',
|
||||
'application/pdf',
|
||||
];
|
||||
|
||||
/** Default max file size (10MB) */
|
||||
|
||||
Reference in New Issue
Block a user