@kiwicom/orbit-components
Version:
Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.
36 lines (33 loc) • 1.3 kB
JavaScript
import * as React from "react";
import styled, { css } from "styled-components";
import defaultTheme from "../../defaultTheme";
import getViewportHideStyles from "../../Hide/helpers/getViewportHideStyles";
import { StyledCard } from "../../Card";
import { getBreakpointWidth } from "../../utils/mediaQuery";
import { QUERIES } from "../../utils/mediaQuery/consts";
const StyledColumn = styled.div.withConfig({
displayName: "LayoutColumn__StyledColumn",
componentId: "sc-7eesuv-0"
})(["", ""], ({
theme,
spanEntireRow,
hideOn
}) => css(["", ";", ";@media (max-width:", "px){", "{margin-right:-", ";margin-left:-", ";width:auto;}}"], !!hideOn && getViewportHideStyles(hideOn), spanEntireRow && css(["grid-column:1 / -1;"]), +getBreakpointWidth(QUERIES.LARGEMOBILE, theme, true) - 1, StyledCard, theme.orbit.spaceMedium, theme.orbit.spaceMedium)); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198
StyledColumn.defaultProps = {
theme: defaultTheme
};
const LayoutColumn = ({
children,
hideOn,
as = "div",
spanEntireRow,
dataTest
}) => {
return /*#__PURE__*/React.createElement(StyledColumn, {
"data-test": dataTest,
hideOn: hideOn,
as: as,
spanEntireRow: spanEntireRow
}, children);
};
export default LayoutColumn;