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.

SpeakerStatsList.js 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // @flow
  2. import { makeStyles } from '@material-ui/core/styles';
  3. import React from 'react';
  4. import { MOBILE_BREAKPOINT } from '../../constants';
  5. import abstractSpeakerStatsList from '../AbstractSpeakerStatsList';
  6. import SpeakerStatsItem from './SpeakerStatsItem';
  7. const useStyles = makeStyles(theme => {
  8. return {
  9. list: {
  10. marginTop: `${theme.spacing(3)}px`,
  11. marginBottom: `${theme.spacing(3)}px`
  12. },
  13. item: {
  14. height: `${theme.spacing(7)}px`,
  15. [theme.breakpoints.down(MOBILE_BREAKPOINT)]: {
  16. height: `${theme.spacing(8)}px`
  17. }
  18. },
  19. avatar: {
  20. height: `${theme.spacing(5)}px`
  21. },
  22. expressions: {
  23. paddingLeft: 29
  24. },
  25. hasLeft: {
  26. color: theme.palette.text03
  27. },
  28. displayName: {
  29. ...theme.typography.bodyShortRegular,
  30. lineHeight: `${theme.typography.bodyShortRegular.lineHeight}px`,
  31. [theme.breakpoints.down(MOBILE_BREAKPOINT)]: {
  32. ...theme.typography.bodyShortRegularLarge,
  33. lineHeight: `${theme.typography.bodyShortRegular.lineHeightLarge}px`
  34. }
  35. },
  36. time: {
  37. padding: '2px 4px',
  38. borderRadius: '4px',
  39. ...theme.typography.labelBold,
  40. lineHeight: `${theme.typography.labelBold.lineHeight}px`,
  41. [theme.breakpoints.down(MOBILE_BREAKPOINT)]: {
  42. ...theme.typography.bodyShortRegularLarge,
  43. lineHeight: `${theme.typography.bodyShortRegular.lineHeightLarge}px`
  44. }
  45. },
  46. dominant: {
  47. backgroundColor: theme.palette.success02
  48. }
  49. };
  50. });
  51. /**
  52. * Component that renders the list of speaker stats.
  53. *
  54. * @returns {React$Element<any>}
  55. */
  56. const SpeakerStatsList = () => {
  57. const classes = useStyles();
  58. const items = abstractSpeakerStatsList(SpeakerStatsItem, classes);
  59. return (
  60. <div className = { classes.list }>
  61. {items}
  62. </div>
  63. );
  64. };
  65. export default SpeakerStatsList;