mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
more rewrite work
This commit is contained in:
760
package-lock.json
generated
760
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -4,8 +4,8 @@ import { CoriolisLogo, Hammer, Rocket, Cogs, Help, StatsBars } from './SvgIcons'
|
||||
|
||||
const cn = (...args) => args.join(' ')
|
||||
const translate = (args) => args;
|
||||
const hasBuilds = false
|
||||
const openedMenu = false
|
||||
const hasBuilds = () => false
|
||||
const openedMenu = () => false
|
||||
|
||||
class Header extends Component {
|
||||
render() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import * as Forge from 'ed-forge';
|
||||
import {getShipMetaProperty} from 'ed-forge/lib/data/ships';
|
||||
import {FORGE_SHIPS} from '../utils/Constants';
|
||||
|
||||
import {Link} from 'react-router-dom';
|
||||
import cn from 'classnames';
|
||||
|
||||
@@ -49,10 +49,34 @@ class ShipTable extends Component {
|
||||
}
|
||||
this.state = {
|
||||
shipRows: [],
|
||||
shipPredicate: 'name',
|
||||
shipDesc: true,
|
||||
detailRows: []
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Update state with the specified sort predicates
|
||||
* @param {String} shipPredicate Sort predicate - property name
|
||||
* @param {number} shipPredicateIndex Sort predicate - property index
|
||||
*/
|
||||
_sortShips(shipPredicate, shipPredicateIndex) {
|
||||
let shipDesc = this.state.shipDesc;
|
||||
|
||||
if (typeof shipPredicateIndex == 'object') {
|
||||
shipPredicateIndex = undefined;
|
||||
}
|
||||
|
||||
if (
|
||||
this.state.shipPredicate == shipPredicate &&
|
||||
this.state.shipPredicateIndex == shipPredicateIndex
|
||||
) {
|
||||
shipDesc = !shipDesc;
|
||||
}
|
||||
|
||||
this.setState({ shipPredicate, shipDesc, shipPredicateIndex });
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
this._genShipRows();
|
||||
}
|
||||
@@ -61,6 +85,7 @@ class ShipTable extends Component {
|
||||
const shipRows = [];
|
||||
for (const shipName of FORGE_SHIPS) {
|
||||
const ship = Forge.Factory.newShip(shipName);
|
||||
let name = shipName
|
||||
console.log(ship);
|
||||
shipRows.push(<tr
|
||||
key={shipName}
|
||||
@@ -71,7 +96,7 @@ class ShipTable extends Component {
|
||||
})}
|
||||
>
|
||||
<td className="le">
|
||||
<Link to={'/outfit/' + shipName}>{shipName}</Link>
|
||||
<Link to={'/outfit/' + shipName}>{name}</Link>
|
||||
</td>
|
||||
</tr>);
|
||||
this.setState({shipRows})
|
||||
@@ -81,7 +106,8 @@ class ShipTable extends Component {
|
||||
_highlightShip() {}
|
||||
|
||||
render() {
|
||||
|
||||
let sortShips = (predicate, index) =>
|
||||
this._sortShips.bind(this, predicate, index);
|
||||
return (
|
||||
<div>
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user