bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/settings/submenus/data-saving/component.jsx

99 lines
3.1 KiB
React
Raw Normal View History

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({
dataSavingLabel: {
id: 'app.settings.dataSavingTab.label',
2018-01-30 19:20:51 +08:00
description: 'label for data savings tab',
},
webcamLabel: {
id: 'app.settings.dataSavingTab.webcam',
2018-01-30 19:20:51 +08:00
description: 'webcam toggle',
},
screenShareLabel: {
id: 'app.settings.dataSavingTab.screenShare',
2018-01-30 19:20:51 +08:00
description: 'screenshare toggle',
},
dataSavingDesc: {
id: 'app.settings.dataSavingTab.description',
description: 'description of data savings tab',
},
2018-01-30 19:20:51 +08:00
});
class DataSaving extends BaseMenu {
constructor(props) {
super(props);
this.state = {
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() {
2021-05-01 03:06:28 +08:00
const { intl, showToggleLabel, displaySettingsStatus } = this.props;
2018-01-30 19:20:51 +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>
<Styled.Row>
<Styled.Col aria-hidden="true">
<Styled.FormElement>
<Styled.Label>
2018-01-30 19:20:51 +08:00
{intl.formatMessage(intlMessages.webcamLabel)}
2021-11-05 22:06:47 +08:00
</Styled.Label>
</Styled.FormElement>
</Styled.Col>
<Styled.Col>
<Styled.FormElementRight>
2021-05-01 03:06:28 +08:00
{displaySettingsStatus(viewParticipantsWebcams)}
2018-01-30 19:20:51 +08:00
<Toggle
icons={false}
2018-03-27 02:26:52 +08:00
defaultChecked={viewParticipantsWebcams}
onChange={() => this.handleToggle('viewParticipantsWebcams')}
ariaLabelledBy="webcamToggle"
ariaLabel={intl.formatMessage(intlMessages.webcamLabel)}
2021-05-01 03:06:28 +08:00
showToggleLabel={showToggleLabel}
2018-01-30 19:20:51 +08:00
/>
2021-11-05 22:06:47 +08:00
</Styled.FormElementRight>
</Styled.Col>
</Styled.Row>
<Styled.Row>
<Styled.Col aria-hidden="true">
<Styled.FormElement>
<Styled.Label>
2018-01-30 19:20:51 +08:00
{intl.formatMessage(intlMessages.screenShareLabel)}
2021-11-05 22:06:47 +08:00
</Styled.Label>
</Styled.FormElement>
</Styled.Col>
<Styled.Col>
<Styled.FormElementRight>
2021-05-01 03:06:28 +08:00
{displaySettingsStatus(viewScreenshare)}
2018-01-30 19:20:51 +08:00
<Toggle
icons={false}
2018-03-27 02:26:52 +08:00
defaultChecked={viewScreenshare}
onChange={() => this.handleToggle('viewScreenshare')}
2018-01-30 19:20:51 +08:00
ariaLabelledBy="screenShare"
ariaLabel={intl.formatMessage(intlMessages.screenShareLabel)}
2021-05-01 03:06:28 +08:00
showToggleLabel={showToggleLabel}
2018-01-30 19:20:51 +08:00
/>
2021-11-05 22:06:47 +08:00
</Styled.FormElementRight>
</Styled.Col>
</Styled.Row>
</Styled.Form>
2018-01-30 19:20:51 +08:00
</div>
);
}
}
export default injectIntl(DataSaving);