SoapboxConfig: use new FileInput

soapbox-json-api
Alex Gleason 2 years ago
parent 02edd5cd36
commit 673b4a38b9
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

@ -1,6 +1,6 @@
import React, { forwardRef } from 'react';
interface IFileInput extends Pick<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'required' | 'disabled' | 'name'> { }
interface IFileInput extends Pick<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'required' | 'disabled' | 'name' | 'accept'> { }
const FileInput = forwardRef<HTMLInputElement, IFileInput>((props, ref) => {
return (

@ -14,6 +14,7 @@ import {
FormActions,
FormGroup,
Input,
FileInput,
Textarea,
Button,
Toggle,
@ -199,10 +200,8 @@ const SoapboxConfig: React.FC = () => {
labelText={<FormattedMessage id='soapbox_config.fields.logo_label' defaultMessage='Logo' />}
hintText={<FormattedMessage id='soapbox_config.hints.logo' defaultMessage='SVG. At most 2 MB. Will be displayed to 50px height, maintaining aspect ratio' />}
>
<input
type='file'
<FileInput
onChange={handleFileChange(['logo'])}
className='text-sm'
accept='image/svg,image/png'
/>
</FormGroup>

Loading…
Cancel
Save