mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-30 00:00:13 +01:00
33 lines
No EOL
1.1 KiB
JavaScript
33 lines
No EOL
1.1 KiB
JavaScript
/**
|
|
* File: widget-button.js
|
|
* Author: Ricardo Hernandez-Montoya <rhernandez@gridhound.de>
|
|
* Date: 29.03.2017
|
|
* Copyright: 2017, Institute for Automation of Complex Power Systems, EONERC
|
|
* This file is part of VILLASweb. All Rights Reserved. Proprietary and confidential.
|
|
* Unauthorized copying of this file, via any medium is strictly prohibited.
|
|
**********************************************************************************/
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
class WidgetButton extends Component {
|
|
|
|
action(e) {
|
|
e.target.blur(); // Remove focus
|
|
console.log('Button widget action');
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<div className="button-widget full">
|
|
{ this.props.editing ? (
|
|
<button className="full btn btn-default" type="button" disabled onClick={ this.action } >{this.props.widget.name}</button>
|
|
) : (
|
|
<button className="full btn btn-default" type="button" onClick={ this.action } >{this.props.widget.name}</button>
|
|
)
|
|
}
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default WidgetButton; |