Commit 38bbcd33 authored by Marcelo Rivera's avatar Marcelo Rivera
Browse files

(feat): added tags list

parent 07925b33
Loading
Loading
Loading
Loading
+16 −1
Original line number Original line Diff line number Diff line
@@ -38,6 +38,12 @@ export interface KeyVal {
	value: any;
	value: any;
}
}


export interface Tag {
  tag: string,
  label: string,
  selected?: boolean
}

export interface MindsUser {
export interface MindsUser {
	guid : string;
	guid : string;
	name : string;
	name : string;
@@ -69,7 +75,16 @@ export interface MindsUser {
  tags?: Array<string>;
  tags?: Array<string>;
  toaster_notifications?: boolean;
  toaster_notifications?: boolean;
  pro?: boolean;
  pro?: boolean;
  pro_settings?: { styles?: { [key: string]: string }, [key: string]: string | { [key: string]: string } };
  pro_settings?: {
    tag_list?: Tag[],
    background_image: string,
    title: string,
    headline: string,
    footer_text: string,
    footer_links: { href: string, title: string }[],

    styles?: { [key: string]: string },
  };
}
}


export interface MindsGroup {
export interface MindsGroup {
+14 −2
Original line number Original line Diff line number Diff line
@@ -67,7 +67,19 @@
      >Donate</a>
      >Donate</a>
    </ng-container>
    </ng-container>


    <m-pro-user-menu [channelName]="channel.username" [showNavItems]="collapseNavItems" [query]="searchedText"></m-pro-user-menu>
    <m-pro-user-menu [channelName]="channel.username" [showNavItems]="collapseNavItems"
                     [query]="searchedText"></m-pro-user-menu>
  </div>

  <div class="m-proChannel__categories">
    <div
      class="m-proChannel__category"
      [class.m-proChannel__selectedCategory]="!!tag.selected"
      (click)="selectTag(tag)"
      *ngFor="let tag of channel.pro_settings.tag_list"
    >
      {{tag.label}}
    </div>
  </div>
  </div>


  <div class="m-proChannel__body">
  <div class="m-proChannel__body">
+20 −0
Original line number Original line Diff line number Diff line
@@ -105,6 +105,26 @@ m-pro--channel {
    font-size: 18px;
    font-size: 18px;
  }
  }


  .m-proChannel__categories {
    grid-row: 2 / span 1;
    grid-column: 2 / span 10;

    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-around;

    .m-proChannel__category {
      cursor: pointer;
      color: var(--text-color);
      padding: 0 8px;

      &.m-proChannel__selectedCategory {
        color: var(--primary-color);
      }
    }
  }

  .m-proChannel__body {
  .m-proChannel__body {
    grid-row: 3 / span 1;
    grid-row: 3 / span 1;
    grid-column: 1 / span 12;
    grid-column: 1 / span 12;
+15 −1
Original line number Original line Diff line number Diff line
@@ -11,7 +11,7 @@ import {
import { ActivatedRoute, Router, NavigationEnd, NavigationStart } from "@angular/router";
import { ActivatedRoute, Router, NavigationEnd, NavigationStart } from "@angular/router";
import { Session } from "../../../services/session";
import { Session } from "../../../services/session";
import { Subscription } from "rxjs";
import { Subscription } from "rxjs";
import { MindsUser } from "../../../interfaces/entities";
import { MindsUser, Tag } from "../../../interfaces/entities";
import { Client } from "../../../services/api/client";
import { Client } from "../../../services/api/client";
import { MindsTitle } from '../../../services/ux/title';
import { MindsTitle } from '../../../services/ux/title';
import { ProChannelService } from './channel.service';
import { ProChannelService } from './channel.service';
@@ -44,6 +44,10 @@ export class ProChannelComponent implements OnInit, OnDestroy {


  currentURL: string;
  currentURL: string;


  query: string;

  selectedTag: Tag = null;

  constructor(
  constructor(
    protected element: ElementRef,
    protected element: ElementRef,
    protected session: Session,
    protected session: Session,
@@ -206,4 +210,14 @@ export class ProChannelComponent implements OnInit, OnDestroy {
  get linkTo() {
  get linkTo() {
    return this.channelService.linkTo.bind(this.channelService);
    return this.channelService.linkTo.bind(this.channelService);
  }
  }

  selectTag(clickedTag: any) {
    this.selectedTag = clickedTag;

    for (let tag of this.channel.pro_settings.tag_list) {
      tag.selected = tag.tag == clickedTag.tag;
    }

    this.detectChanges();
  }
}
}