Commit 589b8888 authored by achinta's avatar achinta

feat: change logo depend on school selection

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