mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-09 18:02:50 +01:00
25 lines
465 B
JavaScript
25 lines
465 B
JavaScript
import React from 'react';
|
|
|
|
export default class WindowSystem extends React.Component {
|
|
|
|
constructor() {
|
|
super();
|
|
this.state = {
|
|
windows: []
|
|
}
|
|
}
|
|
|
|
render() {
|
|
return this.state.windows;
|
|
}
|
|
|
|
addWindow(window) {
|
|
this.setState({windows: [...this.state.windows, window]});
|
|
}
|
|
|
|
removeWindow(window) {
|
|
let windows = [...this.state.windows];
|
|
windows.splice(windows.indexOf(window), 1);
|
|
this.setState({windows});
|
|
}
|
|
}
|