diff --git a/src/components/Tinder/Tinder.js b/src/components/Tinder/Tinder.js index 0d9a7b7..c01b282 100644 --- a/src/components/Tinder/Tinder.js +++ b/src/components/Tinder/Tinder.js @@ -1,4 +1,4 @@ -import React, {useEffect, useState} from 'react'; +import React, {useState} from 'react'; import TinderCard from 'react-tinder-card'; import './Tinder.css'; @@ -23,40 +23,29 @@ const db = [ id: 5, name: 'Dinesh Chugtai', } - ] + ]; const Tinder = () => { const characters = db; const [lastDirection, setLastDirection] = useState(); const [cardId, setCardId] = useState([]); - const swiped = (direction, nameToDelete, id) => { - console.log('removing: ' + nameToDelete); + const swiped = (direction, id) => { setLastDirection(direction); if (direction === 'right') { cardId.push(id); }; - console.log(cardId); - }; - - const outOfFrame = (name) => { - console.log(name + ' left the screen!'); }; - useEffect(() => { - let uniqueTags = []; - if (cardId.length === 1) { - uniqueTags = cardId.filter(function(elem, pos) { - return cardId.indexOf(elem) === pos;}) - console.log(uniqueTags); - } - }) - // const getId = () => { - // uniqueTags = cardId.filter(function(elem, pos) { - // return cardId.indexOf(elem) === pos; - // }); - // console.log(uniqueTags); - // } + + let uniqueTags = []; + + const getId = () => { + uniqueTags = cardId.filter(function(elem, pos) { + return cardId.indexOf(elem) === pos; + }); + console.log(uniqueTags); + } return (