bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/captions/pad/container.jsx

40 lines
912 B
React
Raw Normal View History

import React, { PureComponent } from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import { Session } from 'meteor/session';
import CaptionsService from '/imports/ui/components/captions/service';
import Pad from './component';
import Auth from '/imports/ui/services/auth';
class PadContainer extends PureComponent {
render() {
2019-05-29 22:31:27 +08:00
const { children } = this.props;
return (
<Pad {...this.props}>
2019-05-29 22:31:27 +08:00
{children}
</Pad>
);
}
}
export default withTracker(() => {
const locale = Session.get('captionsLocale');
const caption = CaptionsService.getCaptions(locale);
const {
padId,
ownerId,
readOnlyPadId,
} = caption;
2019-05-23 22:51:01 +08:00
const { name } = caption ? caption.locale : '';
return {
locale,
2019-05-23 22:51:01 +08:00
name,
ownerId,
padId,
readOnlyPadId,
currentUserId: Auth.userID,
amIModerator: CaptionsService.amIModerator(),
};
})(PadContainer);