From fca8e6a0a9308340e88ad291c89c40e7d17f27be Mon Sep 17 00:00:00 2001
From: Dessalines <tyhou13@gmx.com>
Date: Wed, 11 Dec 2019 12:21:47 -0800
Subject: Adding some site oriented settings.

- Adding option to close registration. Fixes #350
- Adding option to disable showing NSFW buttons. Fixes #364
- Adding option to disable downvotes. Fixes #239
---
 ui/src/components/community-form.tsx | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

(limited to 'ui/src/components/community-form.tsx')

diff --git a/ui/src/components/community-form.tsx b/ui/src/components/community-form.tsx
index e6c8ef09..d5efb432 100644
--- a/ui/src/components/community-form.tsx
+++ b/ui/src/components/community-form.tsx
@@ -156,21 +156,24 @@ export class CommunityForm extends Component<
             </select>
           </div>
         </div>
-        <div class="form-group row">
-          <div class="col-12">
-            <div class="form-check">
-              <input
-                class="form-check-input"
-                type="checkbox"
-                checked={this.state.communityForm.nsfw}
-                onChange={linkEvent(this, this.handleCommunityNsfwChange)}
-              />
-              <label class="form-check-label">
-                <T i18nKey="nsfw">#</T>
-              </label>
+
+        {WebSocketService.Instance.site.enable_nsfw && (
+          <div class="form-group row">
+            <div class="col-12">
+              <div class="form-check">
+                <input
+                  class="form-check-input"
+                  type="checkbox"
+                  checked={this.state.communityForm.nsfw}
+                  onChange={linkEvent(this, this.handleCommunityNsfwChange)}
+                />
+                <label class="form-check-label">
+                  <T i18nKey="nsfw">#</T>
+                </label>
+              </div>
             </div>
           </div>
-        </div>
+        )}
         <div class="form-group row">
           <div class="col-12">
             <button type="submit" class="btn btn-secondary mr-2">
-- 
cgit v1.2.3

