bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/whiteboard/annotations/text/container.jsx

27 lines
906 B
React
Raw Normal View History

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import TextShapeService from './service';
import TextDrawComponent from './component';
import WhiteboardService from '/imports/ui/components/whiteboard/service';
const TextDrawContainer = props => (
<TextDrawComponent {...props} />
);
export default withTracker((params) => {
2018-04-10 07:18:49 +08:00
const { whiteboardId } = params;
const isPresenter = TextShapeService.isPresenter();
const isMultiUser = WhiteboardService.isMultiUserActive(whiteboardId);
const activeTextShapeId = TextShapeService.activeTextShapeId();
let isActive = false;
2017-08-24 12:27:41 +08:00
if ((isPresenter || isMultiUser) && activeTextShapeId === params.annotation.id) {
isActive = true;
}
return {
isActive,
setTextShapeValue: TextShapeService.setTextShapeValue,
resetTextShapeActiveId: TextShapeService.resetTextShapeActiveId,
};
})(TextDrawContainer);