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

43 lines
980 B
React
Raw Normal View History

import React, { PureComponent } from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import { Session } from 'meteor/session';
import { makeCall } from '/imports/ui/services/api';
import Pad from './component';
import CaptionsService from '/imports/ui/components/captions/service';
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;
const editCaptions = textData => makeCall('vrEditCaptions', textData);
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,
amIModerator: CaptionsService.amIModerator(),
editCaptions,
};
})(PadContainer);