Move login links to components
We're trying to be consistent; in the past, we had the partials "shared/admin_login_items", "layouts/notification_item" and "devise/menu/login_items". Now we're moving all these partials to components in the `Layout` namespace.
This commit is contained in:
12
app/components/layout/admin_login_items_component.rb
Normal file
12
app/components/layout/admin_login_items_component.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
class Layout::AdminLoginItemsComponent < ApplicationComponent
|
||||
attr_reader :user
|
||||
delegate :show_admin_menu?, to: :helpers
|
||||
|
||||
def initialize(user)
|
||||
@user = user
|
||||
end
|
||||
|
||||
def render?
|
||||
show_admin_menu?(user)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user