Try new way of fixing this nonsense
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
|||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
Textarea,
|
Textarea,
|
||||||
|
useMultiStyleConfig,
|
||||||
useToast,
|
useToast,
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
@@ -46,7 +47,6 @@ export function meta() {
|
|||||||
export default function () {
|
export default function () {
|
||||||
const [fileProgress, setFileProgress] = useState(0);
|
const [fileProgress, setFileProgress] = useState(0);
|
||||||
const [submissionType, setSubmissionType] = useState("exploit");
|
const [submissionType, setSubmissionType] = useState("exploit");
|
||||||
const [fileNames, setFileNames] = useState([] as string[]);
|
|
||||||
const [showSuccess, setShowSuccess] = useState(false);
|
const [showSuccess, setShowSuccess] = useState(false);
|
||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const [uploading, setUploading] = useState(false);
|
const [uploading, setUploading] = useState(false);
|
||||||
@@ -312,26 +312,17 @@ export default function () {
|
|||||||
>
|
>
|
||||||
Select File
|
Select File
|
||||||
</Button>
|
</Button>
|
||||||
<input
|
<Input
|
||||||
id="evidence"
|
id="evidence"
|
||||||
multiple
|
sx={{
|
||||||
onChange={(e) => {
|
"::file-selector-button": {
|
||||||
const names = [];
|
border: "none",
|
||||||
|
outline: "none",
|
||||||
for (let i = 0; i < (e.target.files?.length || 0); i++) {
|
...useMultiStyleConfig("Button", { colorScheme: "blue" }),
|
||||||
const file = e.target.files?.item(i);
|
},
|
||||||
|
|
||||||
if (file) names.push(file.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
setFileNames(names);
|
|
||||||
}}
|
}}
|
||||||
style={{ display: "none" }}
|
|
||||||
type="file"
|
type="file"
|
||||||
/>
|
/>
|
||||||
<Text>
|
|
||||||
{fileNames.length ? fileNames.join(", ") : "No files chosen"}
|
|
||||||
</Text>
|
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<br />
|
<br />
|
||||||
<FormControl>
|
<FormControl>
|
||||||
|
|||||||
Reference in New Issue
Block a user