diff --git a/src/app/features/store/components/menu-content-section/menu-content-section.component.html b/src/app/features/store/components/menu-content-section/menu-content-section.component.html new file mode 100644 index 0000000..0380f25 --- /dev/null +++ b/src/app/features/store/components/menu-content-section/menu-content-section.component.html @@ -0,0 +1,7 @@ + diff --git a/src/app/features/store/components/menu-content-section/menu-content-section.component.scss b/src/app/features/store/components/menu-content-section/menu-content-section.component.scss new file mode 100644 index 0000000..ca41801 --- /dev/null +++ b/src/app/features/store/components/menu-content-section/menu-content-section.component.scss @@ -0,0 +1,31 @@ +:host { + display: block; + width: 100%; + min-width: 0; +} + +.menu-content-section { + width: 100%; +} + +.menu-content-section__title { + margin: 0 0 1.25rem; + color: #888888; + font-size: 1rem; + font-weight: 600; + line-height: 1.3; +} + +.menu-content-section__body { + min-width: 0; +} + +@media (max-width: 767.98px) { + .menu-content-section { + margin-inline: auto; + } + + .menu-content-section__title { + text-align: center; + } +} diff --git a/src/app/features/store/components/menu-content-section/menu-content-section.component.spec.ts b/src/app/features/store/components/menu-content-section/menu-content-section.component.spec.ts new file mode 100644 index 0000000..16ad694 --- /dev/null +++ b/src/app/features/store/components/menu-content-section/menu-content-section.component.spec.ts @@ -0,0 +1,33 @@ +import { Component } from '@angular/core'; +import { TestBed } from '@angular/core/testing'; +import { describe, expect, it } from 'vitest'; + +import { MenuContentSectionComponent } from './menu-content-section.component'; + +@Component({ + imports: [MenuContentSectionComponent], + template: ` + +

Contenido proyectado

+
+ `, +}) +class TestHostComponent {} + +describe('MenuContentSectionComponent', () => { + it('renders an accessible title and projects its content', async () => { + await TestBed.configureTestingModule({ imports: [TestHostComponent] }).compileComponents(); + + const fixture = TestBed.createComponent(TestHostComponent); + fixture.detectChanges(); + + const element = fixture.nativeElement as HTMLElement; + const section = element.querySelector('section'); + + expect(section?.getAttribute('aria-labelledby')).toBe('contact-title'); + expect(element.querySelector('#contact-title')?.textContent?.trim()).toBe('Contacto'); + expect(element.querySelector('.menu-content-section__body')?.textContent).toContain( + 'Contenido proyectado', + ); + }); +}); diff --git a/src/app/features/store/components/menu-content-section/menu-content-section.component.ts b/src/app/features/store/components/menu-content-section/menu-content-section.component.ts new file mode 100644 index 0000000..30e40f1 --- /dev/null +++ b/src/app/features/store/components/menu-content-section/menu-content-section.component.ts @@ -0,0 +1,11 @@ +import { Component, input } from '@angular/core'; + +@Component({ + selector: 'app-menu-content-section', + templateUrl: './menu-content-section.component.html', + styleUrl: './menu-content-section.component.scss', +}) +export class MenuContentSectionComponent { + readonly title = input.required(); + readonly titleId = input.required(); +} diff --git a/src/app/features/store/components/menu-page-layout/menu-page-layout.component.scss b/src/app/features/store/components/menu-page-layout/menu-page-layout.component.scss index 551be91..3db8125 100644 --- a/src/app/features/store/components/menu-page-layout/menu-page-layout.component.scss +++ b/src/app/features/store/components/menu-page-layout/menu-page-layout.component.scss @@ -80,5 +80,9 @@ justify-content: center; gap: 0.75rem 1.25rem; } + + &__content { + width: 100%; + } } } diff --git a/src/app/features/store/pages/help-page/pages/contact-page/contact-page.html b/src/app/features/store/pages/help-page/pages/contact-page/contact-page.html index b3cc069..37ea6af 100644 --- a/src/app/features/store/pages/help-page/pages/contact-page/contact-page.html +++ b/src/app/features/store/pages/help-page/pages/contact-page/contact-page.html @@ -1,53 +1,53 @@ -
-
-

CONTACTO

+ +
+
+ @if (contact().whatsappUrl && contact().whatsappLabel) { + + + {{ contact().whatsappLabel }} + + } - @if (contact().whatsappUrl && contact().whatsappLabel) { - - - {{ contact().whatsappLabel }} - - } + @if (contact().phone; as phone) { + + + {{ phone }} + + } - @if (contact().phone; as phone) { - - - {{ phone }} - - } + @for (location of contact().locations; track location.id) { +
+

+ + {{ location.label }} +

- @for (location of contact().locations; track location.id) { -
-

- - {{ location.label }} -

+
    + @for (address of location.addresses; track address.id) { +
  • {{ address.address }}
  • + } +
+
+ } -
    - @for (address of location.addresses; track address.id) { -
  • {{ address.address }}
  • - } -
-
- } + @if (!contact().whatsappUrl && !contact().phone && contact().locations.length === 0) { +

No hay datos de contacto disponibles.

+ } +
- @if (!contact().whatsappUrl && !contact().phone && contact().locations.length === 0) { -

No hay datos de contacto disponibles.

+ @if (contact().mapLocations.length > 0) { + }
- - @if (contact().mapLocations.length > 0) { - - } -
+ diff --git a/src/app/features/store/pages/help-page/pages/contact-page/contact-page.scss b/src/app/features/store/pages/help-page/pages/contact-page/contact-page.scss index 6ae2780..884e830 100644 --- a/src/app/features/store/pages/help-page/pages/contact-page/contact-page.scss +++ b/src/app/features/store/pages/help-page/pages/contact-page/contact-page.scss @@ -20,14 +20,6 @@ align-items: flex-start; } -.contact-page__title { - margin: 0 0 1.25rem; - color: inherit; - font-size: 1rem; - font-weight: 400; - line-height: 1.3; -} - .contact-page__contact-link { display: inline-flex; align-items: center; @@ -128,10 +120,6 @@ text-align: center; } - .contact-page__title { - width: 100%; - } - .contact-page__location { width: 100%; } diff --git a/src/app/features/store/pages/help-page/pages/contact-page/contact-page.ts b/src/app/features/store/pages/help-page/pages/contact-page/contact-page.ts index 1f54738..79782b6 100644 --- a/src/app/features/store/pages/help-page/pages/contact-page/contact-page.ts +++ b/src/app/features/store/pages/help-page/pages/contact-page/contact-page.ts @@ -2,6 +2,7 @@ import { Component, computed, inject } from '@angular/core'; import { findMenu } from '../../../../../../core/services/menu.utils'; import { TenantService } from '../../../../../../core/services/tenant.service'; +import { MenuContentSectionComponent } from '../../../../components/menu-content-section/menu-content-section.component'; import { LocationMapComponent, MapLocation, @@ -30,7 +31,7 @@ type ContactContent = { @Component({ selector: 'app-contact-page', - imports: [LocationMapComponent], + imports: [LocationMapComponent, MenuContentSectionComponent], templateUrl: './contact-page.html', styleUrl: './contact-page.scss', }) diff --git a/src/app/features/store/pages/help-page/pages/faq-page/faq-page.html b/src/app/features/store/pages/help-page/pages/faq-page/faq-page.html index 2d62fb4..9318e01 100644 --- a/src/app/features/store/pages/help-page/pages/faq-page/faq-page.html +++ b/src/app/features/store/pages/help-page/pages/faq-page/faq-page.html @@ -1,14 +1,8 @@ -
-

PREGUNTAS FRECUENTES

- + @if (faqs().length > 0) { @for (faq of faqs(); track $index; let last = $last) { - +

{{ faq.answer }}

} @@ -16,4 +10,4 @@ } @else {

No hay preguntas frecuentes disponibles.

} -
+ diff --git a/src/app/features/store/pages/help-page/pages/faq-page/faq-page.scss b/src/app/features/store/pages/help-page/pages/faq-page/faq-page.scss index ce868e8..eb57672 100644 --- a/src/app/features/store/pages/help-page/pages/faq-page/faq-page.scss +++ b/src/app/features/store/pages/help-page/pages/faq-page/faq-page.scss @@ -4,18 +4,11 @@ } .faq-page { + display: block; width: 100%; max-width: 760px; } -.faq-page__title { - margin: 0 0 0.5rem; - color: #a0a0a0; - font-size: 0.9375rem; - font-weight: 700; - line-height: 1.3; -} - .faq-page p { margin: 0; } @@ -26,9 +19,3 @@ color: #888888; font-size: 0.8125rem; } - -@media (max-width: 767.98px) { - .faq-page__title { - text-align: center; - } -} diff --git a/src/app/features/store/pages/help-page/pages/faq-page/faq-page.ts b/src/app/features/store/pages/help-page/pages/faq-page/faq-page.ts index 7d84d5a..4a3273d 100644 --- a/src/app/features/store/pages/help-page/pages/faq-page/faq-page.ts +++ b/src/app/features/store/pages/help-page/pages/faq-page/faq-page.ts @@ -4,6 +4,7 @@ import { findMenu } from '../../../../../../core/services/menu.utils'; import { TenantService } from '../../../../../../core/services/tenant.service'; import { AccordionItemComponent } from '../../../../../../shared/components/accordion/accordion-item.component'; import { AccordionComponent } from '../../../../../../shared/components/accordion/accordion.component'; +import { MenuContentSectionComponent } from '../../../../components/menu-content-section/menu-content-section.component'; type Faq = { question: string; @@ -12,7 +13,7 @@ type Faq = { @Component({ selector: 'app-faq-page', - imports: [AccordionComponent, AccordionItemComponent], + imports: [AccordionComponent, AccordionItemComponent, MenuContentSectionComponent], templateUrl: './faq-page.html', styleUrl: './faq-page.scss', })