bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/whiteboard/annotation-group/container.jsx

37 lines
1.1 KiB
React
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
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
const AnnotationGroupContainer = props => (
<AnnotationGroup
annotationsInfo={props.annotationsInfo}
slideWidth={props.width}
slideHeight={props.height}
2018-04-10 07:18:49 +08:00
whiteboardId={props.whiteboardId}
/>
);
2017-02-23 08:10:30 +08:00
export default withTracker((params) => {
const { whiteboardId } = params;
const annotationsInfo = AnnotationGroupService.getCurrentAnnotationsInfo(whiteboardId);
2017-02-23 08:10:30 +08:00
return {
annotationsInfo,
2017-02-23 08:10:30 +08:00
};
})(AnnotationGroupContainer);
2017-02-23 08:10:30 +08:00
AnnotationGroupContainer.propTypes = {
2018-04-10 07:18:49 +08:00
whiteboardId: PropTypes.string.isRequired,
// 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
annotationsInfo: PropTypes.arrayOf(PropTypes.shape({
status: PropTypes.string.isRequired,
_id: PropTypes.string.isRequired,
annotationType: PropTypes.string.isRequired,
})).isRequired,
};