@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.
31 lines (29 loc) • 910 B
JavaScript
import * as React from "react";
import styled from "styled-components";
import ButtonLink from "../../ButtonLink";
import Close from "../../icons/Close";
import defaultTheme from "../../defaultTheme";
import { left } from "../../utils/rtl";
import useTranslate from "../../hooks/useTranslate";
const StyledDrawerClose = styled.div.withConfig({
displayName: "DrawerClose__StyledDrawerClose",
componentId: "akfg41-0"
})(["margin-", ":", ";"], left, ({
theme
}) => theme.orbit.spaceMedium);
StyledDrawerClose.defaultProps = {
theme: defaultTheme
};
const DrawerClose = ({
onClick
}) => {
const translate = useTranslate();
return React.createElement(StyledDrawerClose, null, React.createElement(ButtonLink, {
onClick: onClick,
iconLeft: React.createElement(Close, null),
type: "secondary",
title: translate("drawer_hide"),
transparent: true
}));
};
export default DrawerClose;