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.

Label.js 889B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // @flow
  2. import React from 'react';
  3. type Props = {
  4. /**
  5. * The text for the Label.
  6. */
  7. children: React$Node,
  8. /**
  9. * The CSS class of the label.
  10. */
  11. className?: string,
  12. /**
  13. * The (round) number prefix for the Label.
  14. */
  15. number?: string | number,
  16. /**
  17. * The click handler.
  18. */
  19. onClick?: Function,
  20. };
  21. /**
  22. * Label for the dialogs.
  23. *
  24. * @returns {ReactElement}
  25. */
  26. function Label({ children, className, number, onClick }: Props) {
  27. const containerClass = className
  28. ? `prejoin-dialog-label ${className}`
  29. : 'prejoin-dialog-label';
  30. return (
  31. <div
  32. className = { containerClass }
  33. onClick = { onClick }>
  34. {number && <div className = 'prejoin-dialog-label-num'>{number}</div>}
  35. <span>{children}</span>
  36. </div>
  37. );
  38. }
  39. export default Label;