2021-10-22 13:23:52 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import { makeStyles } from '@material-ui/styles';
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import ParticipantPaneBaseButton from './ParticipantPaneBaseButton';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Label used for accessibility.
|
|
|
|
*/
|
|
|
|
accessibilityLabel: String,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Children of the component.
|
|
|
|
*/
|
|
|
|
children: string | React$Node,
|
|
|
|
|
|
|
|
/**
|
2021-11-04 21:10:43 +00:00
|
|
|
* Button id.
|
2021-10-22 13:23:52 +00:00
|
|
|
*/
|
|
|
|
id?: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the button is icon button (no text).
|
|
|
|
*/
|
|
|
|
isIconButton?: boolean,
|
|
|
|
|
|
|
|
/**
|
2021-11-04 21:10:43 +00:00
|
|
|
* Click handler.
|
2021-10-22 13:23:52 +00:00
|
|
|
*/
|
|
|
|
onClick: Function
|
|
|
|
}
|
|
|
|
|
|
|
|
const useStyles = makeStyles(theme => {
|
|
|
|
return {
|
|
|
|
button: {
|
|
|
|
padding: `${theme.spacing(2)}px`
|
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
const FooterButton = ({ accessibilityLabel, children, id, isIconButton = false, onClick }: Props) => {
|
|
|
|
const styles = useStyles();
|
|
|
|
|
|
|
|
return (<ParticipantPaneBaseButton
|
|
|
|
accessibilityLabel = { accessibilityLabel }
|
|
|
|
className = { isIconButton ? styles.button : '' }
|
|
|
|
id = { id }
|
|
|
|
onClick = { onClick }>
|
|
|
|
{children}
|
|
|
|
</ParticipantPaneBaseButton>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default FooterButton;
|