mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-15 07:34:42 -04:00
Adjust editor config (#976)
* Adjust editor config Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Co-authored-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
0180c75e55
commit
e12dc523f8
301 changed files with 4393 additions and 3741 deletions
|
@ -10,7 +10,7 @@ export interface UploadInputProps {
|
|||
onLoad: (file: File) => Promise<void>
|
||||
acceptedFiles: string
|
||||
onClickRef: MutableRefObject<(() => void) | undefined>
|
||||
"data-cy"?: string
|
||||
'data-cy'?: string
|
||||
}
|
||||
|
||||
export const UploadInput: React.FC<UploadInputProps> = ({ onLoad, acceptedFiles, onClickRef, ...props }) => {
|
||||
|
@ -25,11 +25,13 @@ export const UploadInput: React.FC<UploadInputProps> = ({ onLoad, acceptedFiles,
|
|||
return
|
||||
}
|
||||
const file = fileInput.files[0]
|
||||
onLoad(file).then(() => {
|
||||
fileInput.value = ''
|
||||
}).catch((error) => {
|
||||
console.error(error)
|
||||
})
|
||||
onLoad(file)
|
||||
.then(() => {
|
||||
fileInput.value = ''
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(error)
|
||||
})
|
||||
})
|
||||
fileInput.click()
|
||||
}, [onLoad])
|
||||
|
@ -39,6 +41,7 @@ export const UploadInput: React.FC<UploadInputProps> = ({ onLoad, acceptedFiles,
|
|||
})
|
||||
|
||||
return (
|
||||
<input data-cy={props["data-cy"]} type='file' ref={fileInputReference} className='d-none' accept={acceptedFiles}/>
|
||||
<input data-cy={ props['data-cy'] } type='file' ref={ fileInputReference } className='d-none'
|
||||
accept={ acceptedFiles }/>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue