Skip to content
Snippets Groups Projects
Commit 821fdf3e authored by lfr20's avatar lfr20
Browse files

Removed unecessary comment

parent c6e03c14
No related branches found
No related tags found
4 merge requests!57Merge of develop into master,!56Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...,!39Update admin system,!36Fix perfil into develop
......@@ -16,9 +16,9 @@ GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/
import React, {useState, useContext, useEffect} from 'react';
import {Store} from '../Store.js'
import {apiDomain} from '../env';
import React, { useState, useContext, useEffect } from 'react';
import { Store } from '../Store.js'
import { apiDomain } from '../env';
import noAvatar from "../img/default_profile.png";
import Button from '@material-ui/core/Button';
import styled from 'styled-components'
......@@ -35,7 +35,7 @@ import LockIcon from '@material-ui/icons/Lock';
import ColCardOwnerOptions from './ColCardOwnerOptions.js'
import ColCardPublicOptions from './ColCardPublicOptions'
import { Link } from 'react-router-dom';
import {putRequest} from '../Components/HelperFunctions/getAxiosConfig'
import { putRequest } from '../Components/HelperFunctions/getAxiosConfig'
import SignUpModal from './SignUpModal'
import LoginModal from './LoginModal.js'
import Snackbar from '@material-ui/core/Snackbar';
......@@ -58,12 +58,12 @@ export default function CollectionCardFunction(props) {
const [successfulLoginOpen, handleSuccessfulLogin] = useState(false)
function handleSuccessLike (data) {
function handleSuccessLike(data) {
toggleLiked(!liked)
setLikesCount(data.count)
}
const handleLike = () => {
putRequest(`/collections/${props.id}/like`, {}, handleSuccessLike, (error) => {console.log(error)})
putRequest(`/collections/${props.id}/like`, {}, handleSuccessLike, (error) => { console.log(error) })
}
const [followingHover, handleFollowingHover] = useState(false)
......@@ -72,11 +72,11 @@ export default function CollectionCardFunction(props) {
const [slideIn, setSlide] = useState(false)
const controlSlide = () => { setSlide(!slideIn) }
function handleSuccessFollow (data) {
function handleSuccessFollow(data) {
handleToggleUserFollowingCol()
}
const handleFollow = () => {
putRequest(`/collections/${props.id}/follow`, {}, handleSuccessFollow, (error) => {console.log(error)})
putRequest(`/collections/${props.id}/follow`, {}, handleSuccessFollow, (error) => { console.log(error) })
}
const RenderFollowButton = () => {
......@@ -88,49 +88,6 @@ export default function CollectionCardFunction(props) {
}
useEffect(() => {
// setTimeout(function () {
// if (state.currentUser.id) {
// const config = getAxiosConfig();
// axios({
// method: 'get',
// url: `${apiUrl}/users/${state.currentUser.id}/following/Collection`,
// headers: config.headers
// }).then(
// (response) => {
// const data = response.data
// for (let i = 0; i < data.length; i++)
// if (data[i].followable.id === props.id)
// toggleUserFollowingCol(true)
// saveHeaders(response)
// })
// }
// else {
// toggleLiked(false);
// toggleUserFollowingCol(false);
// }
// }, 1000);
// setTimeout(function () {
// if (state.currentUser.id) {
// const config = getAxiosConfig();
// axios({
// method: 'get',
// url: `${apiUrl}/users/${state.currentUser.id}/collections/liked`,
// headers: config.headers
// }).then(
// (response) => {
// const data = response.data
// for (let i = 0; i < data.length; i++)
// if (data[i].id === props.id)
// toggleLiked(true)
// saveHeaders(response)
// })
// }
// else {
// toggleLiked(false);
// toggleUserFollowingCol(false);
// }
// }, 2000);
if (!state.currentUser.id) {
toggleLiked(false);
toggleUserFollowingCol(false);
......@@ -174,15 +131,19 @@ export default function CollectionCardFunction(props) {
<p>{props.author}</p>
</EnviadoPor>
</HeaderContainer>
<TagContainer container direction="row">
{
props.tags.map((tag) =>
<Grid item key={tag.id}>
<span >{tag.name}</span>
</Grid>
)
}
</TagContainer>
{
props.tags ?
<TagContainer container direction="row">
{
props.tags.map((tag) =>
<Grid item key={tag.id}>
<span >{tag.name}</span>
</Grid>
)
}
</TagContainer> :
null
}
</SlideContentDiv>
)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment