fix(site): avoid showing disabled fields in group settings page (#9154)

Previously we allowed interaction with the icon setter and showed
confusing help text under the disabled "Display Name" field.
This commit is contained in:
Ammar Bandukwala
2023-08-17 14:21:36 -05:00
committed by GitHub
parent 2f6687a475
commit 720ad9a653
@@ -57,27 +57,33 @@ const UpdateGroupForm: FC<{
autoFocus
fullWidth
label="Name"
disabled={group.id === group.organization_id}
/>
<TextField
{...getFieldHelpers(
"display_name",
"Optional: keep empty to default to the name.",
)}
onChange={onChangeTrimmed(form)}
autoComplete="display_name"
autoFocus
fullWidth
label="Display Name"
disabled={isEveryoneGroup(group)}
/>
<LazyIconField
{...getFieldHelpers("avatar_url")}
onChange={onChangeTrimmed(form)}
fullWidth
label={t("form.fields.icon")}
onPickEmoji={(value) => form.setFieldValue("avatar_url", value)}
/>
{isEveryoneGroup(group) ? (
<></>
) : (
<>
<TextField
{...getFieldHelpers(
"display_name",
"Optional: keep empty to default to the name.",
)}
onChange={onChangeTrimmed(form)}
autoComplete="display_name"
autoFocus
fullWidth
label="Display Name"
disabled={isEveryoneGroup(group)}
/>
<LazyIconField
{...getFieldHelpers("avatar_url")}
onChange={onChangeTrimmed(form)}
fullWidth
label={t("form.fields.icon")}
onPickEmoji={(value) => form.setFieldValue("avatar_url", value)}
/>
</>
)}
<TextField
{...getFieldHelpers(
"quota_allowance",