refactor: rename component

This commit is contained in:
MAZE 2023-10-29 18:16:38 +03:30
parent c637e2d631
commit f5cdb8c06b
5 changed files with 6 additions and 6 deletions

View File

@ -5,13 +5,13 @@ import { useSoundStore } from '@/store';
import { cn } from '@/helpers/styles';
import { fade } from '@/lib/motion';
import styles from './like.module.css';
import styles from './favorite.module.css';
interface LikeProps {
interface FavoriteProps {
id: string;
}
export function Like({ id }: LikeProps) {
export function Favorite({ id }: FavoriteProps) {
const isFavorite = useSoundStore(state => state.sounds[id].isFavorite);
const toggleFavorite = useSoundStore(state => state.toggleFavorite);

View File

@ -0,0 +1 @@
export { Favorite } from './favorite';

View File

@ -1 +0,0 @@
export { Like } from './like';

View File

@ -1,7 +1,7 @@
import { useCallback, useEffect } from 'react';
import { Range } from './range';
import { Like } from './like';
import { Favorite } from './favorite';
import { useSound } from '@/hooks/use-sound';
import { useSoundStore } from '@/store';
@ -77,7 +77,7 @@ export function Sound({
onClick={toggle}
onKeyDown={toggle}
>
<Like id={id} />
<Favorite id={id} />
<div className={styles.icon}>{icon}</div>
<h3 id={id}>{label}</h3>
<Range id={id} />