You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FooterButton.js 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // @flow
  2. import { makeStyles } from '@material-ui/styles';
  3. import React from 'react';
  4. import ParticipantPaneBaseButton from './ParticipantPaneBaseButton';
  5. type Props = {
  6. /**
  7. * Label used for accessibility.
  8. */
  9. accessibilityLabel: String,
  10. /**
  11. * Children of the component.
  12. */
  13. children: string | React$Node,
  14. /**
  15. * Button id.
  16. */
  17. id?: string,
  18. /**
  19. * Whether or not the button is icon button (no text).
  20. */
  21. isIconButton?: boolean,
  22. /**
  23. * Click handler.
  24. */
  25. onClick: Function
  26. }
  27. const useStyles = makeStyles(theme => {
  28. return {
  29. button: {
  30. padding: `${theme.spacing(2)}px`
  31. }
  32. };
  33. });
  34. const FooterButton = ({ accessibilityLabel, children, id, isIconButton = false, onClick }: Props) => {
  35. const styles = useStyles();
  36. return (<ParticipantPaneBaseButton
  37. accessibilityLabel = { accessibilityLabel }
  38. className = { isIconButton ? styles.button : '' }
  39. id = { id }
  40. onClick = { onClick }>
  41. {children}
  42. </ParticipantPaneBaseButton>
  43. );
  44. };
  45. export default FooterButton;