@retailmenot/anchor
Version:
A React UI Library by RetailMeNot
40 lines • 1.92 kB
JavaScript
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
// REACT
import * as React from 'react';
// VENDOR
import styled from '@xstyled/styled-components';
import classnames from 'classnames';
// Constants
// ------------------------------------------------------------------------------------------------------------------
export const DEFAULT_HEADER_HEIGHT = '1.5rem';
export const DEFAULT_FOOTER_HEIGHT = '20.375rem';
// Styled Components
// ------------------------------------------------------------------------------------------------------------------
const StyledPage = styled('main') `
display: flex;
flex-direction: column;
height: 100vh;
max-width: 100%;
width: 100vw;
`;
// Components
// ------------------------------------------------------------------------------------------------------------------
export const Page = (_a) => {
var { header, footer, headerHeight = DEFAULT_HEADER_HEIGHT, footerHeight = DEFAULT_FOOTER_HEIGHT, className, children } = _a, props = __rest(_a, ["header", "footer", "headerHeight", "footerHeight", "className", "children"]);
return (React.createElement(StyledPage, Object.assign({ className: classnames('anchor-page', className) }, props),
React.createElement("div", null,
header && React.createElement("div", null, header),
React.createElement("div", null, children),
footer && React.createElement("div", null, footer))));
};
//# sourceMappingURL=Page.component.js.map