From 58a17849a4a4bdf0dab8242386c8be65d8a5ab7f Mon Sep 17 00:00:00 2001 From: Jeff Colombo Date: Wed, 6 Feb 2019 22:39:20 -0500 Subject: [PATCH] league functionality, stats list layout --- .../PokemonExplorer/LeagueStatsList.tsx | 19 +++++++++-- .../PokemonExplorer/PokemonExplorer.tsx | 34 +++++++++---------- .../styles/LeagueStatsList.scss | 16 +++++++++ .../styles/LeagueStatsList.scss.d.ts | 1 + 4 files changed, 51 insertions(+), 19 deletions(-) diff --git a/src/ts/app/components/PokemonExplorer/LeagueStatsList.tsx b/src/ts/app/components/PokemonExplorer/LeagueStatsList.tsx index 6f835bf..aa89523 100644 --- a/src/ts/app/components/PokemonExplorer/LeagueStatsList.tsx +++ b/src/ts/app/components/PokemonExplorer/LeagueStatsList.tsx @@ -123,11 +123,20 @@ export class LeagueStatsList extends React.Component= 0; i--) { + output += String.fromCharCode(160); + } + return output; + } + private rowFactory({ index, style } : IRowFactory) { const activeIvs = this.props.activeIndividualValues; const stats = this.props.leagueStatsList[index]; const css = classNames( - 'list-item', + 'list-item', // global style + styles.listItem, { active: activeIvs.level === stats.level && activeIvs.hp === stats.ivHp && @@ -140,6 +149,7 @@ export class LeagueStatsList extends React.Component - { `${ Grade[stats.speciesGrade] } ${ stats.cp } ${ stats.level } ${ stats.ivHp } ${ stats.ivAtk } ${ stats.ivDef }` } + { Grade[stats.speciesGrade] } + { this.padString(stats.cp.toString(), 4) } + { this.padString(stats.level.toString(), 4) } + { this.padString(stats.ivHp.toString(), 2) } + { this.padString(stats.ivAtk.toString(), 2) } + { this.padString(stats.ivDef.toString(), 2) } ); } diff --git a/src/ts/app/components/PokemonExplorer/PokemonExplorer.tsx b/src/ts/app/components/PokemonExplorer/PokemonExplorer.tsx index a21facb..4234e4c 100644 --- a/src/ts/app/components/PokemonExplorer/PokemonExplorer.tsx +++ b/src/ts/app/components/PokemonExplorer/PokemonExplorer.tsx @@ -62,7 +62,6 @@ export class PokemonExplorer extends React.Component { + leaguePokemon.pvp[activeLeague].some((stats) => { if (individualValueLevel === stats.level && individualValues.hp === stats.ivHp && individualValues.atk === stats.ivAtk && @@ -134,63 +133,63 @@ export class PokemonExplorer extends React.Component MAX LEAGUE Lv @@ -343,7 +343,7 @@ export class PokemonExplorer extends React.Component diff --git a/src/ts/app/components/PokemonExplorer/styles/LeagueStatsList.scss b/src/ts/app/components/PokemonExplorer/styles/LeagueStatsList.scss index 5ec7e17..98be7b6 100644 --- a/src/ts/app/components/PokemonExplorer/styles/LeagueStatsList.scss +++ b/src/ts/app/components/PokemonExplorer/styles/LeagueStatsList.scss @@ -10,3 +10,19 @@ overflow: auto; } } + +.listItem { + position: relative; + display: flex; + justify-content: space-evenly; + + &:global(.list-item) { + &:global(.active), + &:hover { + &::before { + top: 8px; + left: 10px; + } + } + } +} diff --git a/src/ts/app/components/PokemonExplorer/styles/LeagueStatsList.scss.d.ts b/src/ts/app/components/PokemonExplorer/styles/LeagueStatsList.scss.d.ts index 9ad81ab..fd8b963 100644 --- a/src/ts/app/components/PokemonExplorer/styles/LeagueStatsList.scss.d.ts +++ b/src/ts/app/components/PokemonExplorer/styles/LeagueStatsList.scss.d.ts @@ -1,3 +1,4 @@ // This file is automatically generated. // Please do not change this file! +export const listItem: string; export const selectList: string;