Web: Common: Added HOC withLayoutSize
This commit is contained in:
parent
af8ce86d2d
commit
32e633cee9
@ -107,3 +107,5 @@ export function showLoader() {
|
||||
document.body.classList.add("loading");
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
export { withLayoutSize } from "./withLayoutSize";
|
||||
|
15
web/ASC.Web.Common/src/utils/withLayoutSize.js
Normal file
15
web/ASC.Web.Common/src/utils/withLayoutSize.js
Normal file
@ -0,0 +1,15 @@
|
||||
import * as React from "react";
|
||||
import { utils } from "asc-web-components";
|
||||
const { Consumer } = utils.context;
|
||||
|
||||
export function withLayoutSize(Component) {
|
||||
return function LayoutSizeComponent(props) {
|
||||
return (
|
||||
<Consumer>
|
||||
{(context) => {
|
||||
return <Component {...props} context={context} />;
|
||||
}}
|
||||
</Consumer>
|
||||
);
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user