Skip to content

Commit

Permalink
add support for level in pokemon row
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnymac committed Jan 16, 2017
1 parent e64a65d commit d114df2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 19 deletions.
3 changes: 3 additions & 0 deletions app/actions/trainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,13 @@ function parseInventory(inventory) {

const move2 = getMove(type, moveSettings, p.move_2, false)

const level = utils.getLevelFromCpMultiplier(totalCpMultiplier)

// TODO Use CamelCase instead of under_score for all keys except responses
const pokemonWithStats = {
iv,
type,
level,
evolvesTo,
additional_cp_multiplier: p.additional_cp_multiplier,
cp_multiplier: p.cp_multiplier,
Expand Down
19 changes: 1 addition & 18 deletions app/screens/Table/components/PokemonRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ import React, {
} from 'react'
import { ipcRenderer } from 'electron'
import $ from 'jquery'
import utils from '../../../utils'

// import { bindActionCreators } from 'redux'
// import { connect } from 'react-redux'
// import {
// toggleFavoritePokemon,
// powerUpPokemon
// } from '../../../actions'

import renderModal from '../../Detail'
import Tooltip from '../../Tooltip'
Expand All @@ -26,18 +18,10 @@ class PokemonRow extends React.PureComponent {
static displayName = 'PokemonRow'

static propTypes = {
// speciesIndex: PropTypes.number,
// sortBy: PropTypes.string,
// sortDir: PropTypes.string,
// sortPokemonBy: PropTypes.func.isRequired,
// onCheckedChange: PropTypes.func.isRequired,
species: PropTypes.object.isRequired,
pokemon: PropTypes.object.isRequired,
getPokemonState: PropTypes.func.isRequired,
onCheckedChange: PropTypes.func.isRequired,
// checkAll: PropTypes.bool.isRequired,
// onCheckAll: PropTypes.func.isRequired,
// getPokemonState: PropTypes.func.isRequired,
toggleFavoritePokemon: PropTypes.func.isRequired,
powerUpPokemon: PropTypes.func.isRequired,
}
Expand All @@ -63,7 +47,6 @@ class PokemonRow extends React.PureComponent {
)
const pokemonState = getPokemonState(pokemon.pokemon_id)
const isChecked = pokemonState[String(pokemon.id)].check
const level = utils.getLevelFromCpMultiplier(pokemon.cp_multiplier + pokemon.additional_cp_multiplier)

return (
<tr key={pokemon.id}>
Expand Down Expand Up @@ -121,7 +104,7 @@ class PokemonRow extends React.PureComponent {
</Tooltip>
</td>
<td>
{level}
{pokemon.level}
</td>
<td>
<Tooltip
Expand Down
3 changes: 2 additions & 1 deletion app/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ const COLUMN_SORT_AS_NUM = {
name: false,
count: true,
candy: true,
evolves: true
evolves: true,
level: true,
}

const Organize = {
Expand Down

0 comments on commit d114df2

Please sign in to comment.