@e-group/material-layout
Version:
EGroup Team web layout react components.
35 lines (29 loc) • 907 B
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import React from 'react';
import { withStyles, createStyles } from '@material-ui/core';
import WindowCenter from './WindowCenter';
import NormalCenter from './NormalCenter';
const styles = () => createStyles({
root: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}
});
const Center = (_ref) => {
let height = _ref.height,
other = _objectWithoutProperties(_ref, ["height"]);
if (height !== undefined) {
return /*#__PURE__*/React.createElement(NormalCenter, _extends({
height: height
}, other));
}
if (typeof window !== 'undefined') {
return /*#__PURE__*/React.createElement(WindowCenter, other);
}
return null;
};
export default withStyles(styles, {
name: 'EgCenter'
})(Center);