f7d1ff0df2
Restructured code, fixed a bug with thickness icon not displayed when switching from Text tool, added textshape container
44 lines
1.0 KiB
JavaScript
Executable File
44 lines
1.0 KiB
JavaScript
Executable File
import React, { Component } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { createContainer } from 'meteor/react-meteor-data';
|
|
|
|
import ShapeGroupService from './service';
|
|
import ShapeGroup from './component';
|
|
|
|
const propTypes = {
|
|
// the id is required to fetch the shapes
|
|
whiteboardId: PropTypes.string.isRequired,
|
|
|
|
// initial width and height of the slide are required to calculate the coordinates for each shape
|
|
width: PropTypes.number.isRequired,
|
|
height: PropTypes.number.isRequired,
|
|
|
|
// array of shapes, optional
|
|
shapes: PropTypes.array,
|
|
};
|
|
|
|
class ShapeGroupContainer extends React.Component {
|
|
constructor(props) {
|
|
super(props);
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<ShapeGroup {...this.props} />
|
|
);
|
|
}
|
|
}
|
|
|
|
export default createContainer((params) => {
|
|
const { whiteboardId, width, height } = params;
|
|
const shapes = ShapeGroupService.getCurrentShapes(whiteboardId);
|
|
|
|
return {
|
|
shapes,
|
|
width,
|
|
height,
|
|
};
|
|
}, ShapeGroupContainer);
|
|
|
|
ShapeGroupContainer.propTypes = propTypes;
|