Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

ActionButton.js 999B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // @flow
  2. import React from 'react';
  3. const classNameByType = {
  4. primary: 'prejoin-btn--primary',
  5. secondary: 'prejoin-btn--secondary',
  6. text: 'prejoin-btn--text'
  7. };
  8. type Props = {
  9. /**
  10. * Text of the button.
  11. */
  12. children: React$Node,
  13. /**
  14. * Text css class of the button.
  15. */
  16. className?: string,
  17. /**
  18. * The type of th button: primary, secondary, text.
  19. */
  20. type: string,
  21. /**
  22. * OnClick button handler.
  23. */
  24. onClick: Function,
  25. };
  26. /**
  27. * Button used for prejoin actions: Join/Join without audio/Join by phone.
  28. *
  29. * @returns {ReactElement}
  30. */
  31. function ActionButton({ children, className, type, onClick }: Props) {
  32. const ownClassName = `prejoin-btn ${classNameByType[type]}`;
  33. const cls = className ? `${className} ${ownClassName}` : ownClassName;
  34. return (
  35. <div
  36. className = { cls }
  37. onClick = { onClick }>
  38. {children}
  39. </div>
  40. );
  41. }
  42. export default ActionButton;