2022-11-03 19:56:03 +08:00
|
|
|
import React, { useContext } from 'react';
|
2018-12-13 04:10:27 +08:00
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2021-10-16 03:07:13 +08:00
|
|
|
import Notes from './component';
|
|
|
|
import Service from './service';
|
2022-11-03 19:56:03 +08:00
|
|
|
import Auth from '/imports/ui/services/auth';
|
2023-01-19 04:10:22 +08:00
|
|
|
import MediaService from '/imports/ui/components/media/service';
|
2022-10-24 21:11:28 +08:00
|
|
|
import { layoutSelectInput, layoutDispatch, layoutSelectOutput } from '../layout/context';
|
2022-11-03 19:56:03 +08:00
|
|
|
import { UsersContext } from '../components-data/users-context/context';
|
2018-12-13 04:10:27 +08:00
|
|
|
|
2021-10-16 03:07:13 +08:00
|
|
|
const Container = ({ ...props }) => {
|
2021-09-11 04:48:52 +08:00
|
|
|
const cameraDock = layoutSelectInput((i) => i.cameraDock);
|
2022-10-24 21:11:28 +08:00
|
|
|
const sharedNotesOutput = layoutSelectOutput((i) => i.sharedNotes);
|
|
|
|
const sidebarContent = layoutSelectInput((i) => i.sidebarContent);
|
2021-08-19 21:05:25 +08:00
|
|
|
const { isResizing } = cameraDock;
|
2021-09-11 04:48:52 +08:00
|
|
|
const layoutContextDispatch = layoutDispatch();
|
2022-11-03 19:56:03 +08:00
|
|
|
const usingUsersContext = useContext(UsersContext);
|
|
|
|
const { users } = usingUsersContext;
|
|
|
|
const amIPresenter = users[Auth.meetingID][Auth.userID].presenter;
|
2021-09-10 04:49:15 +08:00
|
|
|
|
2022-10-24 21:11:28 +08:00
|
|
|
return <Notes {...{
|
|
|
|
layoutContextDispatch,
|
|
|
|
isResizing,
|
|
|
|
sidebarContent,
|
|
|
|
sharedNotesOutput,
|
2022-11-03 19:56:03 +08:00
|
|
|
amIPresenter,
|
2022-10-24 21:11:28 +08:00
|
|
|
...props
|
|
|
|
}} />;
|
2021-05-18 04:25:07 +08:00
|
|
|
};
|
2018-12-13 04:10:27 +08:00
|
|
|
|
2019-01-10 02:06:23 +08:00
|
|
|
export default withTracker(() => {
|
2021-10-16 03:07:13 +08:00
|
|
|
const hasPermission = Service.hasPermission();
|
2019-08-27 22:56:50 +08:00
|
|
|
const isRTL = document.documentElement.getAttribute('dir') === 'rtl';
|
2023-01-19 04:10:22 +08:00
|
|
|
const shouldShowSharedNotesOnPresentationArea = MediaService.shouldShowSharedNotes();
|
2018-12-13 04:10:27 +08:00
|
|
|
return {
|
2021-10-16 03:07:13 +08:00
|
|
|
hasPermission,
|
2019-08-27 22:56:50 +08:00
|
|
|
isRTL,
|
2023-01-19 04:10:22 +08:00
|
|
|
shouldShowSharedNotesOnPresentationArea,
|
2018-12-13 04:10:27 +08:00
|
|
|
};
|
2021-10-16 03:07:13 +08:00
|
|
|
})(Container);
|