2017-06-17 10:32:41 +08:00
|
|
|
import React from 'react';
|
2018-01-08 12:44:42 +08:00
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2017-08-20 14:32:01 +08:00
|
|
|
import TextShapeService from './service';
|
2017-06-17 10:32:41 +08:00
|
|
|
import TextDrawComponent from './component';
|
2021-03-05 06:26:25 +08:00
|
|
|
import WhiteboardService from '/imports/ui/components/whiteboard/service';
|
2017-06-17 10:32:41 +08:00
|
|
|
|
2017-09-26 07:45:44 +08:00
|
|
|
const TextDrawContainer = props => (
|
2017-08-20 14:32:01 +08:00
|
|
|
<TextDrawComponent {...props} />
|
|
|
|
);
|
2017-06-17 10:32:41 +08:00
|
|
|
|
2018-01-08 12:44:42 +08:00
|
|
|
export default withTracker((params) => {
|
2018-04-10 07:18:49 +08:00
|
|
|
const { whiteboardId } = params;
|
2017-06-17 10:32:41 +08:00
|
|
|
const isPresenter = TextShapeService.isPresenter();
|
2021-03-05 06:26:25 +08:00
|
|
|
const isMultiUser = WhiteboardService.isMultiUserActive(whiteboardId);
|
2017-06-17 10:32:41 +08:00
|
|
|
const activeTextShapeId = TextShapeService.activeTextShapeId();
|
|
|
|
let isActive = false;
|
|
|
|
|
2017-08-24 12:27:41 +08:00
|
|
|
if ((isPresenter || isMultiUser) && activeTextShapeId === params.annotation.id) {
|
2017-06-17 10:32:41 +08:00
|
|
|
isActive = true;
|
|
|
|
}
|
|
|
|
return {
|
2017-08-20 14:32:01 +08:00
|
|
|
isActive,
|
2017-06-17 10:32:41 +08:00
|
|
|
setTextShapeValue: TextShapeService.setTextShapeValue,
|
2017-08-24 11:35:34 +08:00
|
|
|
resetTextShapeActiveId: TextShapeService.resetTextShapeActiveId,
|
2017-08-20 14:32:01 +08:00
|
|
|
};
|
2018-01-08 12:44:42 +08:00
|
|
|
})(TextDrawContainer);
|