+
About
@@ -29,39 +37,8 @@
@code {
private bool sidebarCollapsed = true;
- protected override void OnInitialized()
- {
- ThemeState.ThemeModeChanged += HandleThemeModeChanged;
- }
-
- protected override async Task OnAfterRenderAsync(bool firstRender)
- {
- if (!firstRender)
- {
- return;
- }
-
- var themeMode = await ThemeState.EnsureLoadedAsync();
- await ApplyThemeAsync(themeMode);
- }
-
private void ToggleSidebar()
{
sidebarCollapsed = !sidebarCollapsed;
}
-
- private void HandleThemeModeChanged(AppThemeMode themeMode)
- {
- _ = InvokeAsync(() => ApplyThemeAsync(themeMode).AsTask());
- }
-
- private ValueTask ApplyThemeAsync(AppThemeMode themeMode)
- {
- return JS.InvokeVoidAsync("workTrackerTheme.setTheme", themeMode.ToString().ToLowerInvariant());
- }
-
- public void Dispose()
- {
- ThemeState.ThemeModeChanged -= HandleThemeModeChanged;
- }
}
diff --git a/Components/Layout/MainLayout.razor.css b/Components/Layout/MainLayout.razor.css
index cfbb458..8204d7a 100644
--- a/Components/Layout/MainLayout.razor.css
+++ b/Components/Layout/MainLayout.razor.css
@@ -14,8 +14,8 @@ main {
}
.top-row {
- background-color: var(--wt-header-bg);
- border-bottom: 1px solid var(--wt-header-border);
+ background-color: #f7f7f7;
+ border-bottom: 1px solid #d6d5d5;
justify-content: flex-end;
height: 3.5rem;
display: flex;
@@ -23,7 +23,6 @@ main {
}
.top-row ::deep a, .top-row ::deep .btn-link {
- color: var(--wt-header-link);
white-space: nowrap;
margin-left: 1.5rem;
text-decoration: none;
@@ -38,9 +37,30 @@ main {
text-overflow: ellipsis;
}
+.sidebar-toggle {
+ display: none;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ gap: 0.2rem;
+ width: 2.5rem;
+ height: 2.5rem;
+ margin-right: auto;
+ border: 1px solid #d6d5d5;
+ border-radius: 0.65rem;
+ background: #fff;
+}
+
+.sidebar-toggle-bar {
+ width: 1rem;
+ height: 2px;
+ background: #334155;
+ border-radius: 999px;
+}
+
@media (max-width: 640.98px) {
.top-row {
- justify-content: flex-end;
+ justify-content: space-between;
}
.top-row ::deep a, .top-row ::deep .btn-link {
@@ -80,6 +100,10 @@ main {
padding-right: 1.5rem !important;
}
+ .sidebar-toggle {
+ display: inline-flex;
+ }
+
.sidebar.sidebar-collapsed {
width: 5rem;
}
diff --git a/Components/Layout/NavMenu.razor b/Components/Layout/NavMenu.razor
index 514e372..4a34d50 100644
--- a/Components/Layout/NavMenu.razor
+++ b/Components/Layout/NavMenu.razor
@@ -4,29 +4,15 @@
@code {
[Parameter] public bool IsCollapsed { get; set; }
- [Parameter] public EventCallback OnToggleSidebar { get; set; }
-
- private Task ToggleSidebarAsync()
- {
- return OnToggleSidebar.InvokeAsync();
- }
}
-
-
-
+
diff --git a/Components/Layout/NavMenu.razor.css b/Components/Layout/NavMenu.razor.css
index 68a8b8e..b4e5429 100644
--- a/Components/Layout/NavMenu.razor.css
+++ b/Components/Layout/NavMenu.razor.css
@@ -1,19 +1,10 @@
.top-row {
min-height: 3.5rem;
background-color: rgba(0,0,0,0.4);
- padding-left: 0.75rem !important;
- padding-right: 0.75rem !important;
-}
-
-.nav-menu-header {
- display: flex;
- align-items: center;
- gap: 0.75rem;
}
.navbar-brand {
font-size: 1.1rem;
- margin-bottom: 0;
}
.sidebar-brand-compact {
@@ -24,32 +15,6 @@
height: 100%;
}
-.sidebar-toggle {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- gap: 0.2rem;
- width: 2.5rem;
- height: 2.5rem;
- border: 1px solid rgba(255, 255, 255, 0.18);
- border-radius: 0.65rem;
- background: rgba(255, 255, 255, 0.08);
- color: #fff;
- flex: 0 0 auto;
-}
-
-.sidebar-toggle:hover {
- background: rgba(255, 255, 255, 0.16);
-}
-
-.sidebar-toggle-bar {
- width: 1rem;
- height: 2px;
- background: currentColor;
- border-radius: 999px;
-}
-
.bi {
display: inline-block;
position: relative;
@@ -157,22 +122,19 @@
display: none;
}
- .nav-menu-shell-collapsed .nav-scrollable {
- display: none;
- }
-
- .nav-menu-shell:not(.nav-menu-shell-collapsed) .nav-scrollable {
- display: block;
- }
-
.nav-scrollable {
height: auto;
}
}
@media (min-width: 641px) {
+ .nav-menu-shell-collapsed .top-row {
+ padding-left: 0.5rem !important;
+ padding-right: 0.5rem !important;
+ }
+
.nav-menu-shell-collapsed .container-fluid {
- justify-content: flex-start;
+ justify-content: center;
}
.nav-menu-shell-collapsed .sidebar-brand-full,
diff --git a/Components/Pages/CalendarView.razor b/Components/Pages/CalendarView.razor
index 890463d..60f2df0 100644
--- a/Components/Pages/CalendarView.razor
+++ b/Components/Pages/CalendarView.razor
@@ -10,7 +10,6 @@
Calendar
-
Calendar
@@ -52,11 +51,11 @@ else
{
@if (cell is null)
{
-
+
}
else
{
- TogglePopup(cell.Date)" role="button">
+ TogglePopup(cell.Date)" role="button">
weeks = [];
@@ -224,22 +220,6 @@ else
await LoadMonth();
}
- protected override async Task OnAfterRenderAsync(bool firstRender)
- {
- if (!firstRender)
- {
- return;
- }
-
- var savedIncludePreview = await JS.InvokeAsync("workTrackerPreferences.getBool", IncludePreviewPreferenceKey);
- if (savedIncludePreview.HasValue && savedIncludePreview.Value != includePreviewTotals)
- {
- includePreviewTotals = savedIncludePreview.Value;
- await LoadMonth();
- await InvokeAsync(StateHasChanged);
- }
- }
-
private async Task LoadMonth()
{
loading = true;
@@ -287,7 +267,6 @@ else
private async Task OnIncludePreviewTotalsChanged(ChangeEventArgs e)
{
includePreviewTotals = e.Value is bool value && value;
- await JS.InvokeVoidAsync("workTrackerPreferences.setBool", IncludePreviewPreferenceKey, includePreviewTotals);
await LoadMonth();
}
@@ -327,8 +306,6 @@ else
private bool IsActiveCell(DateOnly date) => activeDate == date;
- private static bool IsToday(DateOnly date) => date == DateOnly.FromDateTime(DateTime.Today);
-
private void CreateWorkUnit(DateOnly date)
{
Navigation.NavigateTo($"/work-unit/{date:yyyy-MM-dd}");
diff --git a/Components/Pages/GridView.razor b/Components/Pages/GridView.razor
index c21e3f8..2887739 100644
--- a/Components/Pages/GridView.razor
+++ b/Components/Pages/GridView.razor
@@ -24,7 +24,7 @@
else
{
@cell.Date.Day
@foreach (var workUnit in cell.Entry?.WorkUnits ?? [])
@@ -194,13 +193,10 @@ else
}
}
-
@code {
[Parameter] public string? YearMonth { get; set; }
- private const string IncludePreviewPreferenceKey = "worktracker.includePreviewWorkUnits";
-
private DateOnly firstOfMonth;
private bool loading = true;
private List
-
+
| Date | @@ -150,31 +150,31 @@ else private string GetRowClass(CalendarDayRow row) { - if (row.IsWeekend || row.IsFestivity) return "grid-row-weekend"; - if (row.Entry is null) return string.Empty; + if (row.IsWeekend || row.IsFestivity) return "table-danger"; + if (row.Entry is null) return ""; if (row.Entry.CalendarEvents.Any(entry => entry.EventType == CalendarEventType.Holiday)) { - return "grid-row-holiday"; + return "table-success"; } if (row.Entry.CalendarEvents.Any(entry => entry.EventType == CalendarEventType.Closure)) { - return "grid-row-closure"; + return "table-warning"; } if (row.Entry.CalendarEvents.Any(entry => entry.EventType == CalendarEventType.Illness)) { - return "grid-row-illness"; + return "table-info"; } if (row.Entry.CalendarEvents.Any(entry => entry.EventType == CalendarEventType.DayOff)) { - return "grid-row-dayoff"; + return "table-secondary"; } if (row.Entry.WorkUnits.Any(entry => entry.Location == WorkUnitLocation.Home)) { - return "grid-row-home"; + return "table-light"; } return string.Empty; diff --git a/Components/Pages/MonthlySummary.razor b/Components/Pages/MonthlySummary.razor index 8f45fe5..ed4ba65 100644 --- a/Components/Pages/MonthlySummary.razor +++ b/Components/Pages/MonthlySummary.razor @@ -5,7 +5,6 @@ @using System.Globalization @inject global::WorkTracker.Services.WorkDays.IWorkDayService WorkDayService -@inject IJSRuntime JS
|---|