Sha256: 0f0ab95f6210058ef15fffc7b69c33a0c78a1f66624d71f3f23d9d82996e238c
Contents?: true
Size: 831 Bytes
Versions: 56
Compression:
Stored size: 831 Bytes
Contents
module PlutoniumUi class NavUserComponent < PlutoniumUi::Base renders_many :sections, "PlutoniumUi::NavUserSectionComponent" option :email option :name, optional: true option :avatar_url, optional: true option :logout_url, optional: true private def base_attributes # base attributes go here { classname: "nav-user", controller: "nav-user resource-drop-down" } end def before_render return unless logout_url.present? content # get block to execute so our link gets added at the very end with_section do |section| section.with_link url: logout_url, label: "Sign out", data: {turbo: false}, classname: "rounded-b-lg" end end end end Plutonium::ComponentRegistry.register :nav_user, to: PlutoniumUi::NavUserComponent
Version data entries
56 entries across 56 versions & 1 rubygems