react-DnR, dragable and resizable window
npm install @zigvy/react-dnrDraggable and Resizable window build with React.js.
Try it out here: http://yongxu.ren/react-DnR/
Installation
============
The easiest way to use react-DnR is to install it from npm and include it in your React build process (using Webpack, Browserify, etc).
```
npm install --save react-dnr
Example
=====
`jsx
import React from "react";
import ReactDOM from "react-dom";
import DnR from '../modules/DnR';
import {OSXTheme, WindowsTheme} from '../modules/themes';
const paneStyle = {
width: '80%',
height: '50%',
top: '25%',
left: '10%',
backgroundColor: 'rgba(0, 0, 0, 0.2)'
};
const buttonStyle = {
paddingLeft: 10,
textAlign: 'center'
};
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
minimize: false
};
this.OSX = OSXTheme({
title: 'OSX Theme',
onClose: ()=>this.refs.subdnr.minimize(),
onMinimize: ()=>this.refs.subdnr.minimize(),
onMaximize: ()=>this.refs.subdnr.maximize(),
});
this.Windows = WindowsTheme({
title: 'React DnR',
onClose: ()=>this.refs.dnr.minimize(),
onMinimize: ()=>this.refs.dnr.minimize(),
onMaximize: ()=>this.refs.dnr.maximize(),
});
}
render() {
return (
}}>
display: 'flex',
alignItems: 'center',
verticalAlign: 'baseline',
padding: 10,
}}>
style={buttonStyle}
onClick={()=>this.refs.dnr.minimize()}>
minimize
style={buttonStyle}
onClick={()=>this.refs.dnr.maximize()}>
maximize
style={buttonStyle}
onClick={()=>this.refs.dnr.restore()}>
restore
ReactDOM.render(
``