aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/reportManager/ReportManager.tsx
diff options
context:
space:
mode:
authorSophie Zhang <sophie_zhang@brown.edu>2023-09-22 03:14:03 -0400
committerSophie Zhang <sophie_zhang@brown.edu>2023-09-22 03:14:03 -0400
commit51d74db190ba898af9f62906ccfd1da097330fb4 (patch)
tree0f789117c43cacce5227cde67cc21aed505c8586 /src/client/util/reportManager/ReportManager.tsx
parentdaa2bc99bf36e7f2994f6824d9ead3d4b0ffb33f (diff)
fix: fix report manager for videos, only add _l suffix for images
Diffstat (limited to 'src/client/util/reportManager/ReportManager.tsx')
-rw-r--r--src/client/util/reportManager/ReportManager.tsx28
1 files changed, 9 insertions, 19 deletions
diff --git a/src/client/util/reportManager/ReportManager.tsx b/src/client/util/reportManager/ReportManager.tsx
index 802a2f09f..e8c69f909 100644
--- a/src/client/util/reportManager/ReportManager.tsx
+++ b/src/client/util/reportManager/ReportManager.tsx
@@ -333,25 +333,15 @@ export class ReportManager extends React.Component<{}> {
fillWidth
/>
</div>
- <Dropzone
- onDrop={this.onDrop}
- accept={{
- 'image/*': ['.png', '.jpg', '.jpeg', '.gif'],
- 'video/*': ['.mp4', '.mpeg', '.webm', '.mov'],
- 'audio/mpeg': ['.mp3'],
- 'audio/wav': ['.wav'],
- 'audio/ogg': ['.ogg'],
- }}>
- {({ getRootProps, getInputProps }) => (
- <div {...getRootProps({ className: 'dropzone' })} style={{ borderColor: isDarkMode(StrCast(Doc.UserDoc().userBackgroundColor)) ? darkColors.border : lightColors.border }}>
- <input {...getInputProps()} />
- <div className="dropzone-instructions">
- <AiOutlineUpload size={25} />
- <p>Drop or select media that shows the bug (optional)</p>
- </div>
- </div>
- )}
- </Dropzone>
+ <input
+ type="file"
+ accept="image/*, video/*, audio/*"
+ multiple
+ onChange={e => {
+ if (!e.target.files) return;
+ this.setFormData({ ...this.formData, mediaFiles: [...this.formData.mediaFiles, ...Array.from(e.target.files).map(file => ({ _id: v4(), file }))] });
+ }}
+ />
{this.formData.mediaFiles.length > 0 && <ul className="file-list">{this.formData.mediaFiles.map(file => this.getMediaPreview(file))}</ul>}
{this.submitting ? (
<Button