@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.
23 lines (19 loc) • 739 B
JavaScript
import { TOKENS, TYPES } from "../consts";
import getButtonLinkTypeToken from "./getButtonLinkTypeToken";
const getButtonLinkIconForeground = ({
type,
theme,
compact
}) => {
const wrappedTypeReturn = usedType => ({
foreground: getButtonLinkTypeToken(TOKENS.foreground, type, theme),
foregroundHover: getButtonLinkTypeToken(TOKENS.foregroundHover, usedType, theme),
foregroundActive: getButtonLinkTypeToken(TOKENS.foregroundActive, usedType, theme),
foregroundFocus: getButtonLinkTypeToken(TOKENS.foregroundActive, usedType, theme)
});
if (compact && type === TYPES.SECONDARY) {
return wrappedTypeReturn(TYPES.PRIMARY);
}
return wrappedTypeReturn(type);
};
export default getButtonLinkIconForeground;