Commit e601de33 authored by Marcelo Rivera's avatar Marcelo Rivera

(feat): only show categories underneath navbar if we're on a list view

1 merge request!486WIP: (feat): Minds Pro (development branch) - Release 2
Pipeline #75284654 failed with stages
in 14 minutes and 2 seconds
......@@ -31,7 +31,6 @@
<a
class="m-proChannelTopbar__navItem"
[routerLink]="['/pro', channel.username, 'feed']"
[queryParams]="{algorithm: 'pro'}"
routerLinkActive="active"
i18n
>Feed</a>
......@@ -113,7 +112,7 @@
<div class="minds-bg-overlay" (click)="closeMenu()" [hidden]="!isMenuOpen"></div>
</div>
<div class="m-proChannel__categories">
<div class="m-proChannel__categories" *ngIf="showCategories">
<div
class="m-proChannel__category"
[class.m-proChannel__selectedCategory]="!!tag.selected"
......
......@@ -48,6 +48,8 @@ export class ProChannelComponent implements OnInit, OnDestroy {
isMenuOpen: boolean = false;
showCategories: boolean = true;
constructor(
protected element: ElementRef,
protected session: Session,
......@@ -65,6 +67,11 @@ export class ProChannelComponent implements OnInit, OnDestroy {
this.onResize();
}
shouldShowCategories(type: string) {
const routes = ['images', 'videos', 'articles', 'feed', 'groups'];
this.showCategories = routes.indexOf(type) !== -1;
}
listen() {
this.routerSubscription = this.router.events.subscribe((navigationEvent) => {
try {
......@@ -74,6 +81,8 @@ export class ProChannelComponent implements OnInit, OnDestroy {
}
this.currentURL = navigationEvent.urlAfterRedirects;
const type = this.currentURL.split('/');
this.shouldShowCategories(type[type.length - 1]);
this.setTitle();
}
} catch (e) {
......@@ -86,6 +95,10 @@ export class ProChannelComponent implements OnInit, OnDestroy {
this.username = params['username'];
}
if (this.route.children.length > 0) {
this.shouldShowCategories(this.route.children[0].snapshot.params.type);
}
if (this.username && (!this.channel || this.channel.username != this.username)) {
this.load();
}
......
......@@ -2,12 +2,12 @@
<a class="m-pro-user-menu__Anchor" (click)="toggleMenu()"><i class="material-icons">menu</i></a>
<ul class="m-dropdown__list m-pro-user-menu__dropdown mdl-shadow--3dp" [hidden]="!isOpen">
<!-- <li
<li
class="m-dropdownList__item m-pro-user-menuDropdown__item"
(click)="closeMenu()"
>
<a [routerLink]="['/pro', channel.username, 'feed']" routerLinkActive="active" i18n>Feed</a>
</li>-->
</li>
<li
class="m-dropdownList__item m-pro-user-menuDropdown__item"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment