sforkowany z mirror/soapbox
Streamfield: labelText, hintText --> label, hint
rodzic
0f341eee6e
commit
9bd18b13bd
|
@ -22,9 +22,9 @@ interface IStreamfield {
|
|||
/** Array of values for the streamfield. */
|
||||
values: any[],
|
||||
/** Input label message. */
|
||||
labelText?: React.ReactNode,
|
||||
label?: React.ReactNode,
|
||||
/** Input hint message. */
|
||||
hintText?: React.ReactNode,
|
||||
hint?: React.ReactNode,
|
||||
/** Callback to add an item. */
|
||||
onAddItem?: () => void,
|
||||
/** Callback to remove an item by index. */
|
||||
|
@ -40,8 +40,8 @@ interface IStreamfield {
|
|||
/** List of inputs that can be added or removed. */
|
||||
const Streamfield: React.FC<IStreamfield> = ({
|
||||
values,
|
||||
labelText,
|
||||
hintText,
|
||||
label,
|
||||
hint,
|
||||
onAddItem,
|
||||
onRemoveItem,
|
||||
onChange,
|
||||
|
@ -61,8 +61,8 @@ const Streamfield: React.FC<IStreamfield> = ({
|
|||
return (
|
||||
<Stack space={4}>
|
||||
<Stack>
|
||||
{labelText && <Text size='sm' weight='medium'>{labelText}</Text>}
|
||||
{hintText && <Text size='xs' theme='muted'>{hintText}</Text>}
|
||||
{label && <Text size='sm' weight='medium'>{label}</Text>}
|
||||
{hint && <Text size='xs' theme='muted'>{hint}</Text>}
|
||||
</Stack>
|
||||
|
||||
<Stack>
|
||||
|
|
|
@ -452,8 +452,8 @@ const EditProfile: React.FC = () => {
|
|||
|
||||
{features.profileFields && (
|
||||
<Streamfield
|
||||
labelText={<FormattedMessage id='edit_profile.fields.meta_fields_label' defaultMessage='Profile fields' />}
|
||||
hintText={<FormattedMessage id='edit_profile.hints.meta_fields' defaultMessage='You can have up to {count, plural, one {# custom field} other {# custom fields}} displayed on your profile.' values={{ count: maxFields }} />}
|
||||
label={<FormattedMessage id='edit_profile.fields.meta_fields_label' defaultMessage='Profile fields' />}
|
||||
hint={<FormattedMessage id='edit_profile.hints.meta_fields' defaultMessage='You can have up to {count, plural, one {# custom field} other {# custom fields}} displayed on your profile.' values={{ count: maxFields }} />}
|
||||
values={data.fields_attributes || []}
|
||||
onChange={handleFieldsChange}
|
||||
onAddItem={handleAddField}
|
||||
|
|
Ładowanie…
Reference in New Issue