Extract method to get the notifications link text
This commit is contained in:
@@ -4,4 +4,14 @@ class Layout::NotificationItemComponent < ApplicationComponent
|
||||
def initialize(user)
|
||||
@user = user
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def text
|
||||
if user.notifications.unread.count > 0
|
||||
t("layouts.header.notification_item.new_notifications", count: user.notifications_count)
|
||||
else
|
||||
t("layouts.header.notification_item.no_notifications")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user