-
-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Title and description for tabs (#3442)
* Refactor tab_groups to have title and description * Fixes with rubocop * Fix with rubocop * Request changes * Request changes * Create new component and move there header part from PanelComponent, add spec * Small fixes * Update app/components/avo/panel_header_component.rb Co-authored-by: Kamil Milewski <kamil.milewski@hotmail.com> * rm unused * test --------- Co-authored-by: Paul Bob <69730720+Paul-Bob@users.noreply.github.com> Co-authored-by: Kamil Milewski <kamil.milewski@hotmail.com> Co-authored-by: Paul Bob <paul.ionut.bob@gmail.com>
- Loading branch information
1 parent
f7c53f7
commit 5dec5c0
Showing
9 changed files
with
109 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<div data-target="panel-header" class="flex flex-col w-full mb-4"> | ||
<div class="flex justify-center sm:justify-start flex-col sm:flex-row w-full flex-1 has-cover-photo:mt-0"> | ||
<%= render Avo::ProfilePhotoComponent.new profile_photo: @profile_photo %> | ||
<div class="flex flex-col flex-1 w-full"> | ||
<% if display_breadcrumbs? %> | ||
<div class="breadcrumbs text-center sm:text-left mb-2"> | ||
<%= helpers.render_avo_breadcrumbs(separator: helpers.svg("chevron-right", class: "inline-block h-3 stroke-current relative top-[-1px] ml-1")) if Avo.configuration.display_breadcrumbs %> | ||
</div> | ||
<% end %> | ||
<div class="flex-1 flex flex-col xl:flex-row justify-between gap-1 grow-0"> | ||
<div class="overflow-hidden flex flex-col"> | ||
<% if name_slot? %> | ||
<%= name_slot %> | ||
<% else %> | ||
<%= render Avo::PanelNameComponent.new name: @name %> | ||
<% end %> | ||
<% if @description.present? %> | ||
<div class="text-sm tracking-normal font-medium text-gray-600 text-center sm:text-left" data-target="description"> | ||
<%== @description %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% if tools.present? %> | ||
<div class="flex-1 w-full flex flex-col sm:flex-row xl:justify-end sm:items-end gap-2 mt-4 xl:mt-0" data-target="panel-tools"> | ||
<%= tools %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
class Avo::PanelHeaderComponent < Avo::BaseComponent | ||
include Avo::ApplicationHelper | ||
|
||
renders_one :name_slot | ||
renders_one :tools | ||
|
||
prop :name | ||
prop :description | ||
prop :display_breadcrumbs, default: false | ||
prop :profile_photo | ||
|
||
private | ||
|
||
def display_breadcrumbs? | ||
@display_breadcrumbs && Avo.configuration.display_breadcrumbs | ||
end | ||
|
||
def description | ||
return @description if @description.present? | ||
|
||
"" | ||
end | ||
|
||
def render? | ||
@name.present? || description.present? || tools.present? || display_breadcrumbs? | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters