import POGOProtos from 'pogo-protos'; import React from 'react'; import classNames from 'classnames'; import { IPokemon } from 'app/models/Pokemon'; import { formatDexNumber, formatForm, Forms } from 'app/utils/formatter'; import { StatDisplay } from './StatDisplay'; import { TypeIndicator } from './TypeIndicator'; import * as styles from 'app/styles/PokemonDisplay.scss'; export interface IPokemonDisplay { leaguePokemon : IPokemon; isHighlighted : boolean; } export class PokemonDisplay extends React.Component { public render() { const { leaguePokemon, isHighlighted } = this.props; const dex = formatDexNumber(leaguePokemon.dex); const pokemonInfoLeftColumnCss = classNames( styles.pokemonInfoLeftColumn, { [styles.highlight]: isHighlighted } ); const containerCss = classNames( 'nes-container', 'with-title', ); const containerTitleCss = classNames( 'title', ); const baseStatsCss = classNames( styles.pokemonBaseStats, containerCss, ); const pokemonIconCss = classNames( 'icon', 'pixel', 'sprite', `pokemon-${dex}`, { normal: Forms.normal.indexOf(leaguePokemon.form) > -1, alola: Forms.alola.indexOf(leaguePokemon.form) > -1, plant: Forms.plant.indexOf(leaguePokemon.form) > -1, sandy: Forms.sandy.indexOf(leaguePokemon.form) > -1, trash: Forms.trash.indexOf(leaguePokemon.form) > -1, 'west-sea': Forms.westSea.indexOf(leaguePokemon.form) > -1, 'east-sea': Forms.eastSea.indexOf(leaguePokemon.form) > -1, frost: Forms.frost.indexOf(leaguePokemon.form) > -1, fan: Forms.fan.indexOf(leaguePokemon.form) > -1, mow: Forms.mow.indexOf(leaguePokemon.form) > -1, wash: Forms.wash.indexOf(leaguePokemon.form) > -1, heat: Forms.heat.indexOf(leaguePokemon.form) > -1, sky: Forms.sky.indexOf(leaguePokemon.form) > -1, land: Forms.land.indexOf(leaguePokemon.form) > -1, overcast: Forms.overcast.indexOf(leaguePokemon.form) > -1, sunny: Forms.sunny.indexOf(leaguePokemon.form) > -1, rainy: Forms.rainy.indexOf(leaguePokemon.form) > -1, snowy: Forms.snowy.indexOf(leaguePokemon.form) > -1, attack: Forms.attack.indexOf(leaguePokemon.form) > -1, defense: Forms.defense.indexOf(leaguePokemon.form) > -1, speed: Forms.speed.indexOf(leaguePokemon.form) > -1, altered: Forms.altered.indexOf(leaguePokemon.form) > -1, origin: Forms.origin.indexOf(leaguePokemon.form) > -1, fighting: Forms.fighting.indexOf(leaguePokemon.form) > -1, flying: Forms.flying.indexOf(leaguePokemon.form) > -1, poison: Forms.poison.indexOf(leaguePokemon.form) > -1, ground: Forms.ground.indexOf(leaguePokemon.form) > -1, rock: Forms.rock.indexOf(leaguePokemon.form) > -1, bug: Forms.bug.indexOf(leaguePokemon.form) > -1, ghost: Forms.ghost.indexOf(leaguePokemon.form) > -1, steel: Forms.steel.indexOf(leaguePokemon.form) > -1, fire: Forms.fire.indexOf(leaguePokemon.form) > -1, water: Forms.water.indexOf(leaguePokemon.form) > -1, grass: Forms.grass.indexOf(leaguePokemon.form) > -1, electric: Forms.electric.indexOf(leaguePokemon.form) > -1, psychic: Forms.psychic.indexOf(leaguePokemon.form) > -1, ice: Forms.ice.indexOf(leaguePokemon.form) > -1, dragon: Forms.dragon.indexOf(leaguePokemon.form) > -1, dark: Forms.dark.indexOf(leaguePokemon.form) > -1, fairy: Forms.fairy.indexOf(leaguePokemon.form) > -1, }, ); const type1 = ; let type2 : JSX.Element | null = null; if (leaguePokemon.types.type2) { type2 = ; } return (

No.{ dex }

{ type1 } { type2 }
{ leaguePokemon.form !== POGOProtos.Enums.Form.FORM_UNSET &&
{ formatForm(leaguePokemon.form) } Form
}

{ leaguePokemon.name }

{ leaguePokemon.genus }

Base Stats

); } }