2018-01-30 19:20:51 +08:00
|
|
|
import React from 'react';
|
2022-02-15 23:58:28 +08:00
|
|
|
import Toggle from '/imports/ui/components/common/switch/component';
|
2018-01-30 19:20:51 +08:00
|
|
|
import { defineMessages, injectIntl } from 'react-intl';
|
|
|
|
import BaseMenu from '../base/component';
|
2021-11-05 22:06:47 +08:00
|
|
|
import Styled from './styles';
|
2018-01-30 19:20:51 +08:00
|
|
|
|
|
|
|
const intlMessages = defineMessages({
|
2018-01-31 00:32:37 +08:00
|
|
|
dataSavingLabel: {
|
2018-02-06 21:33:48 +08:00
|
|
|
id: 'app.settings.dataSavingTab.label',
|
2018-01-30 19:20:51 +08:00
|
|
|
description: 'label for data savings tab',
|
|
|
|
},
|
|
|
|
webcamLabel: {
|
2018-02-06 21:33:48 +08:00
|
|
|
id: 'app.settings.dataSavingTab.webcam',
|
2018-01-30 19:20:51 +08:00
|
|
|
description: 'webcam toggle',
|
|
|
|
},
|
|
|
|
screenShareLabel: {
|
2018-02-06 21:33:48 +08:00
|
|
|
id: 'app.settings.dataSavingTab.screenShare',
|
2018-01-30 19:20:51 +08:00
|
|
|
description: 'screenshare toggle',
|
|
|
|
},
|
2018-01-31 00:32:37 +08:00
|
|
|
dataSavingDesc: {
|
2018-02-06 21:33:48 +08:00
|
|
|
id: 'app.settings.dataSavingTab.description',
|
2018-01-31 00:32:37 +08:00
|
|
|
description: 'description of data savings tab',
|
|
|
|
},
|
2018-01-30 19:20:51 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
class DataSaving extends BaseMenu {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {
|
2018-02-06 21:33:48 +08:00
|
|
|
settingsName: 'dataSaving',
|
2018-01-30 19:20:51 +08:00
|
|
|
settings: props.settings,
|
|
|
|
};
|
|
|
|
}
|
2018-12-06 01:42:31 +08:00
|
|
|
|
2018-01-30 19:20:51 +08:00
|
|
|
render() {
|
2022-03-16 00:58:15 +08:00
|
|
|
const {
|
|
|
|
intl,
|
|
|
|
showToggleLabel,
|
|
|
|
displaySettingsStatus,
|
|
|
|
isScreenSharingEnabled,
|
|
|
|
isVideoEnabled,
|
|
|
|
} = this.props;
|
2018-01-30 19:20:51 +08:00
|
|
|
|
2018-02-06 21:33:48 +08:00
|
|
|
const { viewParticipantsWebcams, viewScreenshare } = this.state.settings;
|
|
|
|
|
2018-01-30 19:20:51 +08:00
|
|
|
return (
|
2018-12-06 01:42:31 +08:00
|
|
|
<div>
|
|
|
|
<div>
|
2021-11-05 22:06:47 +08:00
|
|
|
<Styled.Title>{intl.formatMessage(intlMessages.dataSavingLabel)}</Styled.Title>
|
|
|
|
<Styled.SubTitle>{intl.formatMessage(intlMessages.dataSavingDesc)}</Styled.SubTitle>
|
2018-01-30 19:20:51 +08:00
|
|
|
</div>
|
2021-11-05 22:06:47 +08:00
|
|
|
<Styled.Form>
|
2022-03-16 00:58:15 +08:00
|
|
|
{isVideoEnabled
|
|
|
|
? (
|
|
|
|
<Styled.Row>
|
|
|
|
<Styled.Col aria-hidden="true">
|
|
|
|
<Styled.FormElement>
|
|
|
|
<Styled.Label>
|
|
|
|
{intl.formatMessage(intlMessages.webcamLabel)}
|
|
|
|
</Styled.Label>
|
|
|
|
</Styled.FormElement>
|
|
|
|
</Styled.Col>
|
|
|
|
<Styled.Col>
|
|
|
|
<Styled.FormElementRight>
|
|
|
|
{displaySettingsStatus(viewParticipantsWebcams)}
|
|
|
|
<Toggle
|
|
|
|
icons={false}
|
|
|
|
defaultChecked={viewParticipantsWebcams}
|
|
|
|
onChange={() => this.handleToggle('viewParticipantsWebcams')}
|
|
|
|
ariaLabelledBy="webcamToggle"
|
|
|
|
ariaLabel={intl.formatMessage(intlMessages.webcamLabel)}
|
|
|
|
showToggleLabel={showToggleLabel}
|
|
|
|
/>
|
|
|
|
</Styled.FormElementRight>
|
|
|
|
</Styled.Col>
|
|
|
|
</Styled.Row>
|
|
|
|
)
|
|
|
|
: null}
|
|
|
|
{isScreenSharingEnabled
|
|
|
|
? (
|
|
|
|
<Styled.Row>
|
|
|
|
<Styled.Col aria-hidden="true">
|
|
|
|
<Styled.FormElement>
|
|
|
|
<Styled.Label>
|
|
|
|
{intl.formatMessage(intlMessages.screenShareLabel)}
|
|
|
|
</Styled.Label>
|
|
|
|
</Styled.FormElement>
|
|
|
|
</Styled.Col>
|
|
|
|
<Styled.Col>
|
|
|
|
<Styled.FormElementRight>
|
|
|
|
{displaySettingsStatus(viewScreenshare)}
|
|
|
|
<Toggle
|
|
|
|
icons={false}
|
|
|
|
defaultChecked={viewScreenshare}
|
|
|
|
onChange={() => this.handleToggle('viewScreenshare')}
|
|
|
|
ariaLabelledBy="screenShare"
|
|
|
|
ariaLabel={intl.formatMessage(intlMessages.screenShareLabel)}
|
|
|
|
showToggleLabel={showToggleLabel}
|
|
|
|
/>
|
|
|
|
</Styled.FormElementRight>
|
|
|
|
</Styled.Col>
|
|
|
|
</Styled.Row>
|
|
|
|
)
|
|
|
|
: null}
|
2021-11-05 22:06:47 +08:00
|
|
|
</Styled.Form>
|
2018-01-30 19:20:51 +08:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default injectIntl(DataSaving);
|