bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/presentation/cursor/container.jsx

37 lines
694 B
React
Raw Normal View History

2017-06-08 05:25:47 +08:00
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { createContainer } from 'meteor/react-meteor-data';
import CursorService from './service';
import Cursor from './component';
class CursorContainer extends Component {
constructor(props) {
super(props);
}
render() {
return (
<Cursor {...this.props}>
{this.props.children}
</Cursor>
);
}
}
export default createContainer(() => {
let cursor = CursorService.getCurrentCursor();
let cursorX = 0;
let cursorY = 0;
if(cursor) {
cursorX = cursor.x;
cursorY = cursor.y;
}
return {
cursorX: cursorX,
cursorY: cursorY,
};
}, CursorContainer);