Test
Some checks failed
Create and publish a Docker image / Publish image (push) Failing after 36s
Create and publish a Docker image / Deploy image (push) Has been skipped

This commit is contained in:
Dana
2023-08-25 11:16:08 +03:00
parent 172cd1ab64
commit 7d7658d38c
11 changed files with 2848 additions and 226 deletions

View File

@@ -1,4 +1,4 @@
import React, {useState} from 'react';
import React, {useEffect, useState} from 'react';
import TinderCard from 'react-tinder-card';
import './Tinder.css';
@@ -29,13 +29,17 @@ const db = [
const route = props.getValue;
const characters = db;
useEffect(() => {
console.log(characters[0])
});
const characters = props.cardData;
const [lastDirection, setLastDirection] = useState();
const [cardId, setCardId] = useState([]);
const [allIds, setAllIds] = useState([]);
const [cardLenth, setCardLenth] = useState(false);
let uniqueTags = [];
let uniqueTags = [...characters];
let allTags = [];
const swiped = (direction, id) => {
@@ -48,20 +52,20 @@ const db = [
const getId = () => {
uniqueTags = cardId.filter(function(elem, pos) {
return cardId.indexOf(elem) === pos;
});
// uniqueTags = cardId.filter(function(elem, pos) {
// return cardId.indexOf(elem) === pos;
// });
allTags = allIds.filter(function(elem, pos){
return allIds.indexOf(elem) === pos;
});
// allTags = allIds.filter(function(elem, pos){
// return allIds.indexOf(elem) === pos;
// });
characters.length === allTags.length ? setCardLenth(true) : setCardLenth(false);
// characters.length === allTags.length ? setCardLenth(true) : setCardLenth(false);
if(cardLenth) {
route('/map')
}
// if(cardLenth) {
// route('/map')
// }
console.log(uniqueTags);
}
return (
@@ -81,9 +85,9 @@ const db = [
<div className='card'>
<div
className='card-content'
// style={{ backgroundImage: `url(${character.url})` }}
// style={{ backgroundImage: url(${character.url}) }}
>
<h3>{character.name}</h3>
<h3>{props.character.question}</h3>
</div>
</div>
</TinderCard>
@@ -93,4 +97,4 @@ const db = [
);
};
export default Tinder;
export default Tinder;