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.

SubjectText.js 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* @flow */
  2. import React from 'react';
  3. import { getConferenceName } from '../../../base/conference/functions';
  4. import { connect } from '../../../base/redux';
  5. import { Tooltip } from '../../../base/tooltip';
  6. type Props = {
  7. /**
  8. * The conference display name.
  9. */
  10. _subject: string
  11. }
  12. /**
  13. * Label for the conference name.
  14. *
  15. * @param {Props} props - The props of the component.
  16. * @returns {ReactElement}
  17. */
  18. const SubjectText = ({ _subject }: Props) => (
  19. <div className = 'subject-text'>
  20. <Tooltip
  21. content = { _subject }
  22. position = 'bottom'>
  23. <div className = 'subject-text--content'>{ _subject }</div>
  24. </Tooltip>
  25. </div>
  26. );
  27. /**
  28. * Maps (parts of) the Redux state to the associated
  29. * {@code Subject}'s props.
  30. *
  31. * @param {Object} state - The Redux state.
  32. * @private
  33. * @returns {{
  34. * _subject: string,
  35. * }}
  36. */
  37. function _mapStateToProps(state) {
  38. return {
  39. _subject: getConferenceName(state)
  40. };
  41. }
  42. export default connect(_mapStateToProps)(SubjectText);