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-05-18 04:25:07 +08:00
|
|
|
import { NLayoutContext } from '../layout/context/context';
|
2018-12-13 04:10:27 +08:00
|
|
|
|
2021-05-18 04:25:07 +08:00
|
|
|
const NoteContainer = ({ children, ...props }) => {
|
|
|
|
const newLayoutContext = useContext(NLayoutContext);
|
|
|
|
const { newLayoutContextDispatch } = newLayoutContext;
|
|
|
|
return (
|
|
|
|
<Note {...{ newLayoutContextDispatch, ...props }}>
|
|
|
|
{children}
|
|
|
|
</Note>
|
|
|
|
);
|
|
|
|
};
|
2018-12-13 04:10:27 +08:00
|
|
|
|
2019-01-10 02:06:23 +08:00
|
|
|
export default withTracker(() => {
|
2019-03-29 02:47:11 +08:00
|
|
|
const isLocked = NoteService.isLocked();
|
2019-08-27 22:56:50 +08:00
|
|
|
const isRTL = document.documentElement.getAttribute('dir') === 'rtl';
|
2018-12-13 04:10:27 +08:00
|
|
|
return {
|
2019-03-29 02:47:11 +08:00
|
|
|
isLocked,
|
2019-08-27 22:56:50 +08:00
|
|
|
isRTL,
|
2018-12-13 04:10:27 +08:00
|
|
|
};
|
2019-01-10 02:06:23 +08:00
|
|
|
})(NoteContainer);
|