f80d0bc083
Thus we won't clutter the code with unrelated events and can easily switch to a ResizeObserver when it is implemented by the browsers
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { createContainer } from 'meteor/react-meteor-data';
|
|
import AnnotationGroupService from './service';
|
|
import AnnotationGroup from './component';
|
|
|
|
const AnnotationGroupContainer = props => (
|
|
<AnnotationGroup
|
|
annotationsInfo={props.annotationsInfo}
|
|
slideWidth={props.width}
|
|
slideHeight={props.height}
|
|
/>
|
|
);
|
|
|
|
export default createContainer((params) => {
|
|
const { whiteboardId } = params;
|
|
const annotationsInfo = AnnotationGroupService.getCurrentAnnotationsInfo(whiteboardId);
|
|
|
|
return {
|
|
annotationsInfo,
|
|
};
|
|
}, AnnotationGroupContainer);
|
|
|
|
AnnotationGroupContainer.propTypes = {
|
|
// 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,
|
|
};
|