2017-06-17 10:32:41 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { createContainer } 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';
|
|
|
|
|
2017-08-20 14:32:01 +08:00
|
|
|
const TextDrawContainer = ({ ...props }) => (
|
|
|
|
<TextDrawComponent {...props} />
|
|
|
|
);
|
2017-06-17 10:32:41 +08:00
|
|
|
|
|
|
|
export default createContainer((params) => {
|
|
|
|
const isPresenter = TextShapeService.isPresenter();
|
|
|
|
const activeTextShapeId = TextShapeService.activeTextShapeId();
|
|
|
|
let isActive = false;
|
|
|
|
|
2017-08-20 14:32:01 +08:00
|
|
|
if (isPresenter && 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-20 14:32:01 +08:00
|
|
|
};
|
2017-06-17 10:32:41 +08:00
|
|
|
}, TextDrawContainer);
|