diff --git a/appview/models/notifications.go b/appview/models/notifications.go index bb467fc2..441f3df5 100644 --- a/appview/models/notifications.go +++ b/appview/models/notifications.go @@ -1,6 +1,8 @@ package models -import "time" +import ( + "time" +) type NotificationType string @@ -32,6 +34,32 @@ type Notification struct { PullId *int64 } +// lucide icon that represents this notification +func (n *Notification) Icon() string { + switch n.Type { + case NotificationTypeRepoStarred: + return "star" + case NotificationTypeIssueCreated: + return "circle-dot" + case NotificationTypeIssueCommented: + return "message-square" + case NotificationTypeIssueClosed: + return "ban" + case NotificationTypePullCreated: + return "git-pull-request-create" + case NotificationTypePullCommented: + return "message-square" + case NotificationTypePullMerged: + return "git-merge" + case NotificationTypePullClosed: + return "git-pull-request-closed" + case NotificationTypeFollowed: + return "user-plus" + default: + return "" + } +} + type NotificationWithEntity struct { *Notification Repo *Repo diff --git a/appview/pages/templates/notifications/fragments/item.html b/appview/pages/templates/notifications/fragments/item.html index 7d663703..708e2b3d 100644 --- a/appview/pages/templates/notifications/fragments/item.html +++ b/appview/pages/templates/notifications/fragments/item.html @@ -1,19 +1,69 @@ {{define "notifications/fragments/item"}} -
Notifications
{{ i "settings" "w-4 h-4" }} @@ -11,36 +11,22 @@When you receive notifications, they'll appear here.
When you receive notifications, they'll appear here.