aboutsummaryrefslogtreecommitdiffstats
path: root/packages/ui/src/badge/ProBadge.tsx
diff options
context:
space:
mode:
authorLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-04-11 12:00:07 +0200
committerLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-04-11 12:00:07 +0200
commite43d6bd80b3d76aae627fa8174eea98c14016549 (patch)
treede1d0a3ba10100ce68d0cb1ed618095e362fe573 /packages/ui/src/badge/ProBadge.tsx
parentimplements basic release announcement feature (diff)
parenthandle deleted services that are attached to workspaces (diff)
downloadferdium-app-e43d6bd80b3d76aae627fa8174eea98c14016549.tar.gz
ferdium-app-e43d6bd80b3d76aae627fa8174eea98c14016549.tar.zst
ferdium-app-e43d6bd80b3d76aae627fa8174eea98c14016549.zip
merge-in workspace feature
Diffstat (limited to 'packages/ui/src/badge/ProBadge.tsx')
-rw-r--r--packages/ui/src/badge/ProBadge.tsx64
1 files changed, 64 insertions, 0 deletions
diff --git a/packages/ui/src/badge/ProBadge.tsx b/packages/ui/src/badge/ProBadge.tsx
new file mode 100644
index 000000000..612e23210
--- /dev/null
+++ b/packages/ui/src/badge/ProBadge.tsx
@@ -0,0 +1,64 @@
1import { Theme } from '@meetfranz/theme';
2import classnames from 'classnames';
3import React, { Component } from 'react';
4import injectStyle from 'react-jss';
5
6import { Icon, Badge } from '../';
7import { IWithStyle } from '../typings/generic';
8
9interface IProps extends IWithStyle {
10 badgeClasses?: string;
11 iconClasses?: string;
12 inverted?: boolean;
13}
14
15const styles = (theme: Theme) => ({
16 badge: {
17 height: 'auto',
18 padding: [4, 6, 2, 7],
19 borderRadius: theme.borderRadiusSmall,
20 },
21 invertedBadge: {
22 background: theme.styleTypes.primary.contrast,
23 color: theme.styleTypes.primary.accent,
24 },
25 icon: {
26 fill: theme.styleTypes.primary.contrast,
27 },
28 invertedIcon: {
29 fill: theme.styleTypes.primary.accent,
30 },
31});
32
33class ProBadgeComponent extends Component<IProps> {
34 render() {
35 const {
36 classes,
37 badgeClasses,
38 iconClasses,
39 inverted,
40 } = this.props;
41
42 return (
43 <Badge
44 type="primary"
45 className={classnames([
46 classes.badge,
47 inverted && classes.invertedBadge,
48 badgeClasses,
49 ])}
50 >
51 <Icon
52 icon="mdiStar"
53 className={classnames([
54 classes.icon,
55 inverted && classes.invertedIcon,
56 iconClasses,
57 ])}
58 />
59 </Badge>
60 );
61 }
62}
63
64export const ProBadge = injectStyle(styles)(ProBadgeComponent);