mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 10:23:54 +00:00
40d389acc9
* ux: rename end action * chore: update demo db * style: tweaks on extracted rundown * chore: prevent console logs in production code * feat: go mode * style: remove window size limits * style: rename delete action * style: small tweaks on icons * fix: style override on params * chore: update test db * refactor: small code quality improvements * refactor: prevent circular imports
32 lines
987 B
TypeScript
32 lines
987 B
TypeScript
import { ForwardedRef, forwardRef, PropsWithChildren } from 'react';
|
|
import { Playback } from 'ontime-types';
|
|
|
|
import { cx } from '../../../../common/utils/styleUtils';
|
|
|
|
import style from './TapButton.module.scss';
|
|
|
|
interface TapButtonProps {
|
|
disabled?: boolean;
|
|
aspect?: 'normal' | 'square' | 'fill';
|
|
square?: boolean;
|
|
free?: boolean;
|
|
onClick: () => void;
|
|
theme?: Playback | 'neutral';
|
|
active?: boolean;
|
|
className?: string;
|
|
}
|
|
|
|
const TapButton = forwardRef((props: PropsWithChildren<TapButtonProps>, ref: ForwardedRef<HTMLButtonElement>) => {
|
|
const { children, disabled, onClick, theme = 'neutral', aspect = 'normal', active, className } = props;
|
|
const classes = cx([style.tapButton, className, style[theme], style[aspect], active ? style.active : null]);
|
|
|
|
return (
|
|
<button className={classes} disabled={disabled} type='button' onClick={onClick} ref={ref}>
|
|
{children}
|
|
</button>
|
|
);
|
|
});
|
|
|
|
TapButton.displayName = 'TabButton';
|
|
export default TapButton;
|