2021-10-22 13:23:52 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import { makeStyles } from '@material-ui/styles';
|
|
|
|
import React from 'react';
|
|
|
|
|
2021-09-14 15:31:30 +00:00
|
|
|
import { QuickActionButton } from '../../../base/components';
|
2021-10-22 13:23:52 +00:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Label used for accessibility.
|
|
|
|
*/
|
|
|
|
accessibilityLabel: string,
|
|
|
|
|
|
|
|
/**
|
2021-11-04 21:10:43 +00:00
|
|
|
* Component children.
|
2021-10-22 13:23:52 +00:00
|
|
|
*/
|
|
|
|
children: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Button class name.
|
|
|
|
*/
|
|
|
|
className?: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Click handler function.
|
|
|
|
*/
|
|
|
|
onClick: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the button is secondary.
|
|
|
|
*/
|
|
|
|
secondary?: boolean,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Data test id.
|
|
|
|
*/
|
|
|
|
testId: string
|
|
|
|
}
|
|
|
|
|
|
|
|
const useStyles = makeStyles(theme => {
|
|
|
|
return {
|
|
|
|
secondary: {
|
|
|
|
backgroundColor: theme.palette.ui04
|
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
const LobbyParticipantQuickAction = ({
|
|
|
|
accessibilityLabel,
|
|
|
|
children,
|
|
|
|
className,
|
|
|
|
onClick,
|
|
|
|
secondary = false,
|
|
|
|
testId
|
|
|
|
}: Props) => {
|
|
|
|
const styles = useStyles();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<QuickActionButton
|
|
|
|
accessibilityLabel = { accessibilityLabel }
|
|
|
|
className = { `${secondary ? styles.secondary : ''} ${className ?? ''}` }
|
|
|
|
onClick = { onClick }
|
|
|
|
testId = { testId }>
|
|
|
|
{children}
|
|
|
|
</QuickActionButton>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default LobbyParticipantQuickAction;
|