diff --git a/src/components/category/category.tsx b/src/components/category/category.tsx
index 1542e2e..09407e1 100644
--- a/src/components/category/category.tsx
+++ b/src/components/category/category.tsx
@@ -9,7 +9,7 @@ interface CategoryProps {
sounds: Array<{ label: string; src: string; icon: React.ReactNode }>;
}
-export function Category({ icon, sounds, title }: CategoryProps) {
+export function Category({ icon, id, sounds, title }: CategoryProps) {
return (
@@ -19,7 +19,7 @@ export function Category({ icon, sounds, title }: CategoryProps) {
{title}
-
+
);
}
diff --git a/src/components/sound/sound.module.css b/src/components/sound/sound.module.css
index 0bbbf0c..9bdc89a 100644
--- a/src/components/sound/sound.module.css
+++ b/src/components/sound/sound.module.css
@@ -10,6 +10,10 @@
background: linear-gradient(var(--color-neutral-100), transparent);
text-align: center;
+ &.hidden {
+ display: none;
+ }
+
&:not(.selected)::before {
position: absolute;
top: -1px;
diff --git a/src/components/sound/sound.tsx b/src/components/sound/sound.tsx
index f751832..fd582dc 100644
--- a/src/components/sound/sound.tsx
+++ b/src/components/sound/sound.tsx
@@ -11,9 +11,10 @@ interface SoundProps {
label: string;
src: string;
icon: React.ReactNode;
+ hidden: boolean;
}
-export function Sound({ icon, label, src }: SoundProps) {
+export function Sound({ hidden, icon, label, src }: SoundProps) {
const { isPlaying, play } = usePlay();
const [isSelected, setIsSelected] = useLocalStorage(
`${label}-is-selected`,
@@ -49,7 +50,11 @@ export function Sound({ icon, label, src }: SoundProps) {
return (
diff --git a/src/components/sounds/sounds.module.css b/src/components/sounds/sounds.module.css
index 0732eea..8ebe7bd 100644
--- a/src/components/sounds/sounds.module.css
+++ b/src/components/sounds/sounds.module.css
@@ -4,3 +4,36 @@
gap: 20px;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
+
+.button {
+ position: relative;
+ display: flex;
+ width: max-content;
+ height: 35px;
+ align-items: center;
+ justify-content: center;
+ padding: 0 15px;
+ border: 1px solid var(--color-neutral-200);
+ border-radius: 50px;
+ margin: 25px auto 0;
+ background-color: var(--color-neutral-50);
+ color: var(--color-neutral-subtle);
+ cursor: pointer;
+ font-size: var(--font-xsm);
+
+ &::before {
+ position: absolute;
+ top: -1px;
+ left: 50%;
+ width: 70%;
+ height: 1px;
+ background: linear-gradient(
+ 90deg,
+ transparent,
+ var(--color-neutral-300),
+ transparent
+ );
+ content: '';
+ transform: translateX(-50%);
+ }
+}
diff --git a/src/components/sounds/sounds.tsx b/src/components/sounds/sounds.tsx
index 893d357..0403133 100644
--- a/src/components/sounds/sounds.tsx
+++ b/src/components/sounds/sounds.tsx
@@ -1,17 +1,32 @@
import { Sound } from '@/components/sound';
+import { useLocalStorage } from '@/hooks/use-local-storage';
import styles from './sounds.module.css';
interface SoundsProps {
+ id: string;
sounds: Array<{ label: string; src: string; icon: React.ReactNode }>;
}
-export function Sounds({ sounds }: SoundsProps) {
+export function Sounds({ id, sounds }: SoundsProps) {
+ const [showAll, setShowAll] = useLocalStorage(`${id}-show-more`, false);
+
return (
-
- {sounds.map(sound => (
-
- ))}
+
+
+ {sounds.map((sound, index) => (
+ 3} />
+ ))}
+
+
+ {sounds.length > 4 && (
+
+ )}
);
}