mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-25 05:44:13 -05:00
Also use a div for the title so it doesn't use scrollbars and fix the alignment
This commit is contained in:
parent
c039a29189
commit
1d72806914
1 changed files with 18 additions and 12 deletions
|
@ -29,18 +29,24 @@ const StudioTitle = ({
|
|||
});
|
||||
return (
|
||||
<div className="studio-info-section">
|
||||
<textarea
|
||||
className={fieldClassName}
|
||||
disabled={isMutating || !canEditInfo || isFetching}
|
||||
defaultValue={title}
|
||||
onKeyDown={e => e.key === 'Enter' && e.target.blur()}
|
||||
onBlur={e => e.target.value !== title &&
|
||||
handleUpdate(e.target.value)}
|
||||
/>
|
||||
{titleError && <ValidationMessage
|
||||
mode="error"
|
||||
message={<FormattedMessage id={errorToMessageId(titleError)} />}
|
||||
/>}
|
||||
{canEditInfo ? (
|
||||
<React.Fragment>
|
||||
<textarea
|
||||
className={fieldClassName}
|
||||
disabled={isMutating || !canEditInfo || isFetching}
|
||||
defaultValue={title}
|
||||
onKeyDown={e => e.key === 'Enter' && e.target.blur()}
|
||||
onBlur={e => e.target.value !== title &&
|
||||
handleUpdate(e.target.value)}
|
||||
/>
|
||||
{titleError && <ValidationMessage
|
||||
mode="error"
|
||||
message={<FormattedMessage id={errorToMessageId(titleError)} />}
|
||||
/>}
|
||||
</React.Fragment>
|
||||
) : (
|
||||
<div className={fieldClassName}>{title}</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue