diff --git a/src/app/core/layout/store-layout/store-header/store-header.component.html b/src/app/core/layout/store-layout/store-header/store-header.component.html index 54bc5ab..5e02710 100644 --- a/src/app/core/layout/store-layout/store-header/store-header.component.html +++ b/src/app/core/layout/store-layout/store-header/store-header.component.html @@ -19,46 +19,50 @@ -
-
-
- -
-
- - - @if (showSearchError()) { - - } + @if (displaySeachBar()) { +
+
-
-
+
+
+ + + @if (showSearchError()) { + + } +
+
+ } + +
@if (ticketsMenu(); as menu) { @if (isMobileMenuOpen()) { -
- + Mi cuenta -
+ @if (displayCategories()) { +
- @for (category of categories(); track category.id) { - - {{ category.nombre }} - + @for (category of categories(); track category.id) { + + {{ category.nombre }} + + } }
} @@ -135,28 +144,30 @@
-
-
-
- + @if (displayCategories()) { +
+
+
+ - + +
-
+ } diff --git a/src/app/core/layout/store-layout/store-header/store-header.component.ts b/src/app/core/layout/store-layout/store-header/store-header.component.ts index b189253..12cd58e 100644 --- a/src/app/core/layout/store-layout/store-header/store-header.component.ts +++ b/src/app/core/layout/store-layout/store-header/store-header.component.ts @@ -35,6 +35,8 @@ export class StoreHeaderComponent { readonly accountNavigationMenus = input([]); readonly ticketsMenu = input(null); readonly categories = input([]); + readonly displayCategories = input(true); + readonly displaySeachBar = input(true); readonly cartClick = output(); readonly ticketsClick = output(); readonly loginClick = output(); diff --git a/src/app/core/layout/store-layout/store-layout.component.html b/src/app/core/layout/store-layout/store-layout.component.html index 763beb4..e119c2d 100644 --- a/src/app/core/layout/store-layout/store-layout.component.html +++ b/src/app/core/layout/store-layout/store-layout.component.html @@ -7,6 +7,8 @@ [accountNavigationMenus]="accountNavigationMenus()" [ticketsMenu]="ticketsMenu() ?? null" [categories]="tenant()?.categories ?? []" + [displayCategories]="tenant()?.display_categories ?? true" + [displaySeachBar]="tenant()?.display_seach_bar ?? true" (cartClick)="isCartOpen.set(!isCartOpen())" (ticketsClick)="onTicketsClick()" (loginClick)="onLoginClick()" @@ -16,10 +18,7 @@ /> @if (isCartOpen()) { -
+
- Seguir comprando { expect(compiled.querySelector('app-store-footer .store-layout__footer')).not.toBeNull(); }); + it('hides the configured header elements when the tenant disables them', () => { + tenantState.set({ + ...tenant, + categories: [{ id: 1, nombre: 'Remeras', subcategories: [] }], + display_categories: false, + display_seach_bar: false, + }); + + const fixture = TestBed.createComponent(StoreLayoutComponent); + fixture.detectChanges(); + + const compiled = fixture.nativeElement as HTMLElement; + + expect(compiled.querySelector('#store-search-input')).toBeNull(); + expect(compiled.querySelector('.store-layout__category-trigger')).toBeNull(); + + const header = fixture.debugElement.query(By.directive(StoreHeaderComponent)); + (header.componentInstance as any).toggleMobileMenu(); + fixture.detectChanges(); + + expect(compiled.querySelectorAll('.store-layout__mobile-dropdown-item')).toHaveLength(1); + }); + it('renders the tenant branding and action icons', () => { const fixture = TestBed.createComponent(StoreLayoutComponent); fixture.detectChanges(); diff --git a/src/app/core/services/tenant.interface.ts b/src/app/core/services/tenant.interface.ts index 5efbfda..52c93a6 100644 --- a/src/app/core/services/tenant.interface.ts +++ b/src/app/core/services/tenant.interface.ts @@ -114,6 +114,8 @@ export interface Tenant { search_product_layout?: 'row' | 'column_with_image' | 'column_with_cart'; search_group_layout?: 'paginated' | 'simple' | 'simple_vertical' | 'carousel'; search_items_per_page?: number; + display_categories?: boolean; + display_seach_bar?: boolean; social_media?: SocialMedia[]; menues?: Menu[]; categories: Category[]; diff --git a/src/app/shared/components/hero-banner/hero-banner.component.scss b/src/app/shared/components/hero-banner/hero-banner.component.scss index 90dc635..a664160 100644 --- a/src/app/shared/components/hero-banner/hero-banner.component.scss +++ b/src/app/shared/components/hero-banner/hero-banner.component.scss @@ -222,10 +222,7 @@ } .hero-action ::ng-deep .btn { - min-height: 1.875rem; - padding: 0.4rem 1.35rem; - border-radius: 0.25rem; - font-size: 0.625rem; + font-size: 11px; } .event-card-container {