mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
Preact: Fix PP display on buttons for moves with no max PP (#2420)
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
Some checks are pending
Node.js CI / build (22.x) (push) Waiting to run
This commit is contained in:
parent
c7a9d18585
commit
fcbd70e9a0
|
|
@ -153,15 +153,16 @@ class BattleDiv extends preact.Component<{ room: BattleRoom }> {
|
|||
}
|
||||
|
||||
function MoveButton(props: {
|
||||
cmd: string, type: Dex.TypeName, tooltip: string, moveData: { pp: number, maxpp: number, disabled?: boolean },
|
||||
cmd: string, type: Dex.TypeName, tooltip: string, moveData: { pp?: number, maxpp?: number, disabled?: boolean },
|
||||
children: string,
|
||||
}) {
|
||||
const pp = props.moveData.maxpp ? `${props.moveData.pp!}/${props.moveData.maxpp}` : '–';
|
||||
return <button
|
||||
data-cmd={props.cmd} data-tooltip={props.tooltip}
|
||||
class={`movebutton type-${props.type} has-tooltip${props.moveData.disabled ? ' disabled' : ''}`}
|
||||
>
|
||||
{props.children}<br />
|
||||
<small class="type">{props.type}</small> <small class="pp">{props.moveData.pp}/{props.moveData.maxpp}</small>
|
||||
<small class="type">{props.type}</small> <small class="pp">{pp}</small>
|
||||
</button>;
|
||||
}
|
||||
function PokemonButton(props: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user