2022-04-05 22:49:13 +08:00
|
|
|
// import { withTracker } from "meteor/react-meteor-data";
|
|
|
|
// import Service from "./service";
|
|
|
|
// import Whiteboard from "./component";
|
|
|
|
// import React, { useContext } from "react";
|
|
|
|
// import { UsersContext } from "../components-data/users-context/context";
|
|
|
|
// import Auth from "/imports/ui/services/auth";
|
|
|
|
|
|
|
|
// const WhiteboardContainer = (props) => {
|
|
|
|
// const usingUsersContext = useContext(UsersContext);
|
|
|
|
// const { users } = usingUsersContext;
|
|
|
|
// const currentUser = users[Auth.meetingID][Auth.userID];
|
|
|
|
// const isPresenter = currentUser.presenter;
|
|
|
|
// return <Whiteboard {...{isPresenter}} {...props} meetingId={Auth.meetingID} />
|
|
|
|
// };
|
|
|
|
|
|
|
|
// export default withTracker(({}) => {
|
|
|
|
// const shapes = Service.getShapes();
|
|
|
|
// return {
|
|
|
|
// initDefaultPages: Service.initDefaultPages,
|
|
|
|
// persistShape: Service.persistShape,
|
|
|
|
// shapes: shapes,
|
|
|
|
// };
|
|
|
|
// })(WhiteboardContainer);
|
|
|
|
|
|
|
|
import { withTracker } from "meteor/react-meteor-data";
|
|
|
|
import Service from "./service";
|
|
|
|
import Whiteboard from "./component";
|
|
|
|
import React, { useContext } from "react";
|
|
|
|
import { UsersContext } from "../components-data/users-context/context";
|
|
|
|
import Auth from "/imports/ui/services/auth";
|
2022-05-12 05:58:16 +08:00
|
|
|
import PresentationToolbarService from '../presentation/presentation-toolbar/service';
|
2022-04-05 22:49:13 +08:00
|
|
|
|
|
|
|
const WhiteboardContainer = (props) => {
|
|
|
|
const usingUsersContext = useContext(UsersContext);
|
|
|
|
const { users } = usingUsersContext;
|
|
|
|
const currentUser = users[Auth.meetingID][Auth.userID];
|
|
|
|
const isPresenter = currentUser.presenter;
|
|
|
|
return <Whiteboard {...{isPresenter, currentUser}} {...props} meetingId={Auth.meetingID} />
|
|
|
|
};
|
|
|
|
|
2022-05-07 00:37:43 +08:00
|
|
|
export default withTracker(({ whiteboardId }) => {
|
|
|
|
const shapes = Service.getShapes(whiteboardId);
|
2022-04-05 22:49:13 +08:00
|
|
|
const assets = Service.getAssets();
|
2022-04-26 21:55:05 +08:00
|
|
|
const curPres = Service.getCurrentPres();
|
|
|
|
const curSlide = Service.getCurSlide();
|
|
|
|
|
2022-05-04 20:40:56 +08:00
|
|
|
//console.log("!!! withTracker !!! ")
|
2022-04-26 21:55:05 +08:00
|
|
|
// console.log('container shapes', shapes)
|
|
|
|
|
2022-04-05 22:49:13 +08:00
|
|
|
return {
|
|
|
|
initDefaultPages: Service.initDefaultPages,
|
|
|
|
persistShape: Service.persistShape,
|
|
|
|
persistAsset: Service.persistAsset,
|
2022-04-26 21:55:05 +08:00
|
|
|
changeCurrentSlide: Service.changeCurrentSlide,
|
|
|
|
curSlide,
|
2022-04-05 22:49:13 +08:00
|
|
|
shapes: shapes,
|
|
|
|
assets: assets,
|
2022-04-26 21:55:05 +08:00
|
|
|
curPres,
|
2022-05-04 20:40:56 +08:00
|
|
|
removeShapes: Service.removeShapes,
|
2022-05-12 05:58:16 +08:00
|
|
|
zoomSlide: PresentationToolbarService.zoomSlide,
|
2022-04-05 22:49:13 +08:00
|
|
|
};
|
2022-05-04 20:40:56 +08:00
|
|
|
})(WhiteboardContainer);
|