Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat[#51013]: Extend page header with parent link, context bar actions and responsiveness #49

Merged
merged 9 commits into from
Nov 17, 2023
Prev Previous commit
Next Next commit
chore[#51013]: Add notes in previews and more descriptive labels
  • Loading branch information
dominic-braeunlein committed Nov 15, 2023
commit b71a3e9f3a9d8143a0ad2bb98686c5530da355ce
27 changes: 24 additions & 3 deletions previews/primer/open_project/page_header_preview.rb
Original file line number Diff line number Diff line change
@@ -55,7 +55,11 @@ def actions
render_with_template(locals: {})
end

# @label With back button
# @label With back button (on wide)
# **Back button** is only shown on **wider than narrow screens** by default.
# If you want to override that behaviour please use the system_argument: **display**
# e.g. **component.with\_breadcrumbs(display: [:block, :block])**
#
# @param href [String] text
# @param size [Symbol] select [small, medium, large]
# @param icon [String] select ["arrow-left", "chevron-left", "triangle-left"]
@@ -66,7 +70,11 @@ def back_button(href: "#", size: :medium, icon: "arrow-left")
end
end

# @label With breadcrumbs
# @label With breadcrumbs (on wide)
# **Breadcrumbs** are only shown on **wider than narrow screens** by default.
# If you want to override that behaviour please use the system_argument: **display**
# e.g. **component.with\_breadcrumbs(display: [:block, :block])**
#
def breadcrumbs
breadcrumb_items = [
{ href: "/foo", text: "Foo" },
@@ -79,13 +87,26 @@ def breadcrumbs
end
end

# @label With parent link
# @label With parent link (on narrow)
# **Parent link** is only shown on **narrow screens** by default.
# If you want to override that behaviour please use the system_argument: **display**
# e.g. **component.with\_parent\_link(display: [:block, :block])**
#
def parent_link
render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title { "A title" }
header.with_parent_link(href: "test") { "Parent link" }
end
end

# @label With context bar actions (on narrow)
# **Context bar actions** are only shown on **narrow screens** by default.
# If you want to override that behaviour please use the system_argument: **display**
# e.g. **component.with\_context\_bar\_actions(display: [:block, :block])**
#
def context_bar_actions
render_with_template(locals: {})
end
end
end
end