Skip to content

Commit 38059d4

Browse files
committed
convert ListenToPlayer into a real button
1 parent c0cc10e commit 38059d4

File tree

1 file changed

+17
-15
lines changed
  • src/components/ListenToPlayer/TopOfPagePlayer

1 file changed

+17
-15
lines changed

src/components/ListenToPlayer/TopOfPagePlayer/index.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { PauseCircleIcon, PlayCircleIcon } from "@/components/icons/listen-to"
2+
import { Button } from "@/components/ui/buttons/Button"
23

34
import { trackCustomEvent } from "@/lib/utils/matomo"
45

@@ -18,20 +19,21 @@ const TopOfPagePlayer = ({
1819
handlePlayPause,
1920
}: TopOfPagePlayerProps) => {
2021
return (
21-
<div className="inline-block w-full rounded-lg bg-background-low p-2 hover:bg-background-medium lg:w-auto">
22-
<div
23-
className="flex cursor-pointer flex-row items-center gap-2 text-primary hover:text-primary-hover"
24-
onClick={() => {
25-
if (startedPlaying) {
26-
trackCustomEvent({
27-
eventCategory: "Audio",
28-
eventAction: "click",
29-
eventName: "start",
30-
})
31-
}
32-
handlePlayPause()
33-
}}
34-
>
22+
<Button
23+
variant="ghost"
24+
className="inline-block w-full rounded-lg bg-background-low p-2 hover:bg-background-medium lg:w-auto"
25+
onClick={() => {
26+
if (startedPlaying) {
27+
trackCustomEvent({
28+
eventCategory: "Audio",
29+
eventAction: "click",
30+
eventName: "start",
31+
})
32+
}
33+
handlePlayPause()
34+
}}
35+
>
36+
<div className="flex flex-row items-center gap-2 text-primary hover:text-primary-hover">
3537
{startedPlaying ? (
3638
isPlaying ? (
3739
<PauseCircleIcon className="h-6 w-6 transition-transform" />
@@ -52,7 +54,7 @@ const TopOfPagePlayer = ({
5254
)}
5355
</div>
5456
</div>
55-
</div>
57+
</Button>
5658
)
5759
}
5860

0 commit comments

Comments
 (0)