fix search modal closing on keypress and add admin header icon
Track search_open as server state so morphdom doesn't reset display to none on re-render. Move admin bar from layout banner to a gear icon in the header actions. Extract layout_assigns/1 helper so page templates use a spread instead of listing every attr explicitly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -81,20 +81,7 @@ defmodule SimpleshopThemeWeb.Shop.Collection do
|
||||
@impl true
|
||||
def render(assigns) do
|
||||
~H"""
|
||||
<.shop_layout
|
||||
theme_settings={@theme_settings}
|
||||
logo_image={@logo_image}
|
||||
header_image={@header_image}
|
||||
mode={@mode}
|
||||
cart_items={@cart_items}
|
||||
cart_count={@cart_count}
|
||||
cart_subtotal={@cart_subtotal}
|
||||
cart_drawer_open={@cart_drawer_open}
|
||||
cart_status={assigns[:cart_status]}
|
||||
active_page="collection"
|
||||
search_query={assigns[:search_query] || ""}
|
||||
search_results={assigns[:search_results] || []}
|
||||
>
|
||||
<.shop_layout {layout_assigns(assigns)} active_page="collection">
|
||||
<main id="main-content">
|
||||
<.collection_header
|
||||
title={@collection_title}
|
||||
|
||||
Reference in New Issue
Block a user