Hide downvote on mobile when downvotes disabled
authorm52go <mfiver@gmail.com>
Tue, 17 Nov 2020 19:15:55 +0000 (19:15 +0000)
committerGitHub <noreply@github.com>
Tue, 17 Nov 2020 19:15:55 +0000 (19:15 +0000)
To address #79.

src/shared/components/post-listing.tsx

index 809b8d12589b14779d9250085f0c90fd0d39273e..6e5e867f3c9a425b74228f74578e28b49035630b 100644 (file)
@@ -562,7 +562,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
                 </svg>
                 {this.state.upvotes}
               </button>
-              <button
+              {this.props.enableDownvotes && (<button
                 className={`ml-2 btn-animate btn py-0 pl-1 ${
                   this.state.my_vote == -1 ? 'text-danger' : 'text-muted'
                 }`}
@@ -576,6 +576,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
                   <span>{this.state.downvotes}</span>
                 )}
               </button>
+              )}
             </div>
             <button
               class="btn btn-link btn-animate text-muted py-0 pl-1 pr-0"