Add fade transition

This commit is contained in:
2022-06-29 22:58:32 +03:00
parent 9edd961865
commit 641a572fc1
9 changed files with 272 additions and 148 deletions

View File

@@ -5,6 +5,7 @@ import shared from '../styles/Shared.module.scss';
import Performer from '../types/Performer';
import { BiChevronDown, BiChevronLeft } from 'react-icons/bi';
import PerformersData from '../data/performers/2022';
import { CSSTransition } from 'react-transition-group';
interface PerformerCard extends Performer {
id: number;
@@ -65,15 +66,21 @@ const Performers = () => {
)}
</button>
</div>
{p.showDesc && (
<>
{p.paragraphs.map((parag, index) => (
<p className={styles.performerDescription} key={index}>
{parag.toString()}
</p>
))}
</>
)}
<CSSTransition
in={p.showDesc}
timeout={1000}
classNames='fadeTransition'
>
{p.showDesc ? (
<div>
{p.paragraphs.map((parag, index) => (
<p key={index}>{parag.toString()}</p>
))}
</div>
) : (
<span></span>
)}
</CSSTransition>
<hr />
</div>
</div>