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.

30 lines (29 loc) 1.07 kB
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: "sc-1k73sg-0" })(["margin-", ":", ";"], left, ({ theme }) => theme.orbit.spaceMedium); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198 StyledDrawerClose.defaultProps = { theme: defaultTheme }; const DrawerClose = /*#__PURE__*/React.forwardRef(({ onClick }, ref) => { const translate = useTranslate(); return /*#__PURE__*/React.createElement(StyledDrawerClose, null, /*#__PURE__*/React.createElement(ButtonLink, { onClick: onClick, iconLeft: /*#__PURE__*/React.createElement(Close, null), ref: ref, type: "secondary", title: translate("drawer_hide") })); }); export default DrawerClose;