Skip to content

Commit

Permalink
Click title to go to current day in addition to scrolling to top
Browse files Browse the repository at this point in the history
Handy little way of resetting your view.
  • Loading branch information
danielchalmers committed Jan 14, 2024
1 parent d9ebb2e commit 49d03d2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion JournalApp/Components/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<div class="page-title">
<div class="page-header">
<MudButton OnClick="ScrollToTop" DisableRipple Variant="Variant.Text">
<MudButton OnClick="OnTitleClicked" DisableRipple Variant="Variant.Text">
<MudText Typo="Typo.h6">🙂 @ThisAssembly.AssemblyTitle BETA</MudText>
</MudButton>

Expand Down Expand Up @@ -185,6 +185,12 @@
}
}

async Task OnTitleClicked()
{
logger.LogDebug("Title clicked");
await GoToDay(DateOnly.FromDateTime(DateTime.Now), scrollToTop: true);
}

async Task ScrollToTop()
{
logger.LogInformation($"Scrolling to the top");
Expand Down

0 comments on commit 49d03d2

Please sign in to comment.