From 8038ba9b4d3f2e4300735f010d6f5862316aeddc Mon Sep 17 00:00:00 2001
From: FadhilP <fadhilpradipta0@gmail.com>
Date: Mon, 22 Feb 2021 12:33:02 +0700
Subject: [PATCH] refactor

---
 src/components/thread/Post.jsx           | 6 +-----
 src/components/topic/CreateTopicForm.jsx | 1 +
 src/components/topic/Topic.jsx           | 1 +
 src/components/topic/TopicList.jsx       | 1 +
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/components/thread/Post.jsx b/src/components/thread/Post.jsx
index 1a71e18..1167d57 100644
--- a/src/components/thread/Post.jsx
+++ b/src/components/thread/Post.jsx
@@ -130,11 +130,7 @@ export default function Post(props) {
         <div className="likeSection">
           {loggedIn && (
             <button className="likeButton" onClick={handleLike}>
-              {isLiked ? (
-                <i className="far fa-thumbs-up active" />
-              ) : (
-                <i className="far fa-thumbs-up inactive" />
-              )}
+              <i className={`far fa-thumbs-up ${isLiked ? 'active' : 'inactive'}`} />
             </button>
           )}
           <div className="pointContainer">
diff --git a/src/components/topic/CreateTopicForm.jsx b/src/components/topic/CreateTopicForm.jsx
index c034100..a68631c 100644
--- a/src/components/topic/CreateTopicForm.jsx
+++ b/src/components/topic/CreateTopicForm.jsx
@@ -1,3 +1,4 @@
+/* eslint-disable eqeqeq */
 import axios from 'axios';
 import React, { useState } from 'react';
 import { useInput } from '../../helpers/hooks/input-hook';
diff --git a/src/components/topic/Topic.jsx b/src/components/topic/Topic.jsx
index 050635e..f400dcb 100644
--- a/src/components/topic/Topic.jsx
+++ b/src/components/topic/Topic.jsx
@@ -1,3 +1,4 @@
+/* eslint-disable eqeqeq */
 import React, { useEffect, useState } from 'react';
 import axios from 'axios';
 import ThreadList from '../thread/ThreadList';
diff --git a/src/components/topic/TopicList.jsx b/src/components/topic/TopicList.jsx
index c4ee2ac..12c8fd8 100644
--- a/src/components/topic/TopicList.jsx
+++ b/src/components/topic/TopicList.jsx
@@ -1,3 +1,4 @@
+/* eslint-disable eqeqeq */
 import React, { useEffect, useState } from 'react';
 import axios from 'axios';
 import { Link } from 'react-router-dom';
-- 
GitLab