demarches-normaliennes/app/components/main_navigation/instructeur_expert_navigation_component.rb

27 lines
465 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class MainNavigation::InstructeurExpertNavigationComponent < ApplicationComponent
def instructeur?
helpers.instructeur_signed_in?
end
def expert?
helpers.expert_signed_in?
end
def aria_current_for(page)
{ current: page == current_page ? :page : nil }
end
private
def current_page
case controller_name
when 'avis'
:avis
when 'procedures', 'dossiers'
:procedure
end
end
end