1
0

108588: Created separate section for communities & collections browse sections

This commit is contained in:
Alexandre Vryghem
2023-12-12 22:00:49 +01:00
parent a695784fc8
commit fb2c7cee9d
7 changed files with 112 additions and 5 deletions

View File

@@ -0,0 +1,31 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { BrowseByDataType } from '../../../../browse-by/browse-by-switcher/browse-by-data-type';
import { ActivatedRoute } from '@angular/router';
import { map } from 'rxjs/operators';
import { BrowseDefinition } from '../../../../core/shared/browse-definition.model';
@Component({
selector: 'ds-comcol-browse-by',
templateUrl: './comcol-browse-by.component.html',
styleUrls: ['./comcol-browse-by.component.scss'],
})
export class ComcolBrowseByComponent implements OnInit {
browseByType$: Observable<BrowseByDataType>;
constructor(
protected route: ActivatedRoute,
) {
}
/**
* Fetch the correct browse-by component by using the relevant config from the route data
*/
ngOnInit(): void {
this.browseByType$ = this.route.data.pipe(
map((data: { browseDefinition: BrowseDefinition }) => data.browseDefinition.getRenderType()),
);
}
}