André Wahlberg 09b16e52a7 Add misc CSS
2020-12-04 12:04:34 +01:00

34 lines
878 B
JavaScript

import React, { Component } from 'react';
import './css/Button.css';
class Button extends Component {
// Multiple onClick functions
onClick = () => {
console.log(this.props.onClick);
if (this.props.onClick !== null
&& this.props.onClick !== undefined) {
if (Array.isArray(this.props.onClick)) {
this.props.onClick.forEach(func => {
func();
});
} else {
console.log("Error when parsing Button onClick functions.");
}
} else {
console.log("Error when parsing Button onClick functions.");
}
}
render() {
return (
<button className={this.props.className} onClick={this.onClick}>
{this.props.children}
</button>
);
}
}
export default Button;