initial setup of widget

This commit is contained in:
Benjamin Boudreau
2018-05-26 14:53:54 -04:00
commit 370b5cc7fa
9 changed files with 12564 additions and 0 deletions

8
src/index.js Normal file
View File

@@ -0,0 +1,8 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Widget from './widget';
ReactDOM.render(
<Widget/>,
document.getElementById('app')
);

41
src/widget.js Normal file
View File

@@ -0,0 +1,41 @@
import React from 'react';
import PropTypes from 'prop-types';
import './widget.scss'
class Widget extends React.Component {
state = {
opened: false,
}
handleOpen = () => {
}
render() {
let body = "";
if (this.state.opened) {
body = (
<div className="widget-dialog">
<div className="widget-title">
Open
</div>
<div className="widget-body">
Body
</div>
<div className="widget-footer">
Footer
</div>
</div>
);
}
return (
<div className="widget">
Open
{body}
</div>
);
}
}
Widget.propTypes = {};
export default Widget;

17
src/widget.scss Normal file
View File

@@ -0,0 +1,17 @@
.widget {
position: fixed;
bottom: 10px;
right: 10px;
width: 50px;
height: 20px;
text-align: center;
border: 1px solid;
padding: 10px;
}
.widget:hover {
background-color: blue;
color: white;
cursor: pointer;
}