From f5cdb8c06b44f9cdde27e6e7c7e3d4d156c21dca Mon Sep 17 00:00:00 2001 From: MAZE Date: Sun, 29 Oct 2023 18:16:38 +0330 Subject: [PATCH] refactor: rename component --- .../{like/like.module.css => favorite/favorite.module.css} | 0 .../sound/{like/like.tsx => favorite/favorite.tsx} | 6 +++--- src/components/sound/favorite/index.ts | 1 + src/components/sound/like/index.ts | 1 - src/components/sound/sound.tsx | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) rename src/components/sound/{like/like.module.css => favorite/favorite.module.css} (100%) rename src/components/sound/{like/like.tsx => favorite/favorite.tsx} (89%) create mode 100644 src/components/sound/favorite/index.ts delete mode 100644 src/components/sound/like/index.ts diff --git a/src/components/sound/like/like.module.css b/src/components/sound/favorite/favorite.module.css similarity index 100% rename from src/components/sound/like/like.module.css rename to src/components/sound/favorite/favorite.module.css diff --git a/src/components/sound/like/like.tsx b/src/components/sound/favorite/favorite.tsx similarity index 89% rename from src/components/sound/like/like.tsx rename to src/components/sound/favorite/favorite.tsx index 83578c7..64f122b 100644 --- a/src/components/sound/like/like.tsx +++ b/src/components/sound/favorite/favorite.tsx @@ -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); diff --git a/src/components/sound/favorite/index.ts b/src/components/sound/favorite/index.ts new file mode 100644 index 0000000..664eb85 --- /dev/null +++ b/src/components/sound/favorite/index.ts @@ -0,0 +1 @@ +export { Favorite } from './favorite'; diff --git a/src/components/sound/like/index.ts b/src/components/sound/like/index.ts deleted file mode 100644 index 3ed75f1..0000000 --- a/src/components/sound/like/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Like } from './like'; diff --git a/src/components/sound/sound.tsx b/src/components/sound/sound.tsx index afda6cd..93742bc 100644 --- a/src/components/sound/sound.tsx +++ b/src/components/sound/sound.tsx @@ -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} > - +
{icon}

{label}