@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.
32 lines (29 loc) • 1.11 kB
JavaScript
import * as React from "react";
import styled from "styled-components";
import Badge from "../Badge";
import { StyledBadge } from "../primitives/BadgePrimitive";
import defaultTheme from "../defaultTheme";
var StyledNotificationBadge = styled.div.withConfig({
displayName: "NotificationBadge__StyledNotificationBadge",
componentId: "zl2bxd-0"
})(["", "{width:", ";padding:0;}"], StyledBadge, function (_ref) {
var theme = _ref.theme;
return theme.orbit.widthBadgeCircled;
}); // $FlowFixMe: https://github.com/flow-typed/flow-typed/issues/3653#issuecomment-568539198
StyledNotificationBadge.defaultProps = {
theme: defaultTheme
};
var NotificationBadge = function NotificationBadge(props) {
var type = props.type,
children = props.children,
icon = props.icon,
ariaLabel = props.ariaLabel,
dataTest = props.dataTest;
return /*#__PURE__*/React.createElement(StyledNotificationBadge, null, /*#__PURE__*/React.createElement(Badge, {
type: type,
dataTest: dataTest,
icon: icon,
ariaLabel: ariaLabel
}, !icon && children));
};
export default NotificationBadge;