diff --git a/src/ts/app/components/PokemonExplorer/PokemonExplorer.tsx b/src/ts/app/components/PokemonExplorer/PokemonExplorer.tsx index 2439cb5..75d8c39 100644 --- a/src/ts/app/components/PokemonExplorer/PokemonExplorer.tsx +++ b/src/ts/app/components/PokemonExplorer/PokemonExplorer.tsx @@ -29,10 +29,12 @@ export interface IPokemonExplorerProps { handleChangeLeague : (league : League) => void; } +enum IvDisplayMode { + MANUAL = 'manual', + LIST = 'list', +} interface IState { - form : { - level : string; - }; + ivDisplayMode : IvDisplayMode; } export class PokemonExplorer extends React.Component { @@ -63,9 +65,7 @@ export class PokemonExplorer extends React.Component -
-
-
- -

No.{ dex }

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

{ leaguePokemon.name }

-
{ leaguePokemon.genus }
-
-

Base Stats

- - - -
+
+
+ +

No.{ dex }

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

{ leaguePokemon.name }

+
{ leaguePokemon.genus }
+
+

Base Stats

+ + + +
+
+
+ +
+
+ IVs + + +
+ { ivDisplayMode === IvDisplayMode.MANUAL && -
-
-
Rank
-
-
- { rankedPokemon === null || rankedPokemon.cp > MaxCpByLeague[activeLeague] && -

N/A

- } - { rankedPokemon !== null && rankedPokemon.cp <= MaxCpByLeague[activeLeague] && -

{ rankedGrade }

Rank
- } -
CP

{ rankedCp }

-
-
- - - -
+ } + { ivDisplayMode === IvDisplayMode.LIST && + + } +
+
+
Rank
+
+
+ { rankedPokemon === null || rankedPokemon.cp > MaxCpByLeague[activeLeague] && +

N/A

+ } + { rankedPokemon !== null && rankedPokemon.cp <= MaxCpByLeague[activeLeague] && +

{ rankedGrade }

Rank
+ } +
CP

{ rankedCp }

-
-
- +
+ + + +
+
+
); } @@ -327,4 +361,12 @@ export class PokemonExplorer extends React.Component { this.props.handleChangeLeague(league); } + + private readonly handleIvDisplayModeManual = () => { + this.setState({ ivDisplayMode: IvDisplayMode.MANUAL }); + } + + private readonly handleIvDisplayModeList = () => { + this.setState({ ivDisplayMode: IvDisplayMode.LIST }); + } } diff --git a/src/ts/app/components/PokemonExplorer/styles/LeagueStatsList.scss b/src/ts/app/components/PokemonExplorer/styles/LeagueStatsList.scss index 98be7b6..ce6e875 100644 --- a/src/ts/app/components/PokemonExplorer/styles/LeagueStatsList.scss +++ b/src/ts/app/components/PokemonExplorer/styles/LeagueStatsList.scss @@ -1,7 +1,12 @@ @import 'styles/Variables.scss'; .selectList { - flex: 1; + height: 100%; + flex-grow: 1; + + /* for Firefox */ + // min-height: 0; + display: flex; overflow: hidden; diff --git a/src/ts/app/components/PokemonExplorer/styles/PokemonExplorer.scss b/src/ts/app/components/PokemonExplorer/styles/PokemonExplorer.scss index 8811797..782b035 100644 --- a/src/ts/app/components/PokemonExplorer/styles/PokemonExplorer.scss +++ b/src/ts/app/components/PokemonExplorer/styles/PokemonExplorer.scss @@ -3,7 +3,7 @@ .wrapper { height: 100vh; margin: 0 auto; - flex-basis: 15rem; + flex-basis: 30rem; display: flex; flex-flow: column nowrap; } @@ -106,3 +106,44 @@ align-items: start; align-self: stretch; } + +.ivsContainer { + flex: 0 2 auto; + display: flex; + flex-flow: column nowrap; + + /* for Firefox */ + // min-height: 0; + + :global(.title).ivContainerTitle { + display: flex; + justify-content: flex-end; + background-color: transparent; + + & > * { + background-color: $main-background-color; + + &:first-child { + margin-right: auto; + padding: 0 0.5em; + } + + &:last-child { + padding-right: 0.5em; + } + } + } + + &.diplayingIvList { + // .nes-container.title has `padding: 2rem;` + $border-offset: 6px; + padding: 2rem $border-offset $border-offset; + + :global(.title).ivContainerTitle { + margin-bottom: 0; + margin-right: -$border-offset; + margin-left: -$border-offset; + padding: 0 2.5rem; + } + } +} diff --git a/src/ts/app/components/PokemonExplorer/styles/PokemonExplorer.scss.d.ts b/src/ts/app/components/PokemonExplorer/styles/PokemonExplorer.scss.d.ts index 1c13e5c..bd63d44 100644 --- a/src/ts/app/components/PokemonExplorer/styles/PokemonExplorer.scss.d.ts +++ b/src/ts/app/components/PokemonExplorer/styles/PokemonExplorer.scss.d.ts @@ -1,7 +1,10 @@ // This file is automatically generated. // Please do not change this file! export const dexHeader: string; +export const diplayingIvList: string; export const formHeader: string; +export const ivContainerTitle: string; +export const ivsContainer: string; export const leaguePokemonRank: string; export const pokemonBaseStats: string; export const pokemonInfoLeftColumn: string;