aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/ui/FAB.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/ui/FAB.js')
-rw-r--r--src/components/ui/FAB.js65
1 files changed, 0 insertions, 65 deletions
diff --git a/src/components/ui/FAB.js b/src/components/ui/FAB.js
deleted file mode 100644
index 55fe97e82..000000000
--- a/src/components/ui/FAB.js
+++ /dev/null
@@ -1,65 +0,0 @@
1/**
2 * Floating Action Button (FAB)
3 */
4import { Component } from 'react';
5import PropTypes from 'prop-types';
6import { observer } from 'mobx-react';
7import classnames from 'classnames';
8
9import { oneOrManyChildElements } from '../../prop-types';
10
11@observer
12class Button extends Component {
13 static propTypes = {
14 className: PropTypes.string,
15 disabled: PropTypes.bool,
16 onClick: PropTypes.func,
17 type: PropTypes.string,
18 children: oneOrManyChildElements.isRequired,
19 htmlForm: PropTypes.string,
20 };
21
22 static defaultProps = {
23 className: null,
24 disabled: false,
25 onClick: () => {},
26 type: 'button',
27 htmlForm: '',
28 };
29
30 element = null;
31
32 render() {
33 const { className, disabled, onClick, type, children, htmlForm } =
34 this.props;
35
36 const buttonProps = {
37 className: classnames({
38 ferdi__fab: true,
39 [`${className}`]: className,
40 }),
41 type,
42 };
43
44 if (disabled) {
45 buttonProps.disabled = true;
46 }
47
48 if (onClick) {
49 buttonProps.onClick = onClick;
50 }
51
52 if (htmlForm) {
53 buttonProps.form = htmlForm;
54 }
55
56 return (
57 // disabling rule as button has type defined in `buttonProps`
58 <button {...buttonProps} type="button">
59 {children}
60 </button>
61 );
62 }
63}
64
65export default Button;