Skip to content

Commit ae8ca5b

Browse files
committed
add background
1 parent 1e056a7 commit ae8ca5b

File tree

1 file changed

+30
-28
lines changed
  • src/components/ListenToPlayer/TopOfPagePlayer

1 file changed

+30
-28
lines changed

src/components/ListenToPlayer/TopOfPagePlayer/index.tsx

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,39 @@ const TopOfPagePlayer = ({
1818
handlePlayPause,
1919
}: TopOfPagePlayerProps) => {
2020
return (
21-
<div
22-
className="flex cursor-pointer flex-row items-center gap-2 text-primary hover:text-primary-hover"
23-
onClick={() => {
24-
if (startedPlaying) {
25-
trackCustomEvent({
26-
eventCategory: "Audio",
27-
eventAction: "click",
28-
eventName: "start",
29-
})
30-
}
31-
handlePlayPause()
32-
}}
33-
>
34-
{startedPlaying ? (
35-
isPlaying ? (
36-
<PauseCircleIcon className="h-6 w-6 transition-transform" />
37-
) : (
38-
<PlayCircleIcon className="h-6 w-6 transition-transform" />
39-
)
40-
) : (
41-
<PlayCircleIcon className="h-6 w-6 transition-transform" />
42-
)}
43-
<div className="text-sm text-body-medium">
21+
<div className="inline-block rounded-lg bg-background-low p-2">
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+
>
4435
{startedPlaying ? (
45-
`${Math.floor(timeRemaining / 60)}:${String(Math.floor(timeRemaining % 60)).padStart(2, "0")}`
36+
isPlaying ? (
37+
<PauseCircleIcon className="h-6 w-6 transition-transform" />
38+
) : (
39+
<PlayCircleIcon className="h-6 w-6 transition-transform" />
40+
)
4641
) : (
47-
<p className="text-primary hover:text-primary-hover">
48-
<strong>Listen to this article</strong> ({Math.round(duration / 60)}{" "}
49-
min)
50-
</p>
42+
<PlayCircleIcon className="h-6 w-6 transition-transform" />
5143
)}
44+
<div className="text-sm text-body-medium">
45+
{startedPlaying ? (
46+
`${Math.floor(timeRemaining / 60)}:${String(Math.floor(timeRemaining % 60)).padStart(2, "0")}`
47+
) : (
48+
<p className="text-primary hover:text-primary-hover">
49+
<strong>Listen to this article</strong> (
50+
{Math.round(duration / 60)} min)
51+
</p>
52+
)}
53+
</div>
5254
</div>
5355
</div>
5456
)

0 commit comments

Comments
 (0)