mirror of
https://github.com/icewind1991/mapboundaries.git
synced 2026-06-03 10:54:07 +02:00
fix with new demos
This commit is contained in:
parent
58a3527ff3
commit
d6ebc070e5
4 changed files with 6160 additions and 20 deletions
6130
package-lock.json
generated
Normal file
6130
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
29
package.json
29
package.json
|
|
@ -1,20 +1,25 @@
|
|||
{
|
||||
"devDependencies": {
|
||||
"@types/node": "^7.0.12",
|
||||
"@types/react": "^15.0.21",
|
||||
"@types/node": "^7.0.48",
|
||||
"@types/react": "^15.6.7",
|
||||
"@types/react-dom": "^0.14.23",
|
||||
"clean-webpack-plugin": "^0.1.16",
|
||||
"css-loader": "^0.28.0",
|
||||
"extract-text-webpack-plugin": "^2.1.0",
|
||||
"html-webpack-plugin": "^2.28.0",
|
||||
"postcss-cssnext": "^2.10.0",
|
||||
"clean-webpack-plugin": "^0.1.17",
|
||||
"css-loader": "^0.28.7",
|
||||
"extract-text-webpack-plugin": "^2.1.2",
|
||||
"html-webpack-plugin": "^2.30.1",
|
||||
"postcss-cssnext": "^2.11.0",
|
||||
"postcss-loader": "^1.3.3",
|
||||
"postcss-nested": "^1.0.1",
|
||||
"react-hot-loader": "^3.0.0-beta.6",
|
||||
"react-hot-loader": "^3.1.3",
|
||||
"style-loader": "^0.16.1",
|
||||
"ts-loader": "^2.0.3",
|
||||
"typescript": "^2.2.2",
|
||||
"webpack": "^2.4.1",
|
||||
"webpack-dev-server": "^2.4.2"
|
||||
"ts-loader": "^2.3.7",
|
||||
"typescript": "^2.6.2",
|
||||
"webpack": "^2.7.0",
|
||||
"webpack-dev-server": "^2.9.7"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^16.2.0",
|
||||
"react-dom": "^16.2.0",
|
||||
"tf2-demo": "^1.1.5"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import * as React from 'react';
|
||||
import {Demo} from 'tf2-demo/build/Demo';
|
||||
import {DemoRender} from "./DemoRender";
|
||||
import {DemoRender} from './DemoRender';
|
||||
|
||||
export interface DemoViewerProps {
|
||||
demo: Demo | null;
|
||||
|
|
@ -39,7 +39,9 @@ export class DemoViewer extends React.Component<DemoViewerProps, {}> {
|
|||
height={this.props.height}
|
||||
className={this.props.className}
|
||||
ref={(canvas) => {
|
||||
this.canvas = canvas
|
||||
}}/>
|
||||
if (canvas) {
|
||||
this.canvas = canvas;
|
||||
}
|
||||
}}/>;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import * as React from 'react';
|
||||
import {Panner} from "./Panner/Panner";
|
||||
import {Panner} from './Panner/Panner';
|
||||
|
||||
import './MapContainer.css';
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ export class MapContainerState {
|
|||
}
|
||||
|
||||
export class MapContainer extends React.Component<MapContainerProps, MapContainerState> {
|
||||
container: Element;
|
||||
container: Element | null;
|
||||
state: MapContainerState = {
|
||||
width: 500,
|
||||
height: 800
|
||||
|
|
@ -26,6 +26,9 @@ export class MapContainer extends React.Component<MapContainerProps, MapContaine
|
|||
sendScale = false;
|
||||
|
||||
componentDidMount() {
|
||||
if (!this.container) {
|
||||
return;
|
||||
}
|
||||
if (this.container.clientWidth == this.state.width && this.container.clientHeight == this.state.height) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -54,6 +57,6 @@ export class MapContainer extends React.Component<MapContainerProps, MapContaine
|
|||
{this.props.children}
|
||||
</Panner>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue