bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/settings/container.jsx

31 lines
944 B
React
Raw Normal View History

2021-06-19 02:32:46 +08:00
import React, { useContext } from 'react';
import { withTracker } from 'meteor/react-meteor-data';
2017-03-29 02:41:48 +08:00
import SettingsService from '/imports/ui/services/settings';
import Settings from './component';
2021-08-05 19:03:24 +08:00
import LayoutContext from '../layout/context';
2017-03-29 02:41:48 +08:00
import {
getUserRoles,
showGuestNotification,
updateSettings,
getAvailableLocales,
} from './service';
2021-08-09 22:24:02 +08:00
const SettingsContainer = (props) => {
2021-08-05 19:03:24 +08:00
const layoutContext = useContext(LayoutContext);
const { layoutContextDispatch } = layoutContext;
2021-06-19 02:32:46 +08:00
2021-08-09 22:24:02 +08:00
return <Settings {...props} layoutContextDispatch={layoutContextDispatch} />;
2021-06-19 02:32:46 +08:00
};
2016-12-23 09:48:19 +08:00
export default withTracker(() => ({
2017-06-03 03:25:02 +08:00
audio: SettingsService.audio,
dataSaving: SettingsService.dataSaving,
2017-06-03 03:25:02 +08:00
application: SettingsService.application,
updateSettings,
availableLocales: getAvailableLocales(),
isModerator: getUserRoles() === 'MODERATOR',
showGuestNotification: showGuestNotification(),
2021-05-01 03:06:28 +08:00
showToggleLabel: false,
}))(SettingsContainer);