Skip to content

Commit 0fef3ea

Browse files
committed
finishing touches
1 parent a9dc50b commit 0fef3ea

5 files changed

Lines changed: 46 additions & 36 deletions

File tree

src/web/Jordnaer/Components/NotificationBell.razor

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
@inject NotificationSignalRClient NotificationSignalRClient
66
@inject INotificationService NotificationService
77
@inject CurrentUser CurrentUser
8-
@inject NavigationManager Navigation
98
@inject ILogger<NotificationBell> Logger
109
@inject ISnackbar Snackbar
1110

@@ -50,7 +49,16 @@
5049
<div style="max-height: 400px; overflow-y: auto;">
5150
@foreach (var notification in _notifications)
5251
{
53-
<NotificationItem Notification="notification" OnClick="HandleNotificationClick" />
52+
@if (!string.IsNullOrEmpty(notification.LinkUrl))
53+
{
54+
<a href="@notification.LinkUrl" style="text-decoration: none; color: inherit; display: block;">
55+
<NotificationItem Notification="notification" OnClick="HandleNotificationClick" />
56+
</a>
57+
}
58+
else
59+
{
60+
<NotificationItem Notification="notification" OnClick="HandleNotificationClick" />
61+
}
5462
<MudDivider />
5563
}
5664
</div>
@@ -179,11 +187,6 @@
179187
}
180188

181189
_isOpen = false;
182-
183-
if (!string.IsNullOrEmpty(notification.LinkUrl))
184-
{
185-
Navigation.NavigateTo(notification.LinkUrl);
186-
}
187190
}
188191

189192
private async Task MarkAllAsRead()

src/web/Jordnaer/Components/NotificationItem.razor

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919

2020
<div style="flex: 1; min-width: 0;">
21-
<MudText Typo="Typo.body2" Style="@(!Notification.IsRead ? "font-weight: 600;" : "")">
21+
<MudText Typo="Typo.body2" Class="notification-title" Style="@(!Notification.IsRead ? "font-weight: 600;" : "")">
2222
@Notification.Title
2323
</MudText>
2424
@if (!string.IsNullOrEmpty(Notification.Description))
@@ -67,17 +67,35 @@
6767
}
6868

6969
<style>
70+
.notification-item {
71+
transition: background-color 0.15s ease;
72+
}
73+
7074
.notification-item:hover {
71-
background-color: rgba(0, 0, 0, 0.04);
75+
background-color: rgba(0, 0, 0, 0.08);
76+
cursor: pointer;
7277
}
7378
7479
.notification-item.unread {
7580
background-color: rgba(65, 85, 107, 0.05);
7681
}
7782
83+
.notification-item.unread:hover {
84+
background-color: rgba(65, 85, 107, 0.12);
85+
}
86+
87+
.notification-title {
88+
overflow: hidden;
89+
display: -webkit-box;
90+
-webkit-line-clamp: 2;
91+
-webkit-box-orient: vertical;
92+
word-break: break-word;
93+
}
94+
7895
.text-truncate {
7996
overflow: hidden;
8097
text-overflow: ellipsis;
8198
white-space: nowrap;
99+
display: block;
82100
}
83101
</style>

src/web/Jordnaer/Features/GroupSearch/GroupCard.razor

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
@using Jordnaer.Features.Theme
2-
@inject NavigationManager Navigation
32

4-
<MudPaper Elevation="3" Class="group-card pa-4" @onclick="NavigateToGroup"
5-
Style="cursor: pointer; transition: all 0.2s ease; background-color: white; display: flex; flex-direction: column; height: 100%;">
3+
<a href="/groups/@Uri.EscapeDataString(Group.Name)" style="text-decoration: none; color: inherit; display: block;">
4+
<MudPaper Elevation="3" Class="group-card pa-4"
5+
Style="transition: all 0.2s ease; background-color: white; display: flex; flex-direction: column; height: 100%;">
66
<div class="d-flex flex-column">
77
@* Group Image/Avatar and Basic Info *@
88
<div class="d-flex gap-3 mb-3">
@@ -85,6 +85,7 @@
8585
}
8686
</div>
8787
</MudPaper>
88+
</a>
8889

8990
<style>
9091
.group-card:hover {
@@ -96,9 +97,4 @@
9697
@code {
9798
[Parameter]
9899
public required GroupSlim Group { get; set; }
99-
100-
private void NavigateToGroup()
101-
{
102-
Navigation.NavigateTo($"/groups/{Uri.EscapeDataString(Group.Name)}");
103-
}
104100
}

src/web/Jordnaer/Features/Posts/PostCardComponent.razor

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@
7171
</MudCardHeader>
7272

7373
@* Content Section *@
74-
<MudCardContent Style="padding: 16px; min-height: 60px;">
75-
<MudText Typo="Typo.body1"
76-
Style="@($"color: {JordnaerPalette.BlueBody}; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word;")">
77-
@PostItem.Text.SanitizeHtml()
78-
</MudText>
79-
</MudCardContent>
74+
<a href="/posts/@PostItem.Id" style="text-decoration: none; color: inherit; display: block;">
75+
<MudCardContent Style="padding: 16px; min-height: 60px;">
76+
<MudText Typo="Typo.body1"
77+
Style="@($"color: {JordnaerPalette.BlueBody}; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word;")">
78+
@PostItem.Text.SanitizeHtml()
79+
</MudText>
80+
</MudCardContent>
81+
</a>
8082

8183
@* Categories Section *@
8284
@if (PostItem.Categories.Any())

src/web/Jordnaer/Features/UserSearch/UserCard.razor

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
@using Jordnaer.Features.Theme
2-
@inject NavigationManager Navigation
32

4-
<MudPaper Elevation="3" Class="user-card pa-4" @onclick="NavigateToProfile"
5-
Style="cursor: pointer; transition: all 0.2s ease; background-color: white; display: flex; flex-direction: column; height: 100%;">
3+
<a href="@(string.IsNullOrEmpty(User.UserName) ? null : $"/{Uri.EscapeDataString(User.UserName)}")" style="text-decoration: none; color: inherit; display: block;">
4+
<MudPaper Elevation="3" Class="user-card pa-4"
5+
Style="transition: all 0.2s ease; background-color: white; display: flex; flex-direction: column; height: 100%;">
66
<div class="d-flex flex-column">
77
@* Avatar and Basic Info *@
88
<div class="d-flex gap-3 mb-3">
@@ -89,6 +89,7 @@
8989
}
9090
</div>
9191
</MudPaper>
92+
</a>
9293

9394
<style>
9495
.user-card:hover {
@@ -100,14 +101,4 @@
100101
@code {
101102
[Parameter]
102103
public required UserDto User { get; set; }
103-
104-
private void NavigateToProfile()
105-
{
106-
if (string.IsNullOrEmpty(User.UserName))
107-
{
108-
return;
109-
}
110-
111-
Navigation.NavigateTo($"/{Uri.EscapeDataString(User.UserName)}");
112-
}
113104
}

0 commit comments

Comments
 (0)