Skip to content

Commit d832e1f

Browse files
authored
feat: move indepth banner above indepth section (#318)
1 parent 4716e50 commit d832e1f

File tree

6 files changed

+29
-20
lines changed

6 files changed

+29
-20
lines changed

libs/blog/ad-banner/ui/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from './lib/ad-banner/ad-banner.component';
22
export * from './lib/ad-image-banner/ad-image-banner.component';
33
export * from './lib/ad-image-banner/ad-image-banner-data.interface';
4+
export * from './lib/instances/al-indepth-banner.component';
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
2+
3+
import { AdImageBannerComponent } from '../ad-image-banner/ad-image-banner.component';
4+
5+
@Component({
6+
selector: 'al-indepth-banner',
7+
standalone: true,
8+
imports: [AdImageBannerComponent],
9+
changeDetection: ChangeDetectionStrategy.OnPush,
10+
template: `
11+
<al-ad-image-banner [banner]="banner()!" />
12+
`,
13+
})
14+
export class AlIndepthBannerComponent {
15+
protected readonly banner = signal({
16+
url: 'assets/AL-AID-banner.png',
17+
alt: 'Banner - Two blogs join forces',
18+
slug: 'angular-love-joins-forces-with-angular-in-depth-to-bring-you-the-best-angular-on-the-web',
19+
});
20+
}

libs/blog/articles/feature-list/src/lib/articles-list-container.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
@if (activeLang === 'en') {
1111
<div class="mb-10 mt-10">
12+
<al-indepth-banner />
1213
<al-category-section-container category="angular-in-depth" />
1314
</div>
1415
}

libs/blog/articles/feature-list/src/lib/articles-list-container.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
import { TranslocoService } from '@jsverse/transloco';
88

99
import { ArticleListStore } from '@angular-love/blog/articles/data-access';
10+
import { AlIndepthBannerComponent } from '@angular-love/blog/shared/ad-banner';
1011
import { ArticlePreview } from '@angular-love/contracts/articles';
1112
import { RepeatDirective } from '@angular-love/utils';
1213

@@ -15,7 +16,11 @@ import { CategorySectionContainerComponent } from './category-section-container/
1516
@Component({
1617
selector: 'al-articles-list',
1718
templateUrl: './articles-list-container.component.html',
18-
imports: [RepeatDirective, CategorySectionContainerComponent],
19+
imports: [
20+
RepeatDirective,
21+
CategorySectionContainerComponent,
22+
AlIndepthBannerComponent,
23+
],
1924
changeDetection: ChangeDetectionStrategy.OnPush,
2025
standalone: true,
2126
})

libs/blog/home/feature-home/src/lib/home-page/home-page.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<al-ad-image-banner [banner]="banner()!"></al-ad-image-banner>
21
<al-latest-articles />
32
<al-articles-list />
43
<al-partners [partnerList]="[hoaHireUs]" title="homePage.mainPartner" />

libs/blog/home/feature-home/src/lib/home-page/home-page.component.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
2-
import { toSignal } from '@angular/core/rxjs-interop';
1+
import { ChangeDetectionStrategy, Component } from '@angular/core';
32
import { ReactiveFormsModule } from '@angular/forms';
4-
import { TranslocoService } from '@jsverse/transloco';
5-
import { map } from 'rxjs';
63

74
import { ArticlesListContainerComponent } from '@angular-love/blog/articles/feature-list';
85
import { UiArticleCardComponent } from '@angular-love/blog/articles/ui-article-card';
@@ -35,18 +32,4 @@ import { hoaHireUs, partnersList } from './partners';
3532
export class HomePageComponent {
3633
protected readonly hoaHireUs = hoaHireUs;
3734
protected readonly partnersList = partnersList;
38-
private readonly _translocoService = inject(TranslocoService);
39-
40-
readonly banner = toSignal(
41-
this._translocoService.langChanges$.pipe(
42-
map((activeLang) => ({
43-
url: 'assets/AL-AID-banner.png',
44-
alt: 'Banner - Two blogs join forces',
45-
slug:
46-
activeLang === 'en'
47-
? 'angular-love-joins-forces-with-angular-in-depth-to-bring-you-the-best-angular-on-the-web'
48-
: 'laczymy-sily-z-angular-in-depth-by-dostarczyc-wam-najlepsze-tresci-o-angularze',
49-
})),
50-
),
51-
);
5235
}

0 commit comments

Comments
 (0)