Change donations to contrbutions, add tabbed nav

Introduces components for tabbed navigation and adds a tab menu and item
for non-financial contributions to the donations/contributions page.
This commit is contained in:
Râu Cao
2022-12-12 14:05:31 +01:00
parent 3f49e4a3b8
commit 3197743a55
12 changed files with 91 additions and 9 deletions

View File

@@ -0,0 +1,21 @@
# frozen_string_literal: true
class TabnavLinkComponent < ViewComponent::Base
def initialize(name:, path:, active: false, disabled: false)
@name = name
@path = path
@active = active
@disabled = disabled
@link_class = class_names_link(path)
end
def class_names_link(path)
if @active
"border-indigo-500 text-indigo-600 w-1/2 py-4 px-1 text-center border-b-2"
elsif @disabled
"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 w-1/2 py-4 px-1 text-center border-b-2"
else
"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 w-1/2 py-4 px-1 text-center border-b-2"
end
end
end