@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.
32 lines • 1.46 kB
JavaScript
import * as React from "react";
import styled, { css } from "styled-components";
import defaultTheme from "../../../defaultTheme";
import { StyledSeparator } from "../../../Separator";
import ChevronForward from "../../../icons/ChevronForward";
import { StyledWrapper as StyledBadgeListWrapper } from "../../ItineraryBadgeList";
import { left } from "../../../utils/rtl";
const StyledBannerWrapper = styled.div.withConfig({
displayName: "ItinerarySegmentBanner__StyledBannerWrapper",
componentId: "sc-7y71qr-0"
})(["", ""], ({
theme,
$actionable
}) => css(["display:flex;align-items:center;justify-content:space-between;width:100%;overflow:hidden;box-sizing:border-box;padding:0 ", ";cursor:", ";", "{margin-", ":0 !important;}", "{width:150% !important;margin-left:-", ";}& > div{max-width:calc(100% - 20px);}"], theme.orbit.spaceMedium, $actionable ? "pointer" : "default", StyledBadgeListWrapper, left, StyledSeparator, theme.orbit.spaceMedium));
StyledBannerWrapper.defaultProps = {
theme: defaultTheme
};
const ItinerarySegmentBanner = ({
onClick,
children
}) => {
return /*#__PURE__*/React.createElement(StyledBannerWrapper, {
$actionable: !!onClick,
onClick: ev => {
ev.stopPropagation();
if (onClick) onClick(ev);
}
}, /*#__PURE__*/React.createElement("div", null, children), onClick && /*#__PURE__*/React.createElement(ChevronForward, {
color: "secondary"
}));
};
export default ItinerarySegmentBanner;