Fakultas Ilmu Komputer UI

Commit 0826b12d authored by Jonathan's avatar Jonathan
Browse files

Merge branch 'master' into 'jonathan'

# Conflicts:
#   public/index.html
parents 6be604ad 8038ba9b
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<meta name="theme-color" content="#000000" /> <meta name="theme-color" content="#000000" />
<meta <meta
name="description" 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" /> <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!-- <!--
......
...@@ -130,11 +130,7 @@ export default function Post(props) { ...@@ -130,11 +130,7 @@ export default function Post(props) {
<div className="likeSection"> <div className="likeSection">
{loggedIn && ( {loggedIn && (
<button className="likeButton" onClick={handleLike}> <button className="likeButton" onClick={handleLike}>
{isLiked ? ( <i className={`far fa-thumbs-up ${isLiked ? 'active' : 'inactive'}`} />
<i className="far fa-thumbs-up active" />
) : (
<i className="far fa-thumbs-up inactive" />
)}
</button> </button>
)} )}
<div className="pointContainer"> <div className="pointContainer">
......
/* eslint-disable eqeqeq */
import axios from 'axios'; import axios from 'axios';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { useInput } from '../../helpers/hooks/input-hook'; import { useInput } from '../../helpers/hooks/input-hook';
......
/* eslint-disable eqeqeq */
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import axios from 'axios'; import axios from 'axios';
import ThreadList from '../thread/ThreadList'; import ThreadList from '../thread/ThreadList';
......
/* eslint-disable eqeqeq */
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import axios from 'axios'; import axios from 'axios';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
......
export default function authHeader() { export default function authHeader() {
const user = JSON.parse(localStorage.getItem('user')); const user = JSON.parse(localStorage.getItem('user'));
if (user && user.tokenId) if (user?.tokenId)
return { Authorization: `Bearer ${user.accessToken}` }; return { Authorization: `Bearer ${user?.accessToken}` };
else if (user && user.data.token) else if (user?.data?.token)
// kalo make google // kalo make google
return { Authorization: `Bearer ${user.data.token}` }; return { Authorization: `Bearer ${user?.data.token}` };
// if (user && user.token) // if (user && user.token)
// return { Authorization: `Bearer ${user.token}` } // return { Authorization: `Bearer ${user.token}` }
else return {}; else return {};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment