UNPKG

@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.

29 lines 786 B
import resolveFocusColor from "./resolveFocusColor"; import resolveAccentColor from "./resolveAccentColor"; import { TYPES } from "../../consts"; const resolveFillColor = ({ type, theme, selected, focus }) => { if (focus) { if (type === TYPES.UNAVAILABLE) return ""; if (!selected) { return resolveAccentColor({ type, theme, selected }); } return resolveFocusColor({ type, theme, selected }); } if (type === TYPES.LEGROOM) return selected ? theme.orbit.paletteBlueNormal : theme.orbit.paletteBlueLight; if (type === TYPES.UNAVAILABLE) return theme.orbit.paletteCloudLight; return selected ? theme.orbit.paletteProductNormal : theme.orbit.paletteProductLight; }; export default resolveFillColor;