Skip to content

Commit

Permalink
Export individual Pokémon as showdown, tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
codemonkey85 committed Mar 17, 2024
1 parent 6e99d29 commit d895974
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Pkmds.Web/Components/EditForms/PokemonEditForm.razor
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ EntityContext.MaxInvalid &&
Save
</MudButton>

<MudButton OnClick="@ExportAsShowdown"
ButtonType="@ButtonType.Button"
Variant="@Variant.Filled"
Class="my-2"
Color="@Color.Default">
Export as Showdown
</MudButton>

</MudStack>

<div class="mb-2">
Expand Down
12 changes: 12 additions & 0 deletions Pkmds.Web/Components/EditForms/PokemonEditForm.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,16 @@ protected override void OnInitialized() =>

public void Dispose() =>
RefreshService.OnAppStateChanged -= StateHasChanged;

private void ExportAsShowdown() =>
DialogService.Show<ShowdownExportDialog>(
"Showdown Export",
new DialogParameters
{
{ nameof(ShowdownExportDialog.Pokemon), Pokemon }
},
new DialogOptions
{
CloseOnEscapeKey = true,
});
}
4 changes: 2 additions & 2 deletions Pkmds.Web/Components/PartyGrid.razor
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
ButtonType="@ButtonType.Button"
Variant="@Variant.Filled"
Class="my-3"
Color="@Color.Primary">
Export as Showdown
Color="@Color.Default">
Export Party As Showdown
</MudButton>
</div>
}

0 comments on commit d895974

Please sign in to comment.