mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-12-22 18:22:11 +00:00
[Admin panel] Make Description boxes multi-line (#781)
This commit is contained in:
parent
5d9c6b0e5a
commit
ea902bb500
|
@ -85,6 +85,7 @@ function editableObject(obj, path=[]) {
|
||||||
const hiddenKeys = ["contact_account_", "urls"];
|
const hiddenKeys = ["contact_account_", "urls"];
|
||||||
const explicitShownKeys = ["contact_account_username"];
|
const explicitShownKeys = ["contact_account_username"];
|
||||||
const implementedKeys = "title, contact_account_username, email, short_description, description, terms, avatar, header".split(", ");
|
const implementedKeys = "title, contact_account_username, email, short_description, description, terms, avatar, header".split(", ");
|
||||||
|
const textareaKeys = ["short_description", "description"]
|
||||||
|
|
||||||
let listing = Object.entries(obj).map(([key, val]) => {
|
let listing = Object.entries(obj).map(([key, val]) => {
|
||||||
let fullkey = [...path, key].join("_");
|
let fullkey = [...path, key].join("_");
|
||||||
|
@ -155,11 +156,17 @@ function editableObject(obj, path=[]) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let field;
|
||||||
|
if (textareaKeys.includes(fullkey)) {
|
||||||
|
field = <textarea className={isImplemented} ref={setRef} {...inputProps}></textarea>
|
||||||
|
} else {
|
||||||
|
field = <input className={isImplemented} ref={setRef} {...inputProps} />
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<React.Fragment key={fullkey}>
|
<React.Fragment key={fullkey}>
|
||||||
<label htmlFor={key} className="capitalize">{label}</label>
|
<label htmlFor={key} className="capitalize">{label}</label>
|
||||||
<div className={isImplemented}>
|
<div className={isImplemented}>
|
||||||
<input className={isImplemented} ref={setRef} {...inputProps} />
|
{field}
|
||||||
</div>
|
</div>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue