DocSpace-client/packages/common/utils/withLayoutSize.js

15 lines
340 B
JavaScript
Raw Normal View History

2020-11-17 03:29:24 +00:00
import * as React from "react";
import { Consumer } from "@docspace/components/utils/context";
2020-11-17 03:29:24 +00:00
export function withLayoutSize(Component) {
return function LayoutSizeComponent(props) {
return (
<Consumer>
{(context) => {
return <Component {...props} {...context} />;
2020-11-17 03:29:24 +00:00
}}
</Consumer>
);
};
}