2017-05-02 05:34:24 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { createContainer } from 'meteor/react-meteor-data';
|
2017-08-19 10:47:31 +08:00
|
|
|
import PropTypes from 'prop-types';
|
2017-05-02 05:34:24 +08:00
|
|
|
import WhiteboardOverlayService from './service';
|
|
|
|
import WhiteboardOverlay from './component';
|
|
|
|
|
2017-08-19 10:47:31 +08:00
|
|
|
const WhiteboardOverlayContainer = ({ ...props }) => {
|
|
|
|
if (props.drawSettings) {
|
|
|
|
return (
|
|
|
|
<WhiteboardOverlay {...props} />
|
|
|
|
);
|
2017-05-02 05:34:24 +08:00
|
|
|
}
|
2017-08-19 10:47:31 +08:00
|
|
|
return null;
|
|
|
|
};
|
2017-05-02 05:34:24 +08:00
|
|
|
|
|
|
|
export default createContainer(() => ({
|
|
|
|
sendAnnotation: WhiteboardOverlayService.sendAnnotation,
|
2017-06-17 10:32:41 +08:00
|
|
|
setTextShapeActiveId: WhiteboardOverlayService.setTextShapeActiveId,
|
2017-08-24 11:35:34 +08:00
|
|
|
resetTextShapeSession: WhiteboardOverlayService.resetTextShapeSession,
|
2017-05-03 08:05:41 +08:00
|
|
|
drawSettings: WhiteboardOverlayService.getWhiteboardToolbarValues(),
|
2017-08-19 10:47:31 +08:00
|
|
|
userId: WhiteboardOverlayService.getCurrentUserId(),
|
2017-05-02 05:34:24 +08:00
|
|
|
}), WhiteboardOverlayContainer);
|
2017-08-19 10:47:31 +08:00
|
|
|
|
|
|
|
|
|
|
|
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,
|
2017-08-24 11:35:34 +08:00
|
|
|
// Current active text shape value
|
2017-08-19 10:47:31 +08:00
|
|
|
textShapeValue: PropTypes.string.isRequired,
|
2017-08-24 11:35:34 +08:00
|
|
|
// Text active text shape id
|
|
|
|
textShapeActiveId: PropTypes.string.isRequired,
|
2017-08-19 10:47:31 +08:00
|
|
|
}),
|
|
|
|
};
|
|
|
|
|
|
|
|
WhiteboardOverlayContainer.defaultProps = {
|
|
|
|
drawSettings: undefined,
|
|
|
|
};
|