-
Notifications
You must be signed in to change notification settings - Fork 295
/
BigButtonForDialogs.tsx
42 lines (40 loc) · 1006 Bytes
/
BigButtonForDialogs.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// @flow
import React, { Component } from 'react';
import SVGInline from 'react-svg-inline';
import classnames from 'classnames';
import styles from './BigButtonForDialogs.scss';
type Props = {
label: string,
description: string,
icon: string,
onClick?: Function,
isDisabled?: boolean,
className?: string,
};
export default class BigButtonForDialogs extends Component<Props> {
render() {
const {
label,
description,
icon,
onClick,
isDisabled = false,
className,
} = this.props;
const componentClasses = classnames([
className,
styles.component,
isDisabled ? styles.disabled : null,
]);
return (
<button
className={componentClasses}
onClick={() => !isDisabled && onClick && onClick()}
>
<SVGInline svg={icon} className={styles.icon} />
<div className={styles.label}>{label}</div>
<div className={styles.description}>{description}</div>
</button>
);
}
}