Skip to content

Commit

Permalink
♻️ Replace Homepage Presenter with decorator (#2059)
Browse files Browse the repository at this point in the history
  • Loading branch information
laritakr authored Dec 15, 2023
1 parent 4d291bb commit 2d00694
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 74 deletions.
74 changes: 0 additions & 74 deletions app/presenters/hyrax/homepage_presenter.rb

This file was deleted.

29 changes: 29 additions & 0 deletions app/presenters/hyrax/homepage_presenter_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# # frozen_string_literal: true

# OVERRIDE Hyrax 5.0 to hide features via flipper
# hide featured researcher
# hide featured works
# hide recently uploaded
# hide share button
module Hyrax
module HomepagePresenterDecorator
def display_share_button?
Flipflop.show_share_button? && current_ability.can_create_any_work? ||
Flipflop.show_share_button? && user_unregistered?
end

def display_featured_researcher?
Flipflop.show_featured_researcher?
end

def display_featured_works?
Flipflop.show_featured_works?
end

def display_recently_uploaded?
Flipflop.show_recently_uploaded?
end
end
end

Hyrax::HomepagePresenter.prepend(Hyrax::HomepagePresenterDecorator)

0 comments on commit 2d00694

Please sign in to comment.