diff --git a/public/index.html b/public/index.html index 22ec4fc66a70042c3034ff27d7bca6cd8821f761..7b3f85f86c1fb4411f71b99644a48e466a798e7b 100644 --- a/public/index.html +++ b/public/index.html @@ -11,7 +11,7 @@ <meta name="theme-color" content="#000000" /> <meta name="description" - content="Forum based website created for Functional Programming courses project" + content="Forum based website created for Functional Programming course project" /> <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> <!-- diff --git a/src/components/thread/Post.jsx b/src/components/thread/Post.jsx index 1a71e18c82de7c73b1c38d4fda267eacc98e142f..1167d57855fd34411c35d2affc1634cb09aed1cb 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 c0341000983930fb6ace2a19b734be98241c0103..a68631c50bc0a03f7b24f91c3eeaf0f17fe2ff80 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 050635eecca5b6f65e5fd688747eaca6a013f64a..f400dcb8f77ac6f3305970193155833c18453975 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 c4ee2acf42096bf4a8796bb3f5396e3592ea9889..12c8fd840f7e33df50854bca7ebfda2baa571bf3 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'; diff --git a/src/helpers/services/authHeader.service.js b/src/helpers/services/authHeader.service.js index dc2af1e25195690d3d5ef2e5b9b9c78aa70a6756..e909b9f39f1a75f8b2e39ff4960cfb1c4b53dae8 100644 --- a/src/helpers/services/authHeader.service.js +++ b/src/helpers/services/authHeader.service.js @@ -1,11 +1,11 @@ export default function authHeader() { const user = JSON.parse(localStorage.getItem('user')); - if (user && user.tokenId) - return { Authorization: `Bearer ${user.accessToken}` }; - else if (user && user.data.token) + if (user?.tokenId) + return { Authorization: `Bearer ${user?.accessToken}` }; + else if (user?.data?.token) // kalo make google - return { Authorization: `Bearer ${user.data.token}` }; + return { Authorization: `Bearer ${user?.data.token}` }; // if (user && user.token) // return { Authorization: `Bearer ${user.token}` } else return {};