Вы не можете выбрать более 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 {
  7. DISABLED_TRACK_COLOR,
  8. ENABLED_TRACK_COLOR,
  9. THUMB_COLOR
  10. } from '../../../welcome/components/native/settings/components/styles';
  11. import styles from './styles';
  12. /**
  13. * The type of the React {@code Component} props of {@link LobbyModeSwitch}.
  14. */
  15. type Props = {
  16. /**
  17. * True if the lobby mode is currently enabled for this conference.
  18. */
  19. lobbyEnabled: boolean,
  20. /**
  21. * Callback to be invoked when handling enable-disable lobby mode switch.
  22. */
  23. onToggleLobbyMode: Function
  24. };
  25. /**
  26. * Component meant to Enable/Disable lobby mode.
  27. *
  28. * @returns {React$Element<any>}
  29. */
  30. function LobbyModeSwitch(
  31. {
  32. lobbyEnabled,
  33. onToggleLobbyMode
  34. }: Props) {
  35. return (
  36. <View style = { styles.lobbySwitchContainer }>
  37. <Switch
  38. onValueChange = { onToggleLobbyMode }
  39. style = { styles.lobbySwitchIcon }
  40. thumbColor = { THUMB_COLOR }
  41. trackColor = {{
  42. true: ENABLED_TRACK_COLOR,
  43. false: DISABLED_TRACK_COLOR
  44. }}
  45. value = { lobbyEnabled } />
  46. </View>
  47. );
  48. }
  49. export default translate(connect()(LobbyModeSwitch));