Class: KozenetUi::HeaderComponent::UserMenuComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/kozenet_ui/header_component/user_menu_component.rb

Overview

UserMenu section for the HeaderComponent Renders a user menu dropdown or avatar in the header

Examples:

<%= render KozenetUi::HeaderComponent::UserMenuComponent.new(user_name: "Test User", avatar_url: nil) do %>
  <%= link_to "Profile", profile_path %>
  <%= link_to "Logout", logout_path, method: :delete %>
<% end %>

Constant Summary

Constants inherited from BaseComponent

BaseComponent::UNSET

Instance Attribute Summary

Attributes inherited from BaseComponent

#html_options, #size, #variant

Instance Method Summary collapse

Constructor Details

#initialize(user_name: nil, avatar_url: nil, **html_options) ⇒ UserMenuComponent

Returns a new instance of UserMenuComponent.



14
15
16
17
18
# File 'app/components/kozenet_ui/header_component/user_menu_component.rb', line 14

def initialize(user_name: nil, avatar_url: nil, **html_options)
  super(**html_options)
  @user_name = user_name
  @avatar_url = avatar_url
end