Made home page and startet the layout for settings home page

This commit is contained in:
Alex Pedersen
2026-07-30 15:21:59 +02:00
parent 2e537337f5
commit 03594bba3f
11 changed files with 241 additions and 251 deletions

View File

@@ -1,7 +1,58 @@
@page "/"
@rendermode InteractiveServer
@implements IDisposable
@using System.Globalization
@inject NavigationManager Nav
@page "/"
<PageTitle>Home</PageTitle>
<header class="top-nav">
<div class="brand">Indstilinger</div>
<h1>Hello, world!</h1>
<time datetime="@_currentTime.ToString("O")">
@_currentTime.ToString(
"dddd d. MMMM yyyy · HH:mm",
_danishCulture)
</time>
</header>
Welcome to your new Fluent Blazor app.
<div class="home-container">
<FluentButton Class="menu-button" Size="ButtonSize.Large">
Kassesalg
</FluentButton>
<FluentButton Class="menu-button" Size="ButtonSize.Large">
Dagens salg
</FluentButton>
<FluentButton Class="menu-button" Size="ButtonSize.Large">
Print Bon
</FluentButton>
<FluentButton Class="menu-button" Size="ButtonSize.Large" onclick="@(() => Nav.NavigateTo("/settings"))">
Indstillinger
</FluentButton>
</div>
@code {
private readonly CultureInfo _danishCulture =
CultureInfo.GetCultureInfo("da-DK");
private readonly Timer _timer;
private DateTime _currentTime = DateTime.Now;
public Home()
{
_timer = new Timer(
UpdateTime,
null,
TimeSpan.FromMinutes(1),
TimeSpan.FromMinutes(1));
}
private void UpdateTime(object? state)
{
_currentTime = DateTime.Now;
_ = InvokeAsync(StateHasChanged);
}
public void Dispose()
{
_timer.Dispose();
}
}