mirror of
https://github.com/remvze/moodist.git
synced 2025-11-20 13:33:05 -05:00
refactor: rename component
This commit is contained in:
parent
c637e2d631
commit
f5cdb8c06b
@ -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);
|
||||
|
||||
1
src/components/sound/favorite/index.ts
Normal file
1
src/components/sound/favorite/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export { Favorite } from './favorite';
|
||||
@ -1 +0,0 @@
|
||||
export { Like } from './like';
|
||||
@ -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} />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user