@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.
14 lines • 1.06 kB
JavaScript
import { css } from "styled-components";
import { left, right } from "../utils/rtl";
export const resolveStepBorder = ({
isColumnOnDesktop,
index,
status,
isLastStep,
nextStepStatus
}) => ({
theme
}) => {
return css(["", " &:before{", ":0;background:", ";}&:after{", ":0;background:", ";}"], isColumnOnDesktop ? css(["&:before{display:", ";}&:after{display:", ";}&:after{content:\"\";position:absolute;", ":", "px;top:", "px;width:2px;height:40px;}"], index === 0 ? "none" : "block", isLastStep ? "none" : "block", left, parseFloat(theme.orbit.heightIconSmall) + 1, parseFloat(theme.orbit.heightIconSmall) + 1) : css(["&:before,&:after{display:block;content:\"\";position:absolute;top:", "px;width:50%;height:2px;}"], parseFloat(theme.orbit.heightIconSmall) / 2 - 1), left, status === "disabled" ? theme.orbit.paletteCloudNormalHover : theme.orbit.paletteProductNormal, right, status === "disabled" || nextStepStatus === "disabled" ? theme.orbit.paletteCloudNormalHover : theme.orbit.paletteProductNormal);
};
export default resolveStepBorder;