diff --git a/app/soapbox/actions/me.js b/app/soapbox/actions/me.js index 8bbcc5fd8..96afcab7d 100644 --- a/app/soapbox/actions/me.js +++ b/app/soapbox/actions/me.js @@ -59,18 +59,12 @@ const persistAuthAccount = (account, params) => { } }; -export function patchMe(params, formData = false) { +export function patchMe(params) { return (dispatch, getState) => { dispatch(patchMeRequest()); - const options = formData ? { - headers: { - 'Content-Type': 'multipart/form-data', - }, - } : {}; - return api(getState) - .patch('/api/v1/accounts/update_credentials', params, options) + .patch('/api/v1/accounts/update_credentials', params) .then(response => { persistAuthAccount(response.data, params); dispatch(patchMeSuccess(response.data)); diff --git a/app/soapbox/components/ui/form-group/form-group.tsx b/app/soapbox/components/ui/form-group/form-group.tsx index fe78d4615..e70bc5836 100644 --- a/app/soapbox/components/ui/form-group/form-group.tsx +++ b/app/soapbox/components/ui/form-group/form-group.tsx @@ -3,9 +3,9 @@ import { v4 as uuidv4 } from 'uuid'; interface IFormGroup { /** Input label message. */ - hintText?: string | React.ReactNode, + labelText: React.ReactNode, /** Input hint message. */ - labelText: string | React.ReactNode, + hintText?: React.ReactNode, /** Input errors. */ errors?: string[] } diff --git a/app/soapbox/components/ui/input/input.tsx b/app/soapbox/components/ui/input/input.tsx index 67c32c3b9..14bbeb60d 100644 --- a/app/soapbox/components/ui/input/input.tsx +++ b/app/soapbox/components/ui/input/input.tsx @@ -18,6 +18,8 @@ interface IInput extends Pick, 'maxL defaultValue?: string, /** Extra class names for the element. */ className?: string, + /** Extra class names for the outer
element. */ + outerClassName?: string, /** URL to the svg icon. */ icon?: string, /** Internal input name. */ @@ -37,7 +39,7 @@ const Input = React.forwardRef( (props, ref) => { const intl = useIntl(); - const { type = 'text', icon, className, ...filteredProps } = props; + const { type = 'text', icon, className, outerClassName, ...filteredProps } = props; const [revealed, setRevealed] = React.useState(false); @@ -48,7 +50,7 @@ const Input = React.forwardRef( }, []); return ( -
+
{icon ? (
- {/* */} - {/* -
-
- - - - - { - this.state.fields.map((field, i) => ( -
- - - { - this.state.fields.size > 4 && - } -
- )) - } - { - this.state.fields.size < maxFields && ( -
-
- - -
-
- ) - } -
-
-
*/} - {/* */} + {features.profileFields && ( + } + hintText={} + values={data.fields_attributes || []} + onChange={handleFieldsChange} + onAddItem={handleAddField} + onRemoveItem={handleRemoveField} + component={ProfileField} + maxItems={maxFields} + /> + )} +