Skip to content

Commit

Permalink
Restore homepage searchbar click event
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Jul 21, 2024
1 parent fab71e8 commit 06a5095
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 2 additions & 6 deletions projects/srm/src/app/homepage/homepage.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ <h1 class='tagline'>
</div>
<div class='searchbox-container layout-mobile'>
<app-search-bar [config]='searchConfig' (focus)='startSearch("", false)' [homepage]='true'
interactionEvent='homepage-searchbar' interactionEventWhere='homepage'
></app-search-bar>
</div>
</div>
Expand All @@ -53,15 +52,12 @@ <h1 class='tagline'>
(touchstart)='hovered = group.title' (touchend)='hovered = null'
>
@if (!!group.query) {
<a [routerLink]='["/s", group.query]'
class='homepage-group-title'
interactionEvent='homepage-link-group' interactionEventWhere='homepage' [interactionEventContent]='group.title'
clickOnReturn>
<div class='homepage-group-title'>
<h3>
<span>{{group.title}}</span>
<span class='arrow-left'></span>
</h3>
</a>
</div>
} @else {
<div class='homepage-group-title'>
<h3>
Expand Down
6 changes: 4 additions & 2 deletions projects/srm/src/app/homepage/homepage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { fromEvent, timer } from 'rxjs';
import { LayoutService } from '../layout.service';
import { SearchService } from '../search.service';
import { AnalyticsService } from '../analytics.service';

@UntilDestroy()
@Component({
Expand All @@ -34,7 +35,7 @@ export class HomepageComponent implements AfterViewInit{
searchVisibleObserver: IntersectionObserver;
searchVisible = true;

constructor(private api: ApiService, private platform: PlatformService, private router: Router, private layout: LayoutService, private searchSvc: SearchService) {
constructor(private api: ApiService, private platform: PlatformService, private router: Router, private layout: LayoutService, private searchSvc: SearchService, private analytics: AnalyticsService) {
this.searchConfig = new SearchConfig(this, this.router, this.api, this.platform, () => {});
this.searchConfig.autoFocus = false;
api.getHomepage().subscribe((homepage) => {
Expand Down Expand Up @@ -107,7 +108,8 @@ export class HomepageComponent implements AfterViewInit{
this.searchConfig.queries.next(query);
this.searchConfig.focus();
} else {
this.searchSvc.search(query);
this.analytics.interactionEvent('homepage-searchbar', 'homepage');
this.searchSvc.search(query);
}
}

Expand Down

0 comments on commit 06a5095

Please sign in to comment.