2017-08-26 06:45:06 +08:00
|
|
|
import React from 'react';
|
2017-06-04 10:40:14 +08:00
|
|
|
import PropTypes from 'prop-types';
|
2018-01-08 12:44:42 +08:00
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2017-07-27 20:35:55 +08:00
|
|
|
import AnnotationGroupService from './service';
|
|
|
|
import AnnotationGroup from './component';
|
2017-02-23 08:10:30 +08:00
|
|
|
|
2017-09-26 07:45:44 +08:00
|
|
|
const AnnotationGroupContainer = props => (
|
2017-08-26 06:45:06 +08:00
|
|
|
<AnnotationGroup
|
|
|
|
annotationsInfo={props.annotationsInfo}
|
|
|
|
slideWidth={props.width}
|
|
|
|
slideHeight={props.height}
|
2018-04-10 07:18:49 +08:00
|
|
|
whiteboardId={props.whiteboardId}
|
2017-08-26 06:45:06 +08:00
|
|
|
/>
|
|
|
|
);
|
2017-02-23 08:10:30 +08:00
|
|
|
|
2018-01-08 12:44:42 +08:00
|
|
|
export default withTracker((params) => {
|
2017-08-26 06:45:06 +08:00
|
|
|
const { whiteboardId } = params;
|
|
|
|
const annotationsInfo = AnnotationGroupService.getCurrentAnnotationsInfo(whiteboardId);
|
2017-02-23 08:10:30 +08:00
|
|
|
return {
|
2017-08-26 06:45:06 +08:00
|
|
|
annotationsInfo,
|
2017-02-23 08:10:30 +08:00
|
|
|
};
|
2018-01-08 12:44:42 +08:00
|
|
|
})(AnnotationGroupContainer);
|
2017-02-23 08:10:30 +08:00
|
|
|
|
2017-08-20 14:32:01 +08:00
|
|
|
AnnotationGroupContainer.propTypes = {
|
2018-04-10 07:18:49 +08:00
|
|
|
whiteboardId: PropTypes.string.isRequired,
|
2017-08-20 14:32:01 +08:00
|
|
|
// initial width and height of the slide; required to calculate the annotations' coordinates
|
|
|
|
width: PropTypes.number.isRequired,
|
|
|
|
height: PropTypes.number.isRequired,
|
|
|
|
|
|
|
|
// array of annotations, optional
|
2017-08-26 06:45:06 +08:00
|
|
|
annotationsInfo: PropTypes.arrayOf(PropTypes.shape({
|
|
|
|
status: PropTypes.string.isRequired,
|
|
|
|
_id: PropTypes.string.isRequired,
|
|
|
|
annotationType: PropTypes.string.isRequired,
|
|
|
|
})).isRequired,
|
2017-08-20 14:32:01 +08:00
|
|
|
};
|