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

LobbyModeSwitch.js 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // @flow
  2. import React from 'react';
  3. import { Switch, View } from 'react-native';
  4. import { translate } from '../../../base/i18n';
  5. import { connect } from '../../../base/redux';
  6. import styles, {
  7. ENABLED_THUMB_COLOR,
  8. ENABLED_TRACK_COLOR,
  9. DISABLED_THUMB_COLOR
  10. } from './styles';
  11. /**
  12. * The type of the React {@code Component} props of {@link LobbyModeSwitch}.
  13. */
  14. type Props = {
  15. /**
  16. * True if the lobby mode is currently enabled for this conference.
  17. */
  18. lobbyEnabled: boolean,
  19. /**
  20. * Callback to be invoked when handling enable-disable lobby mode switch.
  21. */
  22. onToggleLobbyMode: Function
  23. };
  24. /**
  25. * Component meant to Enable/Disable lobby mode.
  26. *
  27. * @returns {React$Element<any>}
  28. */
  29. function LobbyModeSwitch(
  30. {
  31. lobbyEnabled,
  32. onToggleLobbyMode
  33. }: Props) {
  34. return (
  35. <View style = { styles.lobbySwitchContainer }>
  36. <Switch
  37. onValueChange = { onToggleLobbyMode }
  38. style = { styles.lobbySwitchIcon }
  39. thumbColor = {
  40. lobbyEnabled
  41. ? ENABLED_THUMB_COLOR
  42. : DISABLED_THUMB_COLOR
  43. }
  44. trackColor = {{ true: ENABLED_TRACK_COLOR }}
  45. value = { lobbyEnabled } />
  46. </View>
  47. );
  48. }
  49. export default translate(connect()(LobbyModeSwitch));