initial setup of widget
This commit is contained in:
8
src/index.js
Normal file
8
src/index.js
Normal 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
41
src/widget.js
Normal 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
17
src/widget.scss
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user