Skip to content

Commit

Permalink
minor changes #7
Browse files Browse the repository at this point in the history
  • Loading branch information
ukorvl committed Aug 28, 2023
1 parent 93d34db commit 0ec7df5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/Teachers/Teacher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import {m} from 'framer-motion';
import clsx from 'clsx';
import {useHover} from '@/lib/shared/useHover';
import useDisableRightClick from '@/lib/shared/useDisableRightClick';
import {TeachersListConfigItem} from './teachersListConfig';
import ImageWrapper from '../ImageWrapper/ImageWrapper';
import TeacherInfo from './TeacherInfo';
import useDisableRightClick from '@/lib/shared/useDisableRightClick';

/**
* Props.
Expand Down
16 changes: 13 additions & 3 deletions components/Teachers/TeacherInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import {memo} from 'react';
import clsx from 'clsx';
import {m} from 'framer-motion';
import {TeachersListConfigItem} from './teachersListConfig';

/**
Expand All @@ -23,7 +24,6 @@ const containerCn = clsx(
'items-center',
'w-full',
'h-full',
'pointer-events-none',
'absolute',
'bottom-0',
'left-0',
Expand All @@ -32,17 +32,27 @@ const containerCn = clsx(
);
const nameCn = clsx('text-4xl', 'font-bold', 'text-center', 'pointer-events-auto');

const containerVariants = {
visible: {opacity: 1, y: 0},
hidden: {opacity: 0, y: '2rem', transition: {delay: 0.25}},
};

/**
* @param {TeacherInfoProps} props Props.
* @returns React component.
*/
function TeacherInfo({isVisible, name, danceStyles, subtitle}: TeacherInfoProps) {
return (
<div className={containerCn}>
<m.div
className={containerCn}
animate={isVisible ? 'visible' : 'hidden'}
variants={containerVariants}
transition={{duration: 0.5}}
>
<div className={nameCn}>{name}</div>
<div>{subtitle}</div>
<div>{danceStyles.join(', ')}</div>
</div>
</m.div>
);
}

Expand Down

0 comments on commit 0ec7df5

Please sign in to comment.