diff --git a/.eslintrc.json b/.eslintrc.json index 651ba006..f289dccb 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -49,6 +49,7 @@ "prettier/prettier": "error", "quote-props": 0, "unicorn/filename-case": 0, - "jsx-a11y/media-has-caption": 0 + "jsx-a11y/media-has-caption": 0, + "jsx-a11y/label-has-associated-control": 0 } } diff --git a/src/assets/symbols.svg b/src/assets/symbols.svg index 64002a32..87d63361 100644 --- a/src/assets/symbols.svg +++ b/src/assets/symbols.svg @@ -292,5 +292,8 @@ + + + diff --git a/src/shared/components/common/post-hidden-select.tsx b/src/shared/components/common/post-hidden-select.tsx index 6bb9e323..e59069e1 100644 --- a/src/shared/components/common/post-hidden-select.tsx +++ b/src/shared/components/common/post-hidden-select.tsx @@ -5,9 +5,6 @@ import { tippyMixin } from "../mixins/tippy-mixin"; import { Component, linkEvent } from "inferno"; import { I18NextService } from "../../services/I18NextService"; -// Need to disable this rule because ESLint flat out lies about labels not -// having an associated control in this component -/* eslint-disable jsx-a11y/label-has-associated-control */ interface PostHiddenSelectProps { showHidden?: StringBoolean; onShowHiddenChange: (hidden?: StringBoolean) => void; diff --git a/src/shared/components/home/site-form.tsx b/src/shared/components/home/site-form.tsx index 18af5fa2..5d67e078 100644 --- a/src/shared/components/home/site-form.tsx +++ b/src/shared/components/home/site-form.tsx @@ -116,6 +116,8 @@ export class SiteForm extends Component { this.handleInstanceTextChange = this.handleInstanceTextChange.bind(this); this.handleBlockedUrlsUpdate = this.handleBlockedUrlsUpdate.bind(this); + this.handleSiteContentWarningChange = + this.handleSiteContentWarningChange.bind(this); } render() { @@ -269,6 +271,25 @@ export class SiteForm extends Component { + {this.state.siteForm.enable_nsfw && ( + + + + Setting a content warning will display a prompt with the content + warning asking for their consent to continue. + + Content Warning + + + + + )} { }, })); } + + handleSiteContentWarningChange(val: string) { + this.setState(s => ((s.siteForm.content_warning = val), s)); + } }