import React from 'react'; import Toggle from '/imports/ui/components/common/switch/component'; import { defineMessages, injectIntl } from 'react-intl'; import BaseMenu from '../base/component'; import Styled from './styles'; const intlMessages = defineMessages({ dataSavingLabel: { id: 'app.settings.dataSavingTab.label', description: 'label for data savings tab', }, webcamLabel: { id: 'app.settings.dataSavingTab.webcam', description: 'webcam toggle', }, screenShareLabel: { id: 'app.settings.dataSavingTab.screenShare', description: 'screenshare toggle', }, dataSavingDesc: { id: 'app.settings.dataSavingTab.description', description: 'description of data savings tab', }, }); class DataSaving extends BaseMenu { constructor(props) { super(props); this.state = { settingsName: 'dataSaving', settings: props.settings, }; } render() { const { intl, showToggleLabel, displaySettingsStatus, isScreenSharingEnabled, isVideoEnabled, } = this.props; const { viewParticipantsWebcams, viewScreenshare } = this.state.settings; return (
{intl.formatMessage(intlMessages.dataSavingLabel)} {intl.formatMessage(intlMessages.dataSavingDesc)}
{isVideoEnabled ? ( {intl.formatMessage(intlMessages.webcamLabel)} {displaySettingsStatus(viewParticipantsWebcams)} this.handleToggle('viewParticipantsWebcams')} ariaLabelledBy="webcamToggle" ariaLabel={`${intl.formatMessage(intlMessages.webcamLabel)} - ${displaySettingsStatus(viewParticipantsWebcams, true)}`} showToggleLabel={showToggleLabel} /> ) : null} {isScreenSharingEnabled ? ( {intl.formatMessage(intlMessages.screenShareLabel)} {displaySettingsStatus(viewScreenshare)} this.handleToggle('viewScreenshare')} ariaLabelledBy="screenShare" ariaLabel={`${intl.formatMessage(intlMessages.screenShareLabel)} - ${displaySettingsStatus(viewScreenshare, true)}`} showToggleLabel={showToggleLabel} /> ) : null}
); } } export default injectIntl(DataSaving);