您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

SpeakerStatsSearch.js 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // @flow
  2. import React from 'react';
  3. import { useTranslation } from 'react-i18next';
  4. import { withTheme } from 'react-native-paper';
  5. import { useSelector } from 'react-redux';
  6. import { IconSearch, Icon } from '../../../base/icons';
  7. import ClearableInput from '../../../participants-pane/components/native/ClearableInput';
  8. import { isSpeakerStatsSearchDisabled } from '../../functions';
  9. import styles from './styles';
  10. /**
  11. * The type of the React {@code Component} props of {@link SpeakerStatsSearch}.
  12. */
  13. type Props = {
  14. /**
  15. * The function to initiate the change in the speaker stats table.
  16. */
  17. onSearch: Function,
  18. /**
  19. * Theme used for styles.
  20. */
  21. theme: Object
  22. };
  23. /**
  24. * React component for display an individual user's speaker stats.
  25. *
  26. * @returns {React$Element<any>}
  27. */
  28. function SpeakerStatsSearch({ onSearch, theme }: Props) {
  29. const { t } = useTranslation();
  30. const disableSpeakerStatsSearch = useSelector(isSpeakerStatsSearchDisabled);
  31. if (disableSpeakerStatsSearch) {
  32. return null;
  33. }
  34. return (
  35. <ClearableInput
  36. customStyles = { styles.speakerStatsSearch }
  37. onChange = { onSearch }
  38. placeholder = { t('speakerStats.search') }
  39. placeholderColor = { theme.palette.text03 }
  40. prefixComponent = {
  41. <Icon
  42. color = { theme.palette.text03 }
  43. size = { 20 }
  44. src = { IconSearch }
  45. style = { styles.speakerStatsSearch.searchIcon } />
  46. }
  47. selectionColor = { theme.palette.text01 } />
  48. );
  49. }
  50. export default withTheme(SpeakerStatsSearch);