aboutsummaryrefslogtreecommitdiffstats
path: root/packages/ui/src
diff options
context:
space:
mode:
authorLibravatar vantezzen <properly@protonmail.com>2019-09-07 15:50:23 +0200
committerLibravatar vantezzen <properly@protonmail.com>2019-09-07 15:50:23 +0200
commite7a74514c1e7c3833dfdcf5900cb87f9e6e8354e (patch)
treeb8314e4155503b135dcb07e8b4a0e847e25c19cf /packages/ui/src
parentUpdate CHANGELOG.md (diff)
parentUpdate CHANGELOG.md (diff)
downloadferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.tar.gz
ferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.tar.zst
ferdium-app-e7a74514c1e7c3833dfdcf5900cb87f9e6e8354e.zip
Merge branch 'master' of https://github.com/meetfranz/franz into franz-5.3.0
Diffstat (limited to 'packages/ui/src')
-rw-r--r--packages/ui/src/badge/ProBadge.tsx8
-rw-r--r--packages/ui/src/icon/index.tsx12
-rw-r--r--packages/ui/src/infobox/index.tsx5
3 files changed, 13 insertions, 12 deletions
diff --git a/packages/ui/src/badge/ProBadge.tsx b/packages/ui/src/badge/ProBadge.tsx
index 612e23210..5cc41f5b2 100644
--- a/packages/ui/src/badge/ProBadge.tsx
+++ b/packages/ui/src/badge/ProBadge.tsx
@@ -1,15 +1,17 @@
1import { mdiStar } from '@mdi/js';
1import { Theme } from '@meetfranz/theme'; 2import { Theme } from '@meetfranz/theme';
2import classnames from 'classnames'; 3import classnames from 'classnames';
3import React, { Component } from 'react'; 4import React, { Component } from 'react';
4import injectStyle from 'react-jss'; 5import injectStyle from 'react-jss';
5 6
6import { Icon, Badge } from '../'; 7import { Badge, Icon } from '../';
7import { IWithStyle } from '../typings/generic'; 8import { IWithStyle } from '../typings/generic';
8 9
9interface IProps extends IWithStyle { 10interface IProps extends IWithStyle {
10 badgeClasses?: string; 11 badgeClasses?: string;
11 iconClasses?: string; 12 iconClasses?: string;
12 inverted?: boolean; 13 inverted?: boolean;
14 className?: string;
13} 15}
14 16
15const styles = (theme: Theme) => ({ 17const styles = (theme: Theme) => ({
@@ -37,6 +39,7 @@ class ProBadgeComponent extends Component<IProps> {
37 badgeClasses, 39 badgeClasses,
38 iconClasses, 40 iconClasses,
39 inverted, 41 inverted,
42 className,
40 } = this.props; 43 } = this.props;
41 44
42 return ( 45 return (
@@ -46,10 +49,11 @@ class ProBadgeComponent extends Component<IProps> {
46 classes.badge, 49 classes.badge,
47 inverted && classes.invertedBadge, 50 inverted && classes.invertedBadge,
48 badgeClasses, 51 badgeClasses,
52 className,
49 ])} 53 ])}
50 > 54 >
51 <Icon 55 <Icon
52 icon="mdiStar" 56 icon={mdiStar}
53 className={classnames([ 57 className={classnames([
54 classes.icon, 58 classes.icon,
55 inverted && classes.invertedIcon, 59 inverted && classes.invertedIcon,
diff --git a/packages/ui/src/icon/index.tsx b/packages/ui/src/icon/index.tsx
index e30d3396d..af467c085 100644
--- a/packages/ui/src/icon/index.tsx
+++ b/packages/ui/src/icon/index.tsx
@@ -1,4 +1,3 @@
1import * as mdiIcons from '@mdi/js';
2import MdiIcon from '@mdi/react'; 1import MdiIcon from '@mdi/react';
3import { Theme } from '@meetfranz/theme'; 2import { Theme } from '@meetfranz/theme';
4import classnames from 'classnames'; 3import classnames from 'classnames';
@@ -8,7 +7,7 @@ import injectStyle from 'react-jss';
8import { IWithStyle } from '../typings/generic'; 7import { IWithStyle } from '../typings/generic';
9 8
10interface IProps extends IWithStyle { 9interface IProps extends IWithStyle {
11 icon: keyof typeof mdiIcons; 10 icon: string;
12 size?: number; 11 size?: number;
13 className?: string; 12 className?: string;
14} 13}
@@ -27,16 +26,13 @@ class IconComponent extends Component<IProps> {
27 render() { 26 render() {
28 const { 27 const {
29 classes, 28 classes,
30 icon: iconName, 29 icon,
31 size, 30 size,
32 className, 31 className,
33 } = this.props; 32 } = this.props;
34 33
35 let icon = ''; 34 if (!icon) {
36 if (iconName && mdiIcons[iconName]) { 35 console.warn('No Icon specified');
37 icon = mdiIcons[iconName];
38 } else if (iconName && !mdiIcons[iconName]) {
39 console.warn(`Icon '${iconName}' was not found`);
40 } 36 }
41 37
42 return ( 38 return (
diff --git a/packages/ui/src/infobox/index.tsx b/packages/ui/src/infobox/index.tsx
index 9066a623e..e4c2c5a3e 100644
--- a/packages/ui/src/infobox/index.tsx
+++ b/packages/ui/src/infobox/index.tsx
@@ -1,3 +1,4 @@
1import { mdiClose } from '@mdi/js';
1import { Theme } from '@meetfranz/theme'; 2import { Theme } from '@meetfranz/theme';
2import classnames from 'classnames'; 3import classnames from 'classnames';
3import React, { Component } from 'react'; 4import React, { Component } from 'react';
@@ -48,13 +49,13 @@ const styles = (theme: Theme) => ({
48 position: 'relative', 49 position: 'relative',
49 overflow: 'hidden', 50 overflow: 'hidden',
50 height: 'auto', 51 height: 'auto',
52 marginBottom: 30,
51 }, 53 },
52 infobox: { 54 infobox: {
53 alignItems: 'center', 55 alignItems: 'center',
54 borderRadius: theme.borderRadiusSmall, 56 borderRadius: theme.borderRadiusSmall,
55 display: 'flex', 57 display: 'flex',
56 height: 'auto', 58 height: 'auto',
57 marginBottom: 30,
58 padding: '15px 20px', 59 padding: '15px 20px',
59 top: 0, 60 top: 0,
60 transition: 'all 0.5s', 61 transition: 'all 0.5s',
@@ -192,7 +193,7 @@ class InfoboxComponent extends Component<IProps, IState> {
192 onClick={this.dismiss.bind(this)} 193 onClick={this.dismiss.bind(this)}
193 className={classes.close} 194 className={classes.close}
194 > 195 >
195 <Icon icon="mdiClose" /> 196 <Icon icon={mdiClose} />
196 </button> 197 </button>
197 )} 198 )}
198 </div> 199 </div>