Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/frontend/src/components/uploadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,17 @@ const FileUploadZone: React.FC<FileUploadZoneProps> = ({
}
}, [fileLimitExceeded]);

// Auto-hide file rejection errors after 10 seconds
useEffect(() => {
if (fileRejectionErrors.length > 0) {
const timer = setTimeout(() => {
setFileRejectionErrors([]);
}, 5000);

return () => clearTimeout(timer);
}
}, [fileRejectionErrors]);

return (
<div style={{ width: '100%', minWidth: '720px', maxWidth: '800px', margin: '0 auto', marginTop: '0', padding: '16px', paddingBottom: '60px' }}>
<ConfirmationDialog
Expand Down Expand Up @@ -562,12 +573,14 @@ const FileUploadZone: React.FC<FileUploadZoneProps> = ({
)}
</div>

<div style={{ display: 'flex', flexDirection: 'column', gap: '13px', width: '837px', paddingBottom: 10, borderRadius: '4px', }}>
<div style={{ display: 'flex', flexDirection: 'column', gap: '13px', width: '880px', paddingBottom: 10, borderRadius: '4px', }}>
{/* Show file rejection errors for invalid type or size */}
{fileRejectionErrors.length > 0 && (
<MessageBar
messageBarType={MessageBarType.error}
isMultiline={true}
onDismiss={() => setFileRejectionErrors([])}
dismissButtonAriaLabel="Close"
styles={messageBarErrorStyles}
>
<div style={{ display: "flex", alignItems: "center" }}>
Expand Down