Merge branch 'soapbox-config-file' into 'develop'
SoapboxConfig: use new FileInput See merge request soapbox-pub/soapbox-fe!1402
This commit is contained in:
commit
1fbde6bf66
2 changed files with 3 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
import React, { forwardRef } from 'react';
|
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) => {
|
const FileInput = forwardRef<HTMLInputElement, IFileInput>((props, ref) => {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -14,6 +14,7 @@ import {
|
||||||
FormActions,
|
FormActions,
|
||||||
FormGroup,
|
FormGroup,
|
||||||
Input,
|
Input,
|
||||||
|
FileInput,
|
||||||
Textarea,
|
Textarea,
|
||||||
Button,
|
Button,
|
||||||
Toggle,
|
Toggle,
|
||||||
|
@ -199,10 +200,8 @@ const SoapboxConfig: React.FC = () => {
|
||||||
labelText={<FormattedMessage id='soapbox_config.fields.logo_label' defaultMessage='Logo' />}
|
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' />}
|
hintText={<FormattedMessage id='soapbox_config.hints.logo' defaultMessage='SVG. At most 2 MB. Will be displayed to 50px height, maintaining aspect ratio' />}
|
||||||
>
|
>
|
||||||
<input
|
<FileInput
|
||||||
type='file'
|
|
||||||
onChange={handleFileChange(['logo'])}
|
onChange={handleFileChange(['logo'])}
|
||||||
className='text-sm'
|
|
||||||
accept='image/svg,image/png'
|
accept='image/svg,image/png'
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
Loading…
Reference in a new issue