File

src/app/modules/core/components/main-footer/main-footer.component.ts

Implements

OnInit AfterViewInit OnDestroy

Metadata

Index

Properties
Methods
Inputs
HostListeners

Constructor

constructor(resourceService: ResourceService, router: Router, activatedRoute: ActivatedRoute, configService: ConfigService, renderer: Renderer2, cdr: ChangeDetectorRef, userService: UserService, tenantService: TenantService, layoutService: LayoutService, navigationHelperService: NavigationHelperService, utilService: UtilService)
Parameters :
Name Type Optional
resourceService ResourceService No
router Router No
activatedRoute ActivatedRoute No
configService ConfigService No
renderer Renderer2 No
cdr ChangeDetectorRef No
userService UserService No
tenantService TenantService No
layoutService LayoutService No
navigationHelperService NavigationHelperService No
utilService UtilService No

Inputs

layoutConfiguration
Type : any

HostListeners

window:resize
Arguments : '$event'
window:resize(event)

Methods

checkFullScreenView
checkFullScreenView()
Returns : void
checkRouterPath
checkRouterPath()
Returns : void
footerAlign
footerAlign()
Returns : void
getBaseUrl
getBaseUrl()
Returns : void
initlayout
initlayout()
Returns : void
ngAfterViewInit
ngAfterViewInit()
Returns : void
ngOnDestroy
ngOnDestroy()
Returns : void
ngOnInit
ngOnInit()
Returns : void
onResize
onResize(event)
Decorators :
@HostListener('window:resize', ['$event'])
Parameters :
Name Optional
event No
Returns : void
redirect
redirect(url)
Parameters :
Name Optional
url No
Returns : void
redirectToMobileApp
redirectToMobileApp()
Returns : void
redoLayout
redoLayout()
Returns : void
setTelemetryInteractEdata
setTelemetryInteractEdata(type)
Parameters :
Name Optional
type No

Properties

Public activatedRoute
Type : ActivatedRoute
appBaseUrl
Type : string
bodyPaddingBottom
Type : string
Public configService
Type : ConfigService
date
Default value : new Date()
defaultFooterConfig
Type : any
FIRST_PANEL_LAYOUT
Type : string
footerFix
Type : ElementRef
Decorators :
@ViewChild('footerFix')
instance
Type : string
isDesktopApp
Default value : false
isFullScreenView
Public layoutService
Type : LayoutService
Public navigationHelperService
Type : NavigationHelperService
Public resourceService
Type : ResourceService

reference of resourceService service.

Public router
Type : Router
SECOND_PANEL_LAYOUT
Type : string
showDownloadmanager
Type : any
showFooter
Default value : true
tenantFooter
Type : any
Public tenantService
Type : TenantService
Public unsubscribe$
Default value : new Subject<void>()
Public userService
Type : UserService
import {
  Component,
  OnInit,
  ViewChild,
  ElementRef,
  Renderer2,
  ChangeDetectorRef,
  HostListener,
  AfterViewInit,
  Input,
  OnDestroy
} from '@angular/core';
import { ResourceService, ConfigService, LayoutService, COLUMN_TYPE, NavigationHelperService, UtilService } from '@sunbird/shared';
import { Router, ActivatedRoute } from '@angular/router';
import { IInteractEventEdata } from '@sunbird/telemetry';
import { combineLatest as observableCombineLatest, Subject } from 'rxjs';
import * as _ from 'lodash-es';
import {UserService, TenantService} from './../../services';
import { takeUntil } from 'rxjs/operators';
@Component({
  selector: 'app-footer',
  templateUrl: './main-footer.component.html',
  styleUrls: ['./main-footer.component.scss']
})
export class MainFooterComponent implements OnInit, AfterViewInit, OnDestroy {
  @Input() layoutConfiguration;
  @ViewChild('footerFix') footerFix: ElementRef;
  /**
   * reference of resourceService service.
   */
  public resourceService: ResourceService;
  /*
  Date to show copyright year
  */
  date = new Date();
  /*
  Hide or show footer
  */
  showFooter = true;
  showDownloadmanager: any;
  instance: string;
  bodyPaddingBottom: string;
  tenantFooter: any;
  defaultFooterConfig: any;
  public unsubscribe$ = new Subject<void>();

  FIRST_PANEL_LAYOUT: string;
  SECOND_PANEL_LAYOUT: string;
  isFullScreenView;
  isDesktopApp = false;
  appBaseUrl: string;

  constructor(resourceService: ResourceService, public router: Router, public activatedRoute: ActivatedRoute,
    public configService: ConfigService, private renderer: Renderer2, private cdr: ChangeDetectorRef, public userService: UserService,
      public tenantService: TenantService, public layoutService: LayoutService,
      public navigationHelperService: NavigationHelperService, private utilService: UtilService
    ) {
    this.resourceService = resourceService;
  }

  ngOnInit() {
    this.initlayout();
    this.checkFullScreenView();
    this.isDesktopApp = this.utilService.isDesktopApp;

    if (this.isDesktopApp) {
      this.getBaseUrl();
    }

    this.instance = _.upperCase(this.resourceService.instance);
    this.tenantService.tenantSettings$.subscribe((data) => {
      this.tenantFooter = data;
    });
    this.defaultFooterConfig = {
      helpCenterLink: '/help/getting-started/explore-' + _.lowerCase(this.instance) + '/index.html',
      helpDeskEmail: 'support@' + _.lowerCase(this.instance) + '-ncte.freshdesk.com'
    };
  }

  getBaseUrl() {
    this.appBaseUrl = this.utilService.getAppBaseUrl();
  }

  checkFullScreenView() {
    this.navigationHelperService.contentFullScreenEvent.pipe(takeUntil(this.unsubscribe$)).subscribe(isFullScreen => {
      this.isFullScreenView = isFullScreen;
    });
  }

  initlayout() {
    this.redoLayout();
  }

 ngAfterViewInit() {
    // this.footerAlign();
  }
  @HostListener('window:resize', ['$event'])
  onResize(event) {
    // this.footerAlign();
  }

  setTelemetryInteractEdata(type): IInteractEventEdata {
    return {
      id: type,
      type: 'click',
      pageid: _.get(this.activatedRoute, 'root.firstChild.snapshot.data.telemetry.pageid')
    };
  }

  // footer dynamic height
  footerAlign() {
    const footerHeight = $('footer').outerHeight();
    const bodyHeight = $('body').outerHeight();

    if (window.innerWidth <= 767) {
      (document.querySelector('.download-mobile-app-logo') as HTMLElement).style.minHeight = 0 + 'px';
      (document.querySelector('.download-mobile-app') as HTMLElement).style.bottom = footerHeight + 'px';
    } else {
      (document.querySelector('.footer-fix') as HTMLElement).style.minHeight = bodyHeight - footerHeight + 'px';
      (document.querySelector('.download-mobile-app-logo') as HTMLElement).style.minHeight = footerHeight + 'px';
      (document.querySelector('.download-mobile-app') as HTMLElement).style.bottom = 0 + 'px';
    }
  }

  redoLayout() {
    if (this.layoutConfiguration != null) {
      this.FIRST_PANEL_LAYOUT = this.layoutService.redoLayoutCSS(0, this.layoutConfiguration, COLUMN_TYPE.threeToNine);
      this.SECOND_PANEL_LAYOUT = this.layoutService.redoLayoutCSS(1, this.layoutConfiguration, COLUMN_TYPE.threeToNine);
    } else {
      this.FIRST_PANEL_LAYOUT = this.layoutService.redoLayoutCSS(0, null, COLUMN_TYPE.fullLayout);
      this.SECOND_PANEL_LAYOUT = this.layoutService.redoLayoutCSS(1, null, COLUMN_TYPE.fullLayout);
    }
  }

  checkRouterPath() {
    this.showDownloadmanager = this.router.url.includes('/profile') || this.router.url.includes('/play/collection') ||
      this.router.url.includes('/play/content');
  }


  redirectToMobileApp() {
    const playstoreLink = _.get(this.tenantFooter, 'playstoreLink');
    if (playstoreLink) {
      // For iGot the URL is direclty taken; no UTM needed
      this.redirect(playstoreLink);
    } else {
      let applink = this.configService.appConfig.UrlLinks.downloadDikshaApp;
      const sendUtmParams = _.get(this.activatedRoute, 'firstChild.firstChild.snapshot.data.sendUtmParams');
      const utm_source = this.userService.slug ? `${this.instance}-${this.userService.slug}` : this.instance;
      if (sendUtmParams) {
        observableCombineLatest(this.activatedRoute.firstChild.firstChild.params, this.activatedRoute.queryParams,
          (params, queryParams) => {
            return { ...params, ...queryParams };
          }).subscribe((params) => {
            if (params.dialCode) {
              const source = params.source || 'search';
              applink = `${applink}&referrer=utm_source=${utm_source}&utm_medium=${source}&utm_campaign=dial&utm_term=${params.dialCode}`;
            } else {
              applink = `${applink}&referrer=utm_source=${utm_source}&utm_medium=get&utm_campaign=redirection`;
            }
            this.redirect(applink.replace(/\s+/g, ''));
          });
      } else {
        const path = this.router.url.split('/')[1];
        applink = `${applink}&referrer=utm_source=${utm_source}&utm_medium=${path}`;
        this.redirect(applink);
      }
    }
  }

  redirect(url) {
    if (this.isDesktopApp) {
      window.open(url, '_blank');
    } else {
      window.location.href = url;
    }
  }

  ngOnDestroy() {
    this.unsubscribe$.next();
    this.unsubscribe$.complete();
  }
}
<div *ngIf="showFooter">
  <footer class="footer old-footer" #footerFix *ngIf="!layoutConfiguration" [ngClass]="{'player-fullscreen-footer': isFullScreenView}">
    <div  class="ui container">
      <div class="ui grid stackable">
        <div class="four wide column footerMenu mr-auto">
        </div>
  
        <div class="download-mobile-app">
          <div class="download-mobile-app-logo p-16">
            <div class="mobile-circles">
              <div class="big-box border-round border-r50"></div>
              <div class="oval-box border-round ml-24"></div>
              <div class="small-box border-round border-r50 ml-16 mr-8"></div>
              <div class="small-box border-round border-r50"></div>
            </div>
            <label
              class="d-block text-center font-weight-bold">{{resourceService?.frmelmnts?.lbl?.downloadDikshaForMobile | interpolate:'{instance}': instance}}</label>
            <a class="d-block app-download" (click)="redirectToMobileApp()" tabindex="0">
              <img class="playStore-img cursor-pointer" src="/assets/images/google_playstore.png"
                alt="{{ resourceService?.frmelmnts?.lbl?.altGoogleplay }}">
            </a>
            <p class="d-block pt-10">{{resourceService.frmelmnts?.lbl?.getUnlimitedAccess}}</p>
          </div>
        </div>
        <div class="four wide column contantDetails">
          <label class="d-flex flex-w-wrap mb-16 flex-jc-center">
            <ul class="d-flex flex-ai-center fsmall sb-color-white mb-0 mobile only pl-0">
              <li class="mb-0"><a href="/screenreaderaccess.html" class="cursor-pointer sb-color-white">Screen Reader Access</a></li><li class="mx-4 mb-0">|</li>
              <li class="mb-0"><a href="/sitemap.html" class="cursor-pointer sb-color-white">Sitemap</a></li><li class="mx-4 mb-0">|</li>
            </ul>
            <a appTelemetryInteract [telemetryInteractEdata]="setTelemetryInteractEdata('t&c')" href="/term-of-use.html">
              {{resourceService.frmelmnts?.lnk?.footerTnC}}
            </a>
            <span>| &copy; {{date | date:'yyyy'}}, {{instance}}</span>
          </label>
          <label class="sb-footer-license">
           <span><img alt="{{resourceService.frmelmnts?.lbl?.CCbyLicense}}" src="/assets/images/CCby.svg">&nbsp;&nbsp;{{resourceService.frmelmnts?.lbl?.CCbyLicense}}</span>
          </label>
        </div>
      </div>
    </div>
  </footer>
  
  <footer class="new-layout-footer" #footerFix *ngIf="layoutConfiguration" [ngClass]="{'player-fullscreen-footer': isFullScreenView}">
    <div class="sb-g sbt-fluid-content-bg sbt-footer-container relative">
      <div [ngClass]="FIRST_PANEL_LAYOUT"></div>
      <div [ngClass]="SECOND_PANEL_LAYOUT"></div>
      <div class="sbt-container">
        <img src="/assets/images/footer-line.svg" class="sbt-skyline-path" alt="line path">
        <div class="sbt-footer-shade">
          <img src="/assets/images/footer-flower.svg" alt="flower image shade is showing on footer">
        </div>
        <div class="ui grid stackable px-72">
          <div class="six wide column contantDetails px-0">
            <div>
            <label class="d-flex footer-terms-info text-left font-weight-normal flex-w-wrap">
              <ul class="d-flex flex-ai-center fsmall mb-0 mobile only pl-0">
                <li class="mb-0" tabindex="0"><a href="/screenreaderaccess.html" class="cursor-pointer">Screen Reader Access</a></li><li class="mx-4 mb-0">|</li>
                <li class="mb-0" tabindex="0"><a href="/sitemap.html" class="cursor-pointer">Sitemap</a></li><li class="mx-4 mb-0">|</li>
              </ul>
              <a *ngIf="!isDesktopApp" [attr.aria-label]="resourceService.frmelmnts?.lnk?.footerTnC" tabindex="0" appTelemetryInteract [telemetryInteractEdata]="setTelemetryInteractEdata('t&c')"
                href="/term-of-use.html">{{resourceService.frmelmnts?.lnk?.footerTnC}}</a>
              <a *ngIf="isDesktopApp" tabindex="0" appTelemetryInteract [telemetryInteractEdata]="setTelemetryInteractEdata('t&c')"
                href="{{appBaseUrl}}/term-of-use.html" target="_blank">{{resourceService.frmelmnts?.lnk?.footerTnC}}</a>
              <span [attr.aria-label]="instance" tabindex="0">| &copy; {{date | date:'yyyy'}}, {{instance}}</span>
            </label>
            <label class="d-block text-left fsmall" tabindex="0">
              <span>{{resourceService.frmelmnts?.lbl?.CCbyLicense}}&nbsp;&nbsp;<img alt="{{resourceService.frmelmnts?.lbl?.CCbyLicense}}" src="/assets/images/CCby.svg"></span>
            </label>
          </div>
          </div>
          <div class="six wide column p-0 d-flex sbt-footer-download-app">
            <div class="sbt-footer-bg relative">
              <img [attr.aria-label]="resourceService.frmelmnts?.lnk?.footerAppDownload | interpolate:'{instance}':  instance" class="sbt-footer-bg-img cursor-pointer" tabindex="0" src="/assets/images/footer-flower-set.svg" alt="">
              <label class="d-block text-center font-weight-bold sbt-footer-title">{{resourceService.frmelmnts?.lnk?.footerDIKSHAForMobile | interpolate:'{instance}':  instance}}</label>
              <a class="d-block app-download" (click)="redirectToMobileApp()">
                <img tabindex="0" class="playStore-img cursor-pointer" src="/assets/images/google_playstore.png"
                  alt="{{ resourceService?.frmelmnts?.lbl?.altGoogleplay }}">
              </a>
            </div>
          </div>
        </div>
      </div>
    </div>
  </footer>
  </div>

  <extension-point *appDesktopOnly [name]="'content-manager'"></extension-point>

./main-footer.component.scss

@use "@project-sunbird/sb-styles/assets/mixins/mixins" as *;
@use "layout/footer" as *;

:host ::ng-deep{
  .new-layout-footer{
    margin-top:calculateRem(24px);
    &.player-fullscreen-footer{
      display: none;
    }
    .sbt-footer-container {
      height: calculateRem(272px); //296px
      width: 100%;
      padding: 0% 2%;
      background: none;
      margin-top:calculateRem(8px);
    }
    .sbt-page-content-area {
      border-radius: 0rem 0 0 0;
    }
    .sbt-container{
      width:calc(100% - 4%);
      padding: 0;
      margin: 0 auto;
      padding-top: calculateRem(60px);
      border-radius: calculateRem(40px) calculateRem(40px) 0 0;
      background-color: var(--sbt-footer-bg);
      box-shadow: var(--sbt-box-shadow-6px);
      left:0;
      position:absolute;
      top:calculateRem(0px); //24px
      bottom: 0;
      right:0;
      z-index:8;
      @include respond-below(sm){
        bottom: auto;
      }
      .sbt-skyline-path{
        position: absolute;
        bottom: 0%;
        overflow: hidden;
        width: 88%;
        html[dir="rtl"] & {
          -webkit-transform: scaleX(-1);
          transform: scaleX(-1);
        }
        @include respond-below(sm){
          display: none;
        }
      }
      .sbt-footer-shade{
        position: absolute;
        bottom: 0;
        left: calculateRem(40px);
        html[dir="rtl"] & {
          left: auto;
          right: calculateRem(40px);
          -webkit-transform: scaleX(-1);
          transform: scaleX(-1);
        }
        @include respond-below(sm){
          display: none;
        }
      }
      .footerMenu {
        .help-center{
          margin-bottom: calculateRem(24px);
          @include respond-below(sm) {
            margin-bottom: calculateRem(16px);
          }
          a{
            color: var(--primary-color);
            font-size: calculateRem(14px);
            font-weight: bold;
          }
        }
        .contact-info{
          @include respond-below(sm) {
            margin-bottom: calculateRem(16px);
          }
          a{
            color: var(--primary-color);
            font-size: calculateRem(14px);
          }
          .contact-info-title{
            color: var(--primary-color);
            font-weight: bold;
            font-size: calculateRem(14px);
            margin-bottom: calculateRem(8px);
            @include respond-below(sm){
              margin-bottom: calculateRem(4px);
            }
          }
        }
      }
      .footer-terms-info{
        a{
          color: var(--sbt-footer-info-links);
          font-size: calculateRem(14px);
          font-weight: bold;
          &:hover{
            color: var(--sbt-footer-info-links-hover);
          }
        }
        color: var(--sbt-footer-info-links);
        font-size: calculateRem(14px);
        font-weight: bold
      }
      .sbt-footer-download-app{
        justify-content: flex-end;
        @include respond-below(sm){
          justify-content: center;
        }
        .sbt-footer-bg{
          padding-top: calculateRem(30px);
          .sbt-footer-bg-img{
            height: calculateRem(200px);
            width: calculateRem(380px);
            @include respond-below (sm){
              height: calculateRem(180px);
              width: calculateRem(320px);
            }
          }
          .sbt-footer-title{
            font-size: calculateRem(16px) !important;
            color: var(--gray-800);
            padding: 0 calculateRem(24px);
            position: absolute;
            width: calculateRem(130px);
            bottom: calculateRem(95px);
            left: 0;
            right: 0;
            margin: 0 auto;
            @include respond-below (sm){
              bottom: calculateRem(80px);
            }
          }
          .playStore-img{
            width: calculateRem(164px);
            position: absolute;
            bottom: calculateRem(30px);
            left: 0;
            right: 0;
            margin: 0 auto;
            @include respond-below(sm){
              width: calculateRem(144px);
              position: absolute;
              bottom: calculateRem(20px);
            }
          }
        }
      }
      .ui.grid.stackable{
        @include respond-below(md){
          padding: 0 calculateRem(32px) !important;
        }
      }
      .ui.stackable.grid>.wide.column{
        @include respond-below(md){
          padding: 0 !important;
        }
      }
    }   
  }
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""