Commit 589b8888 authored by achinta's avatar achinta

feat: change logo depend on school selection

parent 890af766
......@@ -4,19 +4,20 @@
<span>Select Your School</span>
</div>
<app-white-card
[cardTextHeading]="'La Martiniere for Boys, Kolkata'"
[cardTextHeading]="'La Martiniere for Girls, Kolkata'"
(emitWhiteCardClick)="selectedSchool('girls')"
[cardLink]="loginUrl"
[cardImg]="'./assets/image/b_logo.png'"
[cardImg]="'./assets/image/g_logo.png'"
/>
</div>
<div class="boys_login_container">
<app-white-card
[cardTextHeading]="'La Martiniere for Girls, Kolkata'"
[cardTextHeading]="'La Martiniere for Boys, Kolkata'"
(emitWhiteCardClick)="selectedSchool('boys')"
[cardLink]="loginUrl"
[cardImg]="'./assets/image/g_logo.png'"
[cardImg]="'./assets/image/b_logo.png'"
/>
</div>
</div>
\ No newline at end of file
......@@ -19,5 +19,8 @@ export class BeforeLoginComponent {
public loginUrl =`/${RequestMapperService.LOGIN_URL}`;
public selectedSchool(school:string): void{
// console.log(school);
localStorage.setItem('logged_school', school);
}
}
......@@ -2,7 +2,7 @@
<div class="phone_section">
<div class="logo_section">
<img class="login_logo"
[ngSrc]="'./assets/image/logo_lamarts.png'"
[ngSrc]="loggedSchoolLogo"
alt="Logo"
width="100"
height="100"
......
import { CommonModule, NgOptimizedImage, isPlatformBrowser } from '@angular/common';
import { Component, Inject, PLATFORM_ID } from '@angular/core';
import { Component, Inject, OnInit, PLATFORM_ID } from '@angular/core';
import { Router, RouterModule } from '@angular/router';
import { RoundedButtonFullWidthComponent } from '../../component-library/rounded-button-full-width/rounded-button-full-width.component';
import { AuthTransmissionService } from '../../raintree/transmission/auth-transmission.service';
......@@ -28,10 +28,12 @@ import { ToasterService } from '../../component-library/toaster/toaster.service'
templateUrl: './login.component.html',
styleUrl: './login.component.scss'
})
export class LoginComponent {
export class LoginComponent implements OnInit {
public errorMessage: string = '';
public loggedSchoolLogo:string = '';
constructor(
private _toaster:ToasterService,
private _authService: AuthService,
......@@ -46,6 +48,10 @@ export class LoginComponent {
password: new FormControl('', [Validators.required]),
});
public ngOnInit(): void {
this.loggedSchoolLogo = this._authService.getLoggedSchoolLogo();
}
public authenticate(): void {
if (this.loginForm.invalid) return;
......
......@@ -60,4 +60,13 @@ export class AuthService {
return this.localStorageGetItemByKey('role_name');
}
public getLoggedSchoolLogo(): string{
let logged_school = localStorage.getItem('logged_school');
let logo = '';
if(logged_school === 'boys') logo = './assets/image/b_logo.png';
if(logged_school === 'girls') logo = './assets/image/g_logo.png';
return logo;
}
}
<a [routerLink]="cardLink">
<a [routerLink]="cardLink" (click)="emitWhiteCardClick.emit(null)">
<div class="white_card">
<span class="material-symbols-outlined card_icon" *ngIf="cardTextIcon">
{{ cardTextIcon }}
......
import { CommonModule, NgOptimizedImage } from '@angular/common';
import { Component, Input } from '@angular/core';
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { RouterModule } from '@angular/router';
@Component({
......@@ -19,5 +19,6 @@ export class WhiteCardComponent {
@Input() cardTextIcon: string = '';
@Input() cardLink: string = '';
@Input() cardImg: string = '';
@Output() emitWhiteCardClick: EventEmitter<null> = new EventEmitter<null>();
}
......@@ -8,7 +8,7 @@
</button>
<img
[ngSrc]="'./assets/image/logo_lamarts.png'"
[ngSrc]="loggedSchoolLogo"
width="200"
height="100"
alt="logo"
......
import { NgOptimizedImage, isPlatformBrowser } from '@angular/common';
import { Component } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { LogoutService } from '../service/logout.service';
import { GetProfileInformationService } from '../service/get-profile-information.service';
import { UserProfile } from '../../../auth/interface/user-profile';
import { InitThemeService } from '../../../style-guide/service/initialize-theme.service';
import { AuthService } from '../../../auth/service/auth.service';
// import { ThemeModeChangerComponent } from "../../../component-library/theme-mode-changer/theme-mode-changer.component";
@Component({
......@@ -15,20 +16,26 @@ import { InitThemeService } from '../../../style-guide/service/initialize-theme.
templateUrl: './topbar.component.html',
styleUrl: './topbar.component.scss'
})
export class TopBarComponent {
export class TopBarComponent implements OnInit {
public userProfileInformation: UserProfile = {} as UserProfile;
public loggedSchoolLogo:string = '';
public isBrowser: boolean = false;
constructor(
private _logoutService: LogoutService,
private _getProfileInformation: GetProfileInformationService,
private _themeService: InitThemeService,
private _authService: AuthService,
) {
this._fetchProfileDetails();
}
public ngOnInit(): void {
this.loggedSchoolLogo = this._authService.getLoggedSchoolLogo();
}
public toggleSidebar(): void {
this._themeService.updateSidebarState(true);
}
......
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