Skip to content

Commit a679217

Browse files
authored
feat: don't display top screen banner (#321)
keeping styles this banner affect, but remove data-access logic which should be rewritten, if this kind of banner would return
1 parent dd0f049 commit a679217

File tree

6 files changed

+11
-96
lines changed

6 files changed

+11
-96
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
export * from './lib/state/ad-banner.store';

libs/blog/ad-banner/data-access/src/lib/infrastructure/ad-banner.service.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

libs/blog/ad-banner/data-access/src/lib/state/ad-banner.store.ts

Lines changed: 0 additions & 54 deletions
This file was deleted.

libs/blog/articles/feature-article/src/lib/article-details/article-details.component.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import { DatePipe, NgClass } from '@angular/common';
22
import {
33
ChangeDetectionStrategy,
44
Component,
5-
inject,
65
input,
6+
signal,
77
} from '@angular/core';
88
import { FastSvgComponent } from '@push-based/ngx-fast-svg';
99

10-
import { AdBannerStore } from '@angular-love/blog/ad-banner/data-access';
1110
import { GiscusCommentsComponent } from '@angular-love/blog/articles/feature-comments';
1211
import { RelatedArticlesComponent } from '@angular-love/blog/articles/feature-related-articles';
1312
import { ArticleCompactCardSkeletonComponent } from '@angular-love/blog/articles/ui-article-card';
@@ -61,6 +60,5 @@ import { ArticleShareIconsComponent } from '../article-share-icons/article-share
6160
})
6261
export class ArticleDetailsComponent {
6362
readonly articleDetails = input.required<Article>();
64-
protected readonly adBannerStoreVisible =
65-
inject(AdBannerStore).adBannerVisible;
63+
protected readonly adBannerStoreVisible = signal(false);
6664
}

libs/blog/search/feature-search/src/lib/feature-search/search-dialog/search-dialog.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
inject,
1111
OnDestroy,
1212
OnInit,
13+
signal,
1314
viewChild,
1415
} from '@angular/core';
1516
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@@ -24,7 +25,6 @@ import { TranslocoDirective, TranslocoService } from '@jsverse/transloco';
2425
import { FastSvgComponent } from '@push-based/ngx-fast-svg';
2526
import { debounceTime, filter, startWith, tap } from 'rxjs';
2627

27-
import { AdBannerStore } from '@angular-love/blog/ad-banner/data-access';
2828
import {
2929
AlLocalizePipe,
3030
AlLocalizeService,
@@ -60,8 +60,7 @@ export class SearchDialogComponent implements OnInit, OnDestroy {
6060
validators: [Validators.maxLength(50)],
6161
});
6262

63-
protected readonly adBannerStoreVisible =
64-
inject(AdBannerStore).adBannerVisible;
63+
protected readonly adBannerStoreVisible = signal(false);
6564

6665
private readonly _searchService = inject(GlobalSearchService);
6766
private readonly _searchInput =

libs/blog/shell/feature-shell-web/src/lib/root-shell.component.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { NgClass, ViewportScroller } from '@angular/common';
2-
import { Component, computed, effect, inject, signal } from '@angular/core';
2+
import { Component, computed, effect, inject } from '@angular/core';
33
import { toSignal } from '@angular/core/rxjs-interop';
44
import { Router, RouterOutlet } from '@angular/router';
55
import { TranslocoService } from '@jsverse/transloco';
66
import { startWith } from 'rxjs';
77

8-
import { AdBannerStore } from '@angular-love/blog/ad-banner/data-access';
98
import { AlLocalizeService } from '@angular-love/blog/i18n/util';
109
import {
1110
FooterComponent,
@@ -19,13 +18,14 @@ import { AdBannerComponent } from '@angular-love/blog/shared/ad-banner';
1918
selector: 'al-root-shell',
2019
template: `
2120
<div class="fixed top-0 z-10 w-full">
22-
@if (adBannerVisible()) {
21+
<!--top screen closable banner-->
22+
<!--@if (adBannerVisible()) {
2323
<al-ad-banner
2424
class="block"
2525
[data]="adBanner()"
2626
(closed)="adBannerStore.onClose()"
2727
/>
28-
}
28+
}-->
2929
<al-header
3030
class="block w-full"
3131
[language]="language()"
@@ -53,17 +53,8 @@ import { AdBannerComponent } from '@angular-love/blog/shared/ad-banner';
5353
export class RootShellComponent {
5454
readonly translocoService = inject(TranslocoService);
5555

56-
protected readonly adBannerStore = inject(AdBannerStore);
57-
58-
protected readonly adBannerVisible = computed(() => {
59-
//TODO: after data-binding is done we can set this boolean if wp sends banner data
60-
const data = this.adBannerStore.adBanner;
61-
return this.adBannerStore.adBannerVisible() && data();
62-
});
63-
64-
protected readonly adBanner = computed(() => {
65-
return this.adBannerStore.adBanner();
66-
});
56+
// todo: temporary solution to keep in mind how banner influence the layout
57+
protected readonly adBannerVisible = computed(() => false);
6758

6859
readonly language = toSignal(
6960
this.translocoService.langChanges$.pipe(
@@ -84,6 +75,7 @@ export class RootShellComponent {
8475
}
8576

8677
constructor(viewport: ViewportScroller) {
78+
// todo: temporary solution to keep in mind how banner influence the layout
8779
effect(() => {
8880
this.adBannerVisible()
8981
? viewport.setOffset([0, 160])

0 commit comments

Comments
 (0)