Skip to content

Commit

Permalink
Move selected slot style into constant
Browse files Browse the repository at this point in the history
  • Loading branch information
codemonkey85 committed Nov 16, 2023
1 parent 094fb0d commit cd3bb98
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Pkmds.Web/Components/BoxGrid.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ private void SetSelectedPokemon(PKM? pokemon, int boxNumber, int slotNumber) =>
AppService.SetSelectedBoxPokemon(pokemon, boxNumber, slotNumber);

private string GetStyle(int slotNumber) => AppState.SelectedBoxSlotNumber == slotNumber
? "border: 4px solid orange; border-radius: 6px;"
? Constants.SelectedSlotStyle
: string.Empty;

protected override void OnInitialized() =>
Expand Down
2 changes: 1 addition & 1 deletion Pkmds.Web/Components/PartyGrid.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ private void SetSelectedPokemon(PKM? pokemon, int slotNumber) =>
AppService.SetSelectedPartyPokemon(pokemon, slotNumber);

private string GetStyle(int slotNumber) => AppState.SelectedPartySlotNumber == slotNumber
? "border: 4px solid orange; border-radius: 6px;"
? Constants.SelectedSlotStyle
: string.Empty;

protected override void OnInitialized()
Expand Down
6 changes: 6 additions & 0 deletions Pkmds.Web/Constants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Pkmds.Web;

public static class Constants
{
public const string SelectedSlotStyle = "border: 4px solid orange; border-radius: 6px;";
}

0 comments on commit cd3bb98

Please sign in to comment.