diff --git a/My1kWordsEe/Components/Layout/GameComposite.razor b/My1kWordsEe/Components/Layout/GameComposite.razor index ed4e851..181b6ad 100644 --- a/My1kWordsEe/Components/Layout/GameComposite.razor +++ b/My1kWordsEe/Components/Layout/GameComposite.razor @@ -16,6 +16,7 @@ { public string Title { get; set; } } + class GameCompositeModel { public Slide[] Slides { get; set; } = new Slide[] { }; @@ -24,9 +25,10 @@ public Slide CurrentSlide { get; set; } } + GameCompositeModel Game = new(); - private void OnNext() { }// Game.NextSlide(); + private void OnNext() { } // Game.NextSlide(); private void OnPrevious() { } //Game.PrevSlide(); @@ -34,9 +36,8 @@ private Task OnSubmit() { - return Task.CompletedTask; - } //=> { }; Game.CurrentSlide.Submit(CheckEnTranslationCommand); + } } @@ -49,13 +50,6 @@ }) - -

GameComposite

diff --git a/My1kWordsEe/Components/Layout/SampleV2.razor b/My1kWordsEe/Components/Layout/SampleV2.razor index df1e087..435a192 100644 --- a/My1kWordsEe/Components/Layout/SampleV2.razor +++ b/My1kWordsEe/Components/Layout/SampleV2.razor @@ -22,10 +22,10 @@ public required SampleSentence Sample { get; init; } [Parameter] - public required Func AddToFavorites { get; init; } + public Func? AddToFavorites { get; init; } [Parameter] - public required Func RemoveFromFavorites { get; init; } + public Func? RemoveFromFavorites { get; init; } [Parameter] public bool IsFavorite { get; init; } @@ -94,13 +94,6 @@ }; - - @@ -120,13 +113,13 @@ @if (IsLoggedIn) {
  • - @if (IsFavorite) + @if (IsFavorite && RemoveFromFavorites != null) { } - else + else if (AddToFavorites != null) {