bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/note/container.jsx

28 lines
822 B
React
Raw Normal View History

2021-05-18 04:25:07 +08:00
import React, { useContext } from 'react';
2018-12-13 04:10:27 +08:00
import { withTracker } from 'meteor/react-meteor-data';
import Note from './component';
import NoteService from './service';
2021-08-05 19:03:24 +08:00
import LayoutContext from '../layout/context';
2018-12-13 04:10:27 +08:00
2021-05-18 04:25:07 +08:00
const NoteContainer = ({ children, ...props }) => {
2021-08-05 19:03:24 +08:00
const layoutContext = useContext(LayoutContext);
2021-08-19 21:05:25 +08:00
const { layoutContextDispatch, layoutContextState } = layoutContext;
const { input } = layoutContextState;
const { cameraDock } = input;
const { isResizing } = cameraDock;
2021-05-18 04:25:07 +08:00
return (
2021-08-19 21:05:25 +08:00
<Note {...{ layoutContextDispatch, isResizing, ...props }}>
2021-05-18 04:25:07 +08:00
{children}
</Note>
);
};
2018-12-13 04:10:27 +08:00
2019-01-10 02:06:23 +08:00
export default withTracker(() => {
const isLocked = NoteService.isLocked();
const isRTL = document.documentElement.getAttribute('dir') === 'rtl';
2018-12-13 04:10:27 +08:00
return {
isLocked,
isRTL,
2018-12-13 04:10:27 +08:00
};
2019-01-10 02:06:23 +08:00
})(NoteContainer);