From 073212bf046b9218f9e3129988b1b63fba5d685d Mon Sep 17 00:00:00 2001
From: Dominik Guzei <dominik.guzei@gmail.com>
Date: Wed, 10 Apr 2019 16:12:38 +0200
Subject: added generic pro badge component for settings nav

---
 packages/ui/src/badge/ProBadge.tsx | 65 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)
 create mode 100644 packages/ui/src/badge/ProBadge.tsx

(limited to 'packages/ui/src/badge/ProBadge.tsx')

diff --git a/packages/ui/src/badge/ProBadge.tsx b/packages/ui/src/badge/ProBadge.tsx
new file mode 100644
index 000000000..eb00e156d
--- /dev/null
+++ b/packages/ui/src/badge/ProBadge.tsx
@@ -0,0 +1,65 @@
+import { Theme } from '@meetfranz/theme';
+import classnames from 'classnames';
+import React, { Component } from 'react';
+import injectStyle from 'react-jss';
+
+import { Icon, Badge } from '../';
+import { IWithStyle } from '../typings/generic';
+
+interface IProps extends IWithStyle {
+  badgeClasses?: string;
+  iconClasses?: string;
+  inverted?: boolean;
+}
+
+const styles = (theme: Theme) => ({
+  badge: {
+    height: 'auto',
+    padding: [4, 6, 2, 7],
+    borderRadius: theme.borderRadiusSmall,
+  },
+  invertedBadge: {
+    background: theme.styleTypes.primary.contrast,
+    color: theme.styleTypes.primary.accent,
+  },
+  icon: {
+    fill: theme.styleTypes.primary.contrast,
+  },
+  invertedIcon: {
+    fill: theme.styleTypes.primary.accent,
+  },
+});
+
+class ProBadgeComponent extends Component<IProps> {
+  render() {
+    const {
+      classes,
+      badgeClasses,
+      iconClasses,
+      inverted,
+    } = this.props;
+
+    return (
+      <Badge
+        type="primary"
+        className={classnames([
+          classes.badge,
+          inverted && classes.invertedBadge,
+          badgeClasses,
+        ])}
+        data-type="franz-badge"
+      >
+        <Icon
+          icon="mdiStar"
+          className={classnames([
+            classes.icon,
+            inverted && classes.invertedIcon,
+            iconClasses,
+          ])}
+        />
+      </Badge>
+    );
+  }
+}
+
+export const ProBadge = injectStyle(styles)(ProBadgeComponent);
-- 
cgit v1.2.3-70-g09d2

