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