mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 14:33:22 +00:00
Upgrade to React 15.5
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const TestUtils = {
|
||||
createContextProvider: function(context) {
|
||||
var _contextTypes = {};
|
||||
|
||||
Object.keys(context).forEach(function(key) {
|
||||
_contextTypes[key] = React.PropTypes.any;
|
||||
_contextTypes[key] = PropTypes.any;
|
||||
});
|
||||
|
||||
return React.createClass({
|
||||
|
||||
@@ -97,10 +97,11 @@
|
||||
"fbemitter": "^2.0.0",
|
||||
"lodash": "^4.15.0",
|
||||
"lz-string": "^1.4.4",
|
||||
"react": "^15.0.1",
|
||||
"react-dom": "^15.0.1",
|
||||
"prop-types": "^15.5.8",
|
||||
"react": "^15.5.4",
|
||||
"react-dom": "^15.5.4",
|
||||
"react-number-editor": "Athanasius/react-number-editor.git#miggy",
|
||||
"recharts": "^0.21.2",
|
||||
"recharts": "^0.22.3",
|
||||
"superagent": "^1.4.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Router from './Router';
|
||||
import { EventEmitter } from 'fbemitter';
|
||||
import { getLanguage } from './i18n/Language';
|
||||
@@ -27,18 +28,18 @@ const zlib = require('zlib');
|
||||
export default class Coriolis extends React.Component {
|
||||
|
||||
static childContextTypes = {
|
||||
closeMenu: React.PropTypes.func.isRequired,
|
||||
hideModal: React.PropTypes.func.isRequired,
|
||||
language: React.PropTypes.object.isRequired,
|
||||
noTouch: React.PropTypes.bool.isRequired,
|
||||
onCommand: React.PropTypes.func.isRequired,
|
||||
onWindowResize: React.PropTypes.func.isRequired,
|
||||
openMenu: React.PropTypes.func.isRequired,
|
||||
route: React.PropTypes.object.isRequired,
|
||||
showModal: React.PropTypes.func.isRequired,
|
||||
sizeRatio: React.PropTypes.number.isRequired,
|
||||
termtip: React.PropTypes.func.isRequired,
|
||||
tooltip: React.PropTypes.func.isRequired
|
||||
closeMenu: PropTypes.func.isRequired,
|
||||
hideModal: PropTypes.func.isRequired,
|
||||
language: PropTypes.object.isRequired,
|
||||
noTouch: PropTypes.bool.isRequired,
|
||||
onCommand: PropTypes.func.isRequired,
|
||||
onWindowResize: PropTypes.func.isRequired,
|
||||
openMenu: PropTypes.func.isRequired,
|
||||
route: PropTypes.object.isRequired,
|
||||
showModal: PropTypes.func.isRequired,
|
||||
sizeRatio: PropTypes.number.isRequired,
|
||||
termtip: PropTypes.func.isRequired,
|
||||
tooltip: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import * as ModuleUtils from '../shipyard/ModuleUtils';
|
||||
import { findDOMNode } from 'react-dom';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
@@ -83,12 +84,12 @@ const CATEGORIES = {
|
||||
export default class AvailableModulesMenu extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
modules: React.PropTypes.oneOfType([React.PropTypes.object, React.PropTypes.array]).isRequired,
|
||||
onSelect: React.PropTypes.func.isRequired,
|
||||
diffDetails: React.PropTypes.func,
|
||||
m: React.PropTypes.object,
|
||||
shipMass: React.PropTypes.number,
|
||||
warning: React.PropTypes.func
|
||||
modules: PropTypes.oneOfType([PropTypes.object, PropTypes.array]).isRequired,
|
||||
onSelect: PropTypes.func.isRequired,
|
||||
diffDetails: PropTypes.func,
|
||||
m: PropTypes.object,
|
||||
shipMass: PropTypes.number,
|
||||
warning: PropTypes.func
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import * as d3 from 'd3';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
|
||||
@@ -45,16 +46,16 @@ export default class BarChart extends TranslatedComponent {
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
colors: React.PropTypes.array,
|
||||
data: React.PropTypes.array.isRequired,
|
||||
desc: React.PropTypes.bool,
|
||||
format: React.PropTypes.string.isRequired,
|
||||
labels: React.PropTypes.array,
|
||||
predicate: React.PropTypes.string,
|
||||
properties: React.PropTypes.array,
|
||||
title: React.PropTypes.string.isRequired,
|
||||
unit: React.PropTypes.string.isRequired,
|
||||
width: React.PropTypes.number.isRequired
|
||||
colors: PropTypes.array,
|
||||
data: PropTypes.array.isRequired,
|
||||
desc: PropTypes.bool,
|
||||
format: PropTypes.string.isRequired,
|
||||
labels: PropTypes.array,
|
||||
predicate: PropTypes.string,
|
||||
properties: PropTypes.array,
|
||||
title: PropTypes.string.isRequired,
|
||||
unit: PropTypes.string.isRequired,
|
||||
width: PropTypes.number.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import { Ships } from 'coriolis-data/dist';
|
||||
import { nameComparator } from '../utils/SlotFunctions';
|
||||
@@ -14,10 +15,10 @@ import Module from '../shipyard/Module';
|
||||
*/
|
||||
export default class Boost extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
marker: React.PropTypes.string.isRequired,
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
boost: React.PropTypes.bool.isRequired,
|
||||
onChange: React.PropTypes.func.isRequired
|
||||
marker: PropTypes.string.isRequired,
|
||||
ship: PropTypes.object.isRequired,
|
||||
boost: PropTypes.bool.isRequired,
|
||||
onChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import { Ships } from 'coriolis-data/dist';
|
||||
import Slider from '../components/Slider';
|
||||
@@ -9,9 +10,9 @@ import Slider from '../components/Slider';
|
||||
*/
|
||||
export default class Cargo extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
cargo: React.PropTypes.number.isRequired,
|
||||
cargoCapacity: React.PropTypes.number.isRequired,
|
||||
onChange: React.PropTypes.func.isRequired
|
||||
cargo: PropTypes.number.isRequired,
|
||||
cargoCapacity: PropTypes.number.isRequired,
|
||||
onChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import Link from './Link';
|
||||
import cn from 'classnames';
|
||||
@@ -11,11 +12,11 @@ import { outfitURL } from '../utils/UrlGenerators';
|
||||
export default class ComparisonTable extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
facets: React.PropTypes.array.isRequired,
|
||||
builds: React.PropTypes.array.isRequired,
|
||||
onSort: React.PropTypes.func.isRequired,
|
||||
predicate: React.PropTypes.string.isRequired, // Used only to test again prop changes for shouldRender
|
||||
desc: React.PropTypes.oneOfType([React.PropTypes.bool.isRequired, React.PropTypes.number.isRequired]), // Used only to test again prop changes for shouldRender
|
||||
facets: PropTypes.array.isRequired,
|
||||
builds: PropTypes.array.isRequired,
|
||||
onSort: PropTypes.func.isRequired,
|
||||
predicate: PropTypes.string.isRequired, // Used only to test again prop changes for shouldRender
|
||||
desc: PropTypes.oneOfType([PropTypes.bool.isRequired, PropTypes.number.isRequired]), // Used only to test again prop changes for shouldRender
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import cn from 'classnames';
|
||||
import { Ships } from 'coriolis-data/dist';
|
||||
import Persist from '../stores/Persist';
|
||||
@@ -14,9 +15,9 @@ import { ShoppingIcon } from '../components/SvgIcons';
|
||||
export default class CostSection extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
code: React.PropTypes.string.isRequired,
|
||||
buildName: React.PropTypes.string
|
||||
ship: PropTypes.object.isRequired,
|
||||
code: PropTypes.string.isRequired,
|
||||
buildName: PropTypes.string
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import * as Calc from '../shipyard/Calculations';
|
||||
import PieChart from './PieChart';
|
||||
@@ -14,12 +15,12 @@ import VerticalBarChart from './VerticalBarChart';
|
||||
*/
|
||||
export default class Defence extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
marker: React.PropTypes.string.isRequired,
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
opponent: React.PropTypes.object.isRequired,
|
||||
engagementrange: React.PropTypes.number.isRequired,
|
||||
sys: React.PropTypes.number.isRequired,
|
||||
opponentWep: React.PropTypes.number.isRequired
|
||||
marker: PropTypes.string.isRequired,
|
||||
ship: PropTypes.object.isRequired,
|
||||
opponent: PropTypes.object.isRequired,
|
||||
engagementrange: PropTypes.number.isRequired,
|
||||
sys: PropTypes.number.isRequired,
|
||||
opponentWep: PropTypes.number.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import { Ships } from 'coriolis-data/dist';
|
||||
import Slider from '../components/Slider';
|
||||
@@ -9,9 +10,9 @@ import Slider from '../components/Slider';
|
||||
*/
|
||||
export default class EngagementRange extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
engagementRange: React.PropTypes.number.isRequired,
|
||||
onChange: React.PropTypes.func.isRequired
|
||||
ship: PropTypes.object.isRequired,
|
||||
engagementRange: PropTypes.number.isRequired,
|
||||
onChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import { Ships } from 'coriolis-data/dist';
|
||||
import { nameComparator } from '../utils/SlotFunctions';
|
||||
@@ -13,12 +14,12 @@ import * as Calc from '../shipyard/Calculations';
|
||||
*/
|
||||
export default class EngineProfile extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
cargo: React.PropTypes.number.isRequired,
|
||||
fuel: React.PropTypes.number.isRequired,
|
||||
eng: React.PropTypes.number.isRequired,
|
||||
boost: React.PropTypes.bool.isRequired,
|
||||
marker: React.PropTypes.string.isRequired
|
||||
ship: PropTypes.object.isRequired,
|
||||
cargo: PropTypes.number.isRequired,
|
||||
fuel: PropTypes.number.isRequired,
|
||||
eng: PropTypes.number.isRequired,
|
||||
boost: PropTypes.bool.isRequired,
|
||||
marker: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import { Ships } from 'coriolis-data/dist';
|
||||
import { nameComparator } from '../utils/SlotFunctions';
|
||||
@@ -13,10 +14,10 @@ import * as Calc from '../shipyard/Calculations';
|
||||
*/
|
||||
export default class FSDProfile extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
cargo: React.PropTypes.number.isRequired,
|
||||
fuel: React.PropTypes.number.isRequired,
|
||||
marker: React.PropTypes.string.isRequired
|
||||
ship: PropTypes.object.isRequired,
|
||||
cargo: PropTypes.number.isRequired,
|
||||
fuel: PropTypes.number.isRequired,
|
||||
marker: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import { Ships } from 'coriolis-data/dist';
|
||||
import Slider from '../components/Slider';
|
||||
@@ -9,9 +10,9 @@ import Slider from '../components/Slider';
|
||||
*/
|
||||
export default class Fuel extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
fuel: React.PropTypes.number.isRequired,
|
||||
fuelCapacity: React.PropTypes.number.isRequired,
|
||||
onChange: React.PropTypes.func.isRequired
|
||||
fuel: PropTypes.number.isRequired,
|
||||
fuelCapacity: PropTypes.number.isRequired,
|
||||
onChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import { Ships } from 'coriolis-data/dist';
|
||||
import { nameComparator } from '../utils/SlotFunctions';
|
||||
@@ -13,8 +14,8 @@ import * as Calc from '../shipyard/Calculations';
|
||||
*/
|
||||
export default class JumpRange extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
code: React.PropTypes.string.isRequired
|
||||
ship: PropTypes.object.isRequired,
|
||||
code: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Measure from 'react-measure';
|
||||
import * as d3 from 'd3';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
@@ -20,21 +21,21 @@ export default class LineChart extends TranslatedComponent {
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
func: React.PropTypes.func.isRequired,
|
||||
xLabel: React.PropTypes.string.isRequired,
|
||||
xMin: React.PropTypes.number,
|
||||
xMax: React.PropTypes.number.isRequired,
|
||||
xUnit: React.PropTypes.string.isRequired,
|
||||
xMark: React.PropTypes.number,
|
||||
yLabel: React.PropTypes.string.isRequired,
|
||||
yMin: React.PropTypes.number,
|
||||
yMax: React.PropTypes.number.isRequired,
|
||||
yUnit: React.PropTypes.string,
|
||||
series: React.PropTypes.array,
|
||||
colors: React.PropTypes.array,
|
||||
points: React.PropTypes.number,
|
||||
aspect: React.PropTypes.number,
|
||||
code: React.PropTypes.string,
|
||||
func: PropTypes.func.isRequired,
|
||||
xLabel: PropTypes.string.isRequired,
|
||||
xMin: PropTypes.number,
|
||||
xMax: PropTypes.number.isRequired,
|
||||
xUnit: PropTypes.string.isRequired,
|
||||
xMark: PropTypes.number,
|
||||
yLabel: PropTypes.string.isRequired,
|
||||
yMin: PropTypes.number,
|
||||
yMax: PropTypes.number.isRequired,
|
||||
yUnit: PropTypes.string,
|
||||
series: PropTypes.array,
|
||||
colors: PropTypes.array,
|
||||
points: PropTypes.number,
|
||||
aspect: PropTypes.number,
|
||||
code: PropTypes.string,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Router from '../Router';
|
||||
import { shallowEqual } from '../utils/UtilityFunctions';
|
||||
|
||||
@@ -8,9 +9,9 @@ import { shallowEqual } from '../utils/UtilityFunctions';
|
||||
export default class Link extends React.Component {
|
||||
|
||||
static propTypes = {
|
||||
children: React.PropTypes.any,
|
||||
href: React.PropTypes.string.isRequired,
|
||||
onClick: React.PropTypes.func
|
||||
children: PropTypes.any,
|
||||
href: PropTypes.string.isRequired,
|
||||
onClick: PropTypes.func
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import { Ships } from 'coriolis-data/dist';
|
||||
import Persist from '../stores/Persist';
|
||||
@@ -22,8 +23,8 @@ function buildComparator(a, b) {
|
||||
export default class ModalCompare extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
onSelect: React.PropTypes.func.isRequired,
|
||||
builds: React.PropTypes.array
|
||||
onSelect: PropTypes.func.isRequired,
|
||||
builds: PropTypes.array
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { findDOMNode } from 'react-dom';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
|
||||
@@ -8,9 +9,9 @@ import TranslatedComponent from './TranslatedComponent';
|
||||
export default class ModalExport extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
title: React.PropTypes.string,
|
||||
generator: React.PropTypes.func,
|
||||
data: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.object, React.PropTypes.array])
|
||||
title: PropTypes.string,
|
||||
generator: PropTypes.func,
|
||||
data: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.array])
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* eslint react/no-danger: 0 */
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import { findDOMNode } from 'react-dom';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
@@ -9,7 +10,7 @@ import TranslatedComponent from './TranslatedComponent';
|
||||
export default class ModalHelp extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
title: React.PropTypes.string
|
||||
title: PropTypes.string
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { findDOMNode } from 'react-dom';
|
||||
import cn from 'classnames';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
@@ -86,7 +87,7 @@ export default class ModalImport extends TranslatedComponent {
|
||||
|
||||
|
||||
static propTypes = {
|
||||
builds: React.PropTypes.object, // Optional: Import object
|
||||
builds: PropTypes.object, // Optional: Import object
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import ShortenUrl from '../utils/ShortenUrl';
|
||||
|
||||
@@ -8,7 +9,7 @@ import ShortenUrl from '../utils/ShortenUrl';
|
||||
export default class ModalPermalink extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
url: React.PropTypes.string.isRequired
|
||||
url: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import cn from 'classnames';
|
||||
import NumberEditor from 'react-number-editor';
|
||||
@@ -9,11 +10,11 @@ import NumberEditor from 'react-number-editor';
|
||||
export default class Modification extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
m: React.PropTypes.object.isRequired,
|
||||
name: React.PropTypes.string.isRequired,
|
||||
value: React.PropTypes.number.isRequired,
|
||||
onChange: React.PropTypes.func.isRequired
|
||||
ship: PropTypes.object.isRequired,
|
||||
m: PropTypes.object.isRequired,
|
||||
name: PropTypes.string.isRequired,
|
||||
value: PropTypes.number.isRequired,
|
||||
onChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import * as _ from 'lodash';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import { isEmpty, stopCtxPropagation } from '../utils/UtilityFunctions';
|
||||
@@ -13,10 +14,10 @@ import { getBlueprint, blueprintTooltip, setWorst, setBest, setExtreme, setRando
|
||||
export default class ModificationsMenu extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
m: React.PropTypes.object.isRequired,
|
||||
marker: React.PropTypes.string.isRequired,
|
||||
onChange: React.PropTypes.func.isRequired
|
||||
ship: PropTypes.object.isRequired,
|
||||
m: PropTypes.object.isRequired,
|
||||
marker: PropTypes.string.isRequired,
|
||||
onChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
|
||||
/**
|
||||
@@ -6,12 +7,12 @@ import TranslatedComponent from './TranslatedComponent';
|
||||
*/
|
||||
export default class Movement extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
marker: React.PropTypes.string.isRequired,
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
boost: React.PropTypes.bool.isRequired,
|
||||
eng: React.PropTypes.number.isRequired,
|
||||
fuel: React.PropTypes.number.isRequired,
|
||||
cargo: React.PropTypes.number.isRequired
|
||||
marker: PropTypes.string.isRequired,
|
||||
ship: PropTypes.object.isRequired,
|
||||
boost: PropTypes.bool.isRequired,
|
||||
eng: PropTypes.number.isRequired,
|
||||
fuel: PropTypes.number.isRequired,
|
||||
cargo: PropTypes.number.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import * as Calc from '../shipyard/Calculations';
|
||||
import PieChart from './PieChart';
|
||||
@@ -51,12 +52,12 @@ export function weaponComparator(translate, propComparator, desc) {
|
||||
*/
|
||||
export default class Offence extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
marker: React.PropTypes.string.isRequired,
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
opponent: React.PropTypes.object.isRequired,
|
||||
engagementrange: React.PropTypes.number.isRequired,
|
||||
wep: React.PropTypes.number.isRequired,
|
||||
opponentSys: React.PropTypes.number.isRequired
|
||||
marker: PropTypes.string.isRequired,
|
||||
ship: PropTypes.object.isRequired,
|
||||
opponent: PropTypes.object.isRequired,
|
||||
engagementrange: PropTypes.number.isRequired,
|
||||
wep: PropTypes.number.isRequired,
|
||||
opponentSys: PropTypes.number.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import cn from 'classnames';
|
||||
import { Ships } from 'coriolis-data/dist';
|
||||
import Ship from '../shipyard/Ship';
|
||||
@@ -19,22 +20,22 @@ import WeaponDamageChart from './WeaponDamageChart';
|
||||
export default class OutfittingSubpages extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
code: React.PropTypes.string.isRequired,
|
||||
onChange: React.PropTypes.func.isRequired,
|
||||
buildName: React.PropTypes.string,
|
||||
sys: React.PropTypes.number.isRequired,
|
||||
eng: React.PropTypes.number.isRequired,
|
||||
wep: React.PropTypes.number.isRequired,
|
||||
cargo: React.PropTypes.number.isRequired,
|
||||
fuel: React.PropTypes.number.isRequired,
|
||||
boost: React.PropTypes.bool.isRequired,
|
||||
engagementRange: React.PropTypes.number.isRequired,
|
||||
opponent: React.PropTypes.object.isRequired,
|
||||
opponentBuild: React.PropTypes.string,
|
||||
opponentSys: React.PropTypes.number.isRequired,
|
||||
opponentEng: React.PropTypes.number.isRequired,
|
||||
opponentWep: React.PropTypes.number.isRequired,
|
||||
ship: PropTypes.object.isRequired,
|
||||
code: PropTypes.string.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
buildName: PropTypes.string,
|
||||
sys: PropTypes.number.isRequired,
|
||||
eng: PropTypes.number.isRequired,
|
||||
wep: PropTypes.number.isRequired,
|
||||
cargo: PropTypes.number.isRequired,
|
||||
fuel: PropTypes.number.isRequired,
|
||||
boost: PropTypes.bool.isRequired,
|
||||
engagementRange: PropTypes.number.isRequired,
|
||||
opponent: PropTypes.object.isRequired,
|
||||
opponentBuild: PropTypes.string,
|
||||
opponentSys: PropTypes.number.isRequired,
|
||||
opponentEng: PropTypes.number.isRequired,
|
||||
opponentWep: PropTypes.number.isRequired,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Measure from 'react-measure';
|
||||
import * as d3 from 'd3';
|
||||
|
||||
@@ -11,7 +12,7 @@ const LABEL_COLOUR = '#000000';
|
||||
export default class PieChart extends Component {
|
||||
|
||||
static propTypes = {
|
||||
data : React.PropTypes.array.isRequired
|
||||
data : PropTypes.array.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import { Ships } from 'coriolis-data/dist';
|
||||
import { nameComparator } from '../utils/SlotFunctions';
|
||||
@@ -14,10 +15,10 @@ import Module from '../shipyard/Module';
|
||||
*/
|
||||
export default class Pips extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
sys: React.PropTypes.number.isRequired,
|
||||
eng: React.PropTypes.number.isRequired,
|
||||
wep: React.PropTypes.number.isRequired,
|
||||
onChange: React.PropTypes.func.isRequired
|
||||
sys: PropTypes.number.isRequired,
|
||||
eng: PropTypes.number.isRequired,
|
||||
wep: PropTypes.number.isRequired,
|
||||
onChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import * as d3 from 'd3';
|
||||
import cn from 'classnames';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
@@ -33,10 +34,10 @@ function bandText(val, index, wattScale) {
|
||||
export default class PowerBands extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
bands: React.PropTypes.array.isRequired,
|
||||
available: React.PropTypes.number.isRequired,
|
||||
width: React.PropTypes.number.isRequired,
|
||||
code: React.PropTypes.string,
|
||||
bands: PropTypes.array.isRequired,
|
||||
available: PropTypes.number.isRequired,
|
||||
width: PropTypes.number.isRequired,
|
||||
code: PropTypes.string,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { findDOMNode } from 'react-dom';
|
||||
import cn from 'classnames';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
@@ -18,9 +19,9 @@ const POWER = [
|
||||
*/
|
||||
export default class PowerManagement extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
code: React.PropTypes.string.isRequired,
|
||||
onChange: React.PropTypes.func.isRequired
|
||||
ship: PropTypes.object.isRequired,
|
||||
code: PropTypes.string.isRequired,
|
||||
onChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import Ship from '../shipyard/Ship';
|
||||
import { Ships } from 'coriolis-data/dist';
|
||||
@@ -12,9 +13,9 @@ import cn from 'classnames';
|
||||
*/
|
||||
export default class ShipPicker extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
onChange: React.PropTypes.func.isRequired,
|
||||
ship: React.PropTypes.string.isRequired,
|
||||
build: React.PropTypes.string
|
||||
onChange: PropTypes.func.isRequired,
|
||||
ship: PropTypes.string.isRequired,
|
||||
build: PropTypes.string
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import cn from 'classnames';
|
||||
import { Warning } from './SvgIcons';
|
||||
@@ -10,10 +11,10 @@ import * as Calc from '../shipyard/Calculations';
|
||||
export default class ShipSummaryTable extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
cargo: React.PropTypes.number.isRequired,
|
||||
fuel: React.PropTypes.number.isRequired,
|
||||
marker: React.PropTypes.string.isRequired,
|
||||
ship: PropTypes.object.isRequired,
|
||||
cargo: PropTypes.number.isRequired,
|
||||
fuel: PropTypes.number.isRequired,
|
||||
marker: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { findDOMNode } from 'react-dom';
|
||||
|
||||
const MARGIN_LR = 8; // Left/ Right margin
|
||||
@@ -16,14 +17,14 @@ export default class Slider extends React.Component {
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
axis: React.PropTypes.bool,
|
||||
axisUnit: React.PropTypes.string,
|
||||
max: React.PropTypes.number,
|
||||
min: React.PropTypes.number,
|
||||
onChange: React.PropTypes.func.isRequired,
|
||||
onResize: React.PropTypes.func,
|
||||
percent: React.PropTypes.number.isRequired,
|
||||
scale: React.PropTypes.number
|
||||
axis: PropTypes.bool,
|
||||
axisUnit: PropTypes.string,
|
||||
max: PropTypes.number,
|
||||
min: PropTypes.number,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
onResize: PropTypes.func,
|
||||
percent: PropTypes.number.isRequired,
|
||||
scale: PropTypes.number
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import cn from 'classnames';
|
||||
import AvailableModulesMenu from './AvailableModulesMenu';
|
||||
@@ -13,18 +14,18 @@ import { stopCtxPropagation } from '../utils/UtilityFunctions';
|
||||
export default class Slot extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
availableModules: React.PropTypes.func.isRequired,
|
||||
onSelect: React.PropTypes.func.isRequired,
|
||||
onOpen: React.PropTypes.func.isRequired,
|
||||
maxClass: React.PropTypes.number.isRequired,
|
||||
selected: React.PropTypes.bool,
|
||||
m: React.PropTypes.object,
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
eligible: React.PropTypes.object,
|
||||
warning: React.PropTypes.func,
|
||||
drag: React.PropTypes.func,
|
||||
drop: React.PropTypes.func,
|
||||
dropClass: React.PropTypes.string
|
||||
availableModules: PropTypes.func.isRequired,
|
||||
onSelect: PropTypes.func.isRequired,
|
||||
onOpen: PropTypes.func.isRequired,
|
||||
maxClass: PropTypes.number.isRequired,
|
||||
selected: PropTypes.bool,
|
||||
m: PropTypes.object,
|
||||
ship: PropTypes.object.isRequired,
|
||||
eligible: PropTypes.object,
|
||||
warning: PropTypes.func,
|
||||
drag: PropTypes.func,
|
||||
drop: PropTypes.func,
|
||||
dropClass: PropTypes.string
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import { wrapCtxMenu } from '../utils/UtilityFunctions';
|
||||
import { canMount } from '../utils/SlotFunctions';
|
||||
@@ -11,10 +12,10 @@ import cn from 'classnames';
|
||||
export default class SlotSection extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
onChange: React.PropTypes.func.isRequired,
|
||||
code: React.PropTypes.string.isRequired,
|
||||
togglePwr: React.PropTypes.func
|
||||
ship: PropTypes.object.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
code: PropTypes.string.isRequired,
|
||||
togglePwr: PropTypes.func
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import cn from 'classnames';
|
||||
import Persist from '../stores/Persist';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
@@ -17,14 +18,14 @@ import { blueprintTooltip } from '../utils/BlueprintFunctions';
|
||||
export default class StandardSlot extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
slot: React.PropTypes.object,
|
||||
modules: React.PropTypes.array.isRequired,
|
||||
onSelect: React.PropTypes.func.isRequired,
|
||||
onOpen: React.PropTypes.func.isRequired,
|
||||
onChange: React.PropTypes.func.isRequired,
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
selected: React.PropTypes.bool,
|
||||
warning: React.PropTypes.func,
|
||||
slot: PropTypes.object,
|
||||
modules: PropTypes.array.isRequired,
|
||||
onSelect: PropTypes.func.isRequired,
|
||||
onOpen: PropTypes.func.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
ship: PropTypes.object.isRequired,
|
||||
selected: PropTypes.bool,
|
||||
warning: PropTypes.func,
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import cn from 'classnames';
|
||||
import { shallowEqual } from '../utils/UtilityFunctions';
|
||||
|
||||
@@ -8,8 +9,8 @@ import { shallowEqual } from '../utils/UtilityFunctions';
|
||||
class SvgIcon extends React.Component {
|
||||
|
||||
static propTypes = {
|
||||
className: React.PropTypes.any,
|
||||
style: React.PropTypes.object
|
||||
className: PropTypes.any,
|
||||
style: PropTypes.object
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
|
||||
/**
|
||||
@@ -7,8 +8,8 @@ import TranslatedComponent from './TranslatedComponent';
|
||||
export default class Tooltip extends TranslatedComponent {
|
||||
|
||||
static propTypes = {
|
||||
rect: React.PropTypes.object.isRequired,
|
||||
options: React.PropTypes.object
|
||||
rect: PropTypes.object.isRequired,
|
||||
options: PropTypes.object
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { shallowEqual } from '../utils/UtilityFunctions';
|
||||
|
||||
/**
|
||||
@@ -7,15 +8,15 @@ import { shallowEqual } from '../utils/UtilityFunctions';
|
||||
export default class TranslatedComponent extends React.Component {
|
||||
|
||||
static contextTypes = {
|
||||
language: React.PropTypes.object.isRequired,
|
||||
sizeRatio: React.PropTypes.number.isRequired,
|
||||
openMenu: React.PropTypes.func.isRequired,
|
||||
closeMenu: React.PropTypes.func.isRequired,
|
||||
showModal: React.PropTypes.func.isRequired,
|
||||
hideModal: React.PropTypes.func.isRequired,
|
||||
tooltip: React.PropTypes.func.isRequired,
|
||||
termtip: React.PropTypes.func.isRequired,
|
||||
onWindowResize: React.PropTypes.func.isRequired
|
||||
language: PropTypes.object.isRequired,
|
||||
sizeRatio: PropTypes.number.isRequired,
|
||||
openMenu: PropTypes.func.isRequired,
|
||||
closeMenu: PropTypes.func.isRequired,
|
||||
showModal: PropTypes.func.isRequired,
|
||||
hideModal: PropTypes.func.isRequired,
|
||||
tooltip: PropTypes.func.isRequired,
|
||||
termtip: PropTypes.func.isRequired,
|
||||
onWindowResize: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -87,13 +87,13 @@ export default class VerticalBarChart extends TranslatedComponent {
|
||||
/**
|
||||
* A label that displays the value within the bar of the chart
|
||||
*/
|
||||
const ValueLabel = React.createClass({
|
||||
propTypes: {
|
||||
class ValueLabel extends React.Component {
|
||||
static propTypes = {
|
||||
x: PropTypes.number,
|
||||
y: PropTypes.number,
|
||||
payload: PropTypes.object,
|
||||
value: PropTypes.number
|
||||
},
|
||||
};
|
||||
|
||||
render() {
|
||||
const { x, y, payload, value } = this.props;
|
||||
@@ -104,4 +104,4 @@ const ValueLabel = React.createClass({
|
||||
<text x={x} y={y} fill="#000000" textAnchor="middle" dy={20} style={{ fontSize: em }}>{value}</text>
|
||||
);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import TranslatedComponent from './TranslatedComponent';
|
||||
import { Ships } from 'coriolis-data/dist';
|
||||
import { nameComparator } from '../utils/SlotFunctions';
|
||||
@@ -15,12 +16,12 @@ const DAMAGE_DEALT_COLORS = ['#FFFFFF', '#FF0000', '#00FF00', '#7777FF', '#FFFF0
|
||||
*/
|
||||
export default class WeaponDamageChart extends TranslatedComponent {
|
||||
static propTypes = {
|
||||
ship: React.PropTypes.object.isRequired,
|
||||
opponent: React.PropTypes.object.isRequired,
|
||||
hull: React.PropTypes.bool.isRequired,
|
||||
engagementRange: React.PropTypes.number.isRequired,
|
||||
opponentSys: React.PropTypes.number.isRequired,
|
||||
marker: React.PropTypes.string.isRequired
|
||||
ship: PropTypes.object.isRequired,
|
||||
opponent: PropTypes.object.isRequired,
|
||||
hull: PropTypes.bool.isRequired,
|
||||
engagementRange: PropTypes.number.isRequired,
|
||||
opponentSys: PropTypes.number.isRequired,
|
||||
marker: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
/**
|
||||
* Unexpected Error page / block
|
||||
@@ -6,12 +7,12 @@ import React from 'react';
|
||||
export default class ErrorDetails extends React.Component {
|
||||
|
||||
static contextTypes = {
|
||||
route: React.PropTypes.object.isRequired,
|
||||
language: React.PropTypes.object.isRequired
|
||||
route: PropTypes.object.isRequired,
|
||||
language: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
error: React.PropTypes.object.isRequired
|
||||
error: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import ErrorDetails from './ErrorDetails';
|
||||
import { shallowEqual } from '../utils/UtilityFunctions';
|
||||
|
||||
@@ -8,22 +9,22 @@ import { shallowEqual } from '../utils/UtilityFunctions';
|
||||
export default class Page extends React.Component {
|
||||
|
||||
static contextTypes = {
|
||||
closeMenu: React.PropTypes.func.isRequired,
|
||||
hideModal: React.PropTypes.func.isRequired,
|
||||
language: React.PropTypes.object.isRequired,
|
||||
noTouch: React.PropTypes.bool.isRequired,
|
||||
onCommand: React.PropTypes.func.isRequired,
|
||||
onWindowResize: React.PropTypes.func.isRequired,
|
||||
openMenu: React.PropTypes.func.isRequired,
|
||||
route: React.PropTypes.object.isRequired,
|
||||
showModal: React.PropTypes.func.isRequired,
|
||||
sizeRatio: React.PropTypes.number.isRequired,
|
||||
termtip: React.PropTypes.func.isRequired,
|
||||
tooltip: React.PropTypes.func.isRequired
|
||||
closeMenu: PropTypes.func.isRequired,
|
||||
hideModal: PropTypes.func.isRequired,
|
||||
language: PropTypes.object.isRequired,
|
||||
noTouch: PropTypes.bool.isRequired,
|
||||
onCommand: PropTypes.func.isRequired,
|
||||
onWindowResize: PropTypes.func.isRequired,
|
||||
openMenu: PropTypes.func.isRequired,
|
||||
route: PropTypes.object.isRequired,
|
||||
showModal: PropTypes.func.isRequired,
|
||||
sizeRatio: PropTypes.number.isRequired,
|
||||
termtip: PropTypes.func.isRequired,
|
||||
tooltip: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
currentMenu: React.PropTypes.any
|
||||
currentMenu: PropTypes.any
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user