Skip to content

Commit

Permalink
+ bi-arrow-clockwise
Browse files Browse the repository at this point in the history
  • Loading branch information
NicklausBrain committed Dec 5, 2024
1 parent bd468c0 commit 50ffa5e
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions My1kWordsEe/Components/Pages/WordPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
}

WordMetadata = EeWord.ValidateWord()
? await ResolveSample()
: Result.Failure<SampleWord>("Invalid word");
? await ResolveSample()
: Result.Failure<SampleWord>("Invalid word");

await base.OnParametersSetAsync();
}
Expand Down Expand Up @@ -101,9 +101,9 @@
};

var confirmation = await DeleteSampleDialog.ShowAsync(
title: "Are you sure you want to delete this?",
message1: "This will delete the record. Once deleted can not be rolled back.",
message2: "Do you want to proceed?", options);
title: "Are you sure you want to delete this?",
message1: "This will delete the record. Once deleted can not be rolled back.",
message2: "Do you want to proceed?", options);

if (confirmation)
{
Expand Down Expand Up @@ -153,9 +153,11 @@

private bool IsLoggedIn => User?.Identity?.IsAuthenticated ?? false;

private bool IsFavorite() => IsDataLoadedOk && IsLoggedIn && Favorites.HasValue && Favorites.Value.IsSuccess && Favorites.Value.Value.Words.ContainsKey(EeWord.ToLower());
private bool IsFavorite() => IsDataLoadedOk && IsLoggedIn && Favorites.HasValue && Favorites.Value.IsSuccess &&
Favorites.Value.Value.Words.ContainsKey(EeWord.ToLower());

private bool IsFavorite(SampleSentence sentence) => IsDataLoadedOk && IsLoggedIn && Favorites.HasValue && Favorites.Value.IsSuccess && Favorites.Value.Value.Sentences.ContainsKey(sentence.EeSentence.ToLower());
private bool IsFavorite(SampleSentence sentence) => IsDataLoadedOk && IsLoggedIn && Favorites.HasValue &&
Favorites.Value.IsSuccess && Favorites.Value.Value.Sentences.ContainsKey(sentence.EeSentence.ToLower());
}

<script>
Expand Down Expand Up @@ -185,6 +187,11 @@
<audio id="@EeWord" src="@Value.EeAudioUrl"></audio>
</i>
}

@if (IsLoggedIn)
{
<i role="button" class="bi bi-arrow-clockwise float-end"></i>
}
</h1>

@if (IsDataLoadedOk)
Expand Down Expand Up @@ -216,11 +223,8 @@
@foreach (var sample in Value.Samples)
{
<div class="col col-12 col-sm-6 p-1">
<SampleV2 Sample="@sample"
AddToFavorites="AddToFavorites"
RemoveFromFavorites="RemoveFromFavorites"
DeleteSample="DeleteSample"
IsFavorite="IsFavorite(sample)" >
<SampleV2 Sample="@sample" AddToFavorites="AddToFavorites" RemoveFromFavorites="RemoveFromFavorites"
DeleteSample="DeleteSample" IsFavorite="IsFavorite(sample)">
</SampleV2>
</div>
}
Expand Down

0 comments on commit 50ffa5e

Please sign in to comment.