From 2a26757a9827c70c1cea1b21ce5458a1b677030d Mon Sep 17 00:00:00 2001 From: Isaac Visintainer Date: Tue, 25 Jun 2019 16:55:41 -0700 Subject: [PATCH] disallow empty comments --- apps/publish/src/js/components/comments.js | 1 + .../src/js/components/lib/comment-box.js | 84 +++++++++---------- 2 files changed, 43 insertions(+), 42 deletions(-) diff --git a/apps/publish/src/js/components/comments.js b/apps/publish/src/js/components/comments.js index 966474413..73b73a2e2 100644 --- a/apps/publish/src/js/components/comments.js +++ b/apps/publish/src/js/components/comments.js @@ -83,6 +83,7 @@ export class Comments extends Component { diff --git a/apps/publish/src/js/components/lib/comment-box.js b/apps/publish/src/js/components/lib/comment-box.js index 5eeb8c94c..2df2297ce 100644 --- a/apps/publish/src/js/components/lib/comment-box.js +++ b/apps/publish/src/js/components/lib/comment-box.js @@ -2,6 +2,24 @@ import React, { Component } from 'react'; import classnames from 'classnames'; import { Sigil } from '/components/lib/icons/sigil'; +class PostButton extends Component { + render() { + if (this.props.enabled) { + return ( +

+ -> Post +

+ ); + } else { + return ( +

+ -> Post +

+ ); + } + } +} + export class CommentBox extends Component { constructor(props){ super(props); @@ -16,49 +34,31 @@ export class CommentBox extends Component { } render() { - if (this.props.enabled) { - return ( -
-
- -
-
- -

- -> Post -

-
+ let textClass = (this.props.enabled) + ? "body-regular-400 w-100" + : "body-regular-400 w-100 gray-30"; + return ( +
+
+
- ); - } else { - return ( -
-
- -
-
- -

- -> Post -

-
+
+ +
- ); - } +
+ ); } }