bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/whiteboard/whiteboard-overlay/container.jsx
Oleksandr Zhurbenko d5f07a574c Fixed publishShape message for 4 common shapes
Line, Rectangle, Triangle, Ellipse
2017-08-18 19:47:31 -07:00

43 lines
1.3 KiB
JavaScript
Executable File

import React from 'react';
import { createContainer } from 'meteor/react-meteor-data';
import PropTypes from 'prop-types';
import WhiteboardOverlayService from './service';
import WhiteboardOverlay from './component';
const WhiteboardOverlayContainer = ({ ...props }) => {
if (props.drawSettings) {
return (
<WhiteboardOverlay {...props} />
);
}
return null;
};
export default createContainer(() => ({
sendAnnotation: WhiteboardOverlayService.sendAnnotation,
setTextShapeActiveId: WhiteboardOverlayService.setTextShapeActiveId,
resetTextShapeValue: WhiteboardOverlayService.resetTextShapeValue,
drawSettings: WhiteboardOverlayService.getWhiteboardToolbarValues(),
userId: WhiteboardOverlayService.getCurrentUserId(),
}), WhiteboardOverlayContainer);
WhiteboardOverlayContainer.propTypes = {
drawSettings: PropTypes.shape({
// Annotation color
color: PropTypes.number.isRequired,
// Annotation thickness (not normalized)
thickness: PropTypes.number.isRequired,
// The name of the tool currently selected
tool: PropTypes.string.isRequired,
// Font size for the text shape
textFontSize: PropTypes.number.isRequired,
// Text shape value
textShapeValue: PropTypes.string.isRequired,
}),
};
WhiteboardOverlayContainer.defaultProps = {
drawSettings: undefined,
};