[bugfix/frontend] Add nosubmit option to form fields + use it when instance custom CSS disabled (#2290)

This commit is contained in:
tobi 2023-10-24 10:28:59 +02:00 committed by GitHub
commit 48a0687736
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 6 deletions

View file

@ -79,7 +79,7 @@ function UserProfileForm({ data: profile }) {
header: useFileInput("header", { withPreview: true }),
displayName: useTextInput("display_name", { source: profile }),
note: useTextInput("note", { source: profile, valueSelector: (p) => p.source?.note }),
customCSS: useTextInput("custom_css", { source: profile }),
customCSS: useTextInput("custom_css", { source: profile, nosubmit: !instanceConfig.allowCustomCSS }),
bot: useBoolInput("bot", { source: profile }),
locked: useBoolInput("locked", { source: profile }),
discoverable: useBoolInput("discoverable", { source: profile}),
@ -190,7 +190,7 @@ function UserProfileForm({ data: profile }) {
</div>
<TextArea
field={form.customCSS}
label="Custom CSS"
label={`Custom CSS` + (!instanceConfig.allowCustomCSS ? ` (not enabled on this instance)` : ``)}
className="monospace"
rows={8}
disabled={!instanceConfig.allowCustomCSS}