redesign PlayButtonGroup to match card styles

This commit is contained in:
jeffvli
2025-11-29 04:02:47 -08:00
parent a99a02c94c
commit 93ba99e36f
4 changed files with 61 additions and 112 deletions
@@ -1,6 +1,6 @@
import clsx from 'clsx';
import { t } from 'i18next';
import { memo } from 'react';
import { forwardRef, memo } from 'react';
import styles from './play-button.module.css';
@@ -85,16 +85,19 @@ interface PlayButtonProps {
onLongPress?: (e: React.MouseEvent<HTMLButtonElement>) => void;
}
export const PlayButton = memo(
({
classNames,
fill,
icon = 'mediaPlay',
isSecondary,
loading,
onClick,
onLongPress,
}: PlayButtonProps) => {
const PlayButtonBase = forwardRef<HTMLButtonElement, PlayButtonProps>(
(
{
classNames,
fill,
icon = 'mediaPlay',
isSecondary,
loading,
onClick,
onLongPress,
}: PlayButtonProps,
ref,
) => {
const clickHandlers = usePlayButtonClick({
loading,
onClick,
@@ -107,6 +110,7 @@ export const PlayButton = memo(
[styles.fill]: fill,
[styles.secondary]: isSecondary,
})}
ref={ref}
{...clickHandlers.handlers}
{...clickHandlers.props}
>
@@ -116,4 +120,6 @@ export const PlayButton = memo(
},
);
export const PlayButton = memo(PlayButtonBase);
PlayButton.displayName = 'PlayButton';