diff --git a/src/app/tabs/home/home.component.scss b/src/app/tabs/home/home.component.scss
index 2154c51..ea29c15 100644
--- a/src/app/tabs/home/home.component.scss
+++ b/src/app/tabs/home/home.component.scss
@@ -102,6 +102,19 @@
.tutor {
color: white;
+ width: 100%;
+
+ .go-live-button {
+ width: 100px;
+ display: block;
+ margin: 15px auto 0px;
+ background-color: var(--teal-green);
+ border-radius: 5px;
+ border: 0px;
+ color: white;
+ font-size: 14px;
+ height: 35px;
+ }
@media screen and (min-width: 1023px) {
position: relative;
diff --git a/src/app/tabs/home/home.component.ts b/src/app/tabs/home/home.component.ts
index ee6dbce..86e1c3b 100644
--- a/src/app/tabs/home/home.component.ts
+++ b/src/app/tabs/home/home.component.ts
@@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { ScrollEvent } from 'ngx-scroll-event';
-import * as moment from 'moment';
+import { DemoService } from '../../services/demo.service';
+import { Subscription } from 'rxjs';
@Component({
selector: 'app-home',
@@ -11,105 +12,15 @@ export class HomeComponent implements OnInit {
expandVideo: boolean = false;
showClassDetails: boolean;
selectedSegment: string = 'transcript';
+ showVideo: boolean = false;
+ demoTypeSubscriber: Subscription;
+ demoType: string;
- studentClassList = [{
- date: moment(new Date()).format('MMM, DD 2020'),
- classes: [{
- time: '10:00 AM',
- duration: '45 Mins',
- subject: 'Mathematics',
- teacher: {
- name: 'Mr Kashinath Kashyap',
- profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg'
- },
- classUrl: '/video-chapter',
- classId: 'topic1',
- attendanceStatus: 'LATE'
- }, {
- time: '11:00 AM',
- duration: '45 Mins',
- subject: 'Physics',
- teacher: {
- name: 'Dr Meghana',
- profile_image: 'https://pbs.twimg.com/profile_images/416884752377843712/MW2qg7-f.jpeg'
- },
- classUrl: '/chapter-notes',
- classId: 'topic1',
- attendanceStatus: 'ABSENT'
- }, {
- time: '12:00 PM',
- duration: '45 Mins',
- subject: 'Chemistry',
- teacher: {
- name: 'Mr Kashinath Kashyap',
- profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg'
- },
- classUrl: '/chapter-notes',
- classId: 'topic1',
- attendanceStatus: 'PRESENT'
- }, {
- time: '2:00 PM',
- duration: '45 Mins',
- subject: 'EVS',
- teacher: {
- name: 'Mr Kashinath Kashyap',
- profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg'
- }
- }, {
- time: '3:00 PM',
- duration: '45 Mins',
- subject: 'Biology',
- teacher: {
- name: 'Dr Meghana',
- profile_image: 'https://pbs.twimg.com/profile_images/416884752377843712/MW2qg7-f.jpeg'
- }
- }]
- }, {
- date: moment(new Date()).subtract(1, 'day').format('MMM, DD 2020'),
- classes: [{
- time: '10:00 AM',
- duration: '45 Mins',
- subject: 'Mathematics',
- teacher: {
- name: 'Mr Kashinath Kashyap',
- profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg'
- }
- }, {
- time: '11:00 AM',
- duration: '45 Mins',
- subject: 'Physics',
- teacher: {
- name: 'Dr Meghana',
- profile_image: 'https://pbs.twimg.com/profile_images/416884752377843712/MW2qg7-f.jpeg'
- }
- }, {
- time: '12:00 PM',
- duration: '45 Mins',
- subject: 'Chemistry',
- teacher: {
- name: 'Mr Kashinath Kashyap',
- profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg'
- }
- }, {
- time: '2:00 PM',
- duration: '45 Mins',
- subject: 'EVS',
- teacher: {
- name: 'Mr Kashinath Kashyap',
- profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg'
- }
- }, {
- time: '3:00 PM',
- duration: '45 Mins',
- subject: 'Biology',
- teacher: {
- name: 'Dr Meghana',
- profile_image: 'https://pbs.twimg.com/profile_images/416884752377843712/MW2qg7-f.jpeg'
- }
- }]
- }];
+ classList = [];
- constructor() { }
+ constructor(
+ private demoService: DemoService
+ ) { }
ngOnInit(): void {
if (window.innerWidth > 1023) {
@@ -117,6 +28,18 @@ export class HomeComponent implements OnInit {
} else {
this.showClassDetails = false;
}
+
+ this.demoTypeSubscriber = this.demoService.demoType.subscribe((type) => {
+ this.demoType = type;
+ if (type === 'Student') {
+ this.classList = this.demoService.studentClassList;
+ this.showVideo = true;
+ }
+
+ if (type === 'Teacher') {
+ this.classList = this.demoService.teacherClassList;
+ }
+ });
}
public handleScroll(event: ScrollEvent) {
diff --git a/src/app/welcome/welcome.component.html b/src/app/welcome/welcome.component.html
index ec3bed5..0991eae 100644
--- a/src/app/welcome/welcome.component.html
+++ b/src/app/welcome/welcome.component.html
@@ -2,7 +2,7 @@
Good Morning,
- Shashank
+ {{ demoType }}
Your schedule for the day!
@@ -10,7 +10,7 @@
-
+
diff --git a/src/app/welcome/welcome.component.scss b/src/app/welcome/welcome.component.scss
index 4519c52..c27a5d8 100644
--- a/src/app/welcome/welcome.component.scss
+++ b/src/app/welcome/welcome.component.scss
@@ -1,3 +1,7 @@
+.page-container {
+ padding-bottom: 100px;
+}
+
.upfold {
width: 100%;
color: white;
diff --git a/src/app/welcome/welcome.component.ts b/src/app/welcome/welcome.component.ts
index 4306d7b..cc8c760 100644
--- a/src/app/welcome/welcome.component.ts
+++ b/src/app/welcome/welcome.component.ts
@@ -1,5 +1,6 @@
import { Component, OnInit } from '@angular/core';
-import * as moment from 'moment';
+import { DemoService } from '../services/demo.service';
+import { Subscription } from 'rxjs';
@Component({
selector: 'app-welcome',
@@ -7,97 +8,30 @@ import * as moment from 'moment';
styleUrls: ['./welcome.component.scss']
})
export class WelcomeComponent implements OnInit {
- studentClassList = [{
- date: moment(new Date()).format('MMM, DD 2020'),
- classes: [{
- time: '10:00 AM',
- duration: '45 Mins',
- subject: 'Mathematics',
- teacher: {
- name: 'Mr Kashinath Kashyap',
- profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg'
- }
- }, {
- time: '11:00 AM',
- duration: '45 Mins',
- subject: 'Physics',
- teacher: {
- name: 'Dr Meghana',
- profile_image: 'https://pbs.twimg.com/profile_images/416884752377843712/MW2qg7-f.jpeg'
- }
- }, {
- time: '12:00 PM',
- duration: '45 Mins',
- subject: 'Chemistry',
- teacher: {
- name: 'Mr Kashinath Kashyap',
- profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg'
- }
- }, {
- time: '2:00 PM',
- duration: '45 Mins',
- subject: 'EVS',
- teacher: {
- name: 'Mr Kashinath Kashyap',
- profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg'
- }
- }, {
- time: '3:00 PM',
- duration: '45 Mins',
- subject: 'Biology',
- teacher: {
- name: 'Dr Meghana',
- profile_image: 'https://pbs.twimg.com/profile_images/416884752377843712/MW2qg7-f.jpeg'
- }
- }]
- }, {
- date: moment(new Date()).subtract(1, 'day').format('MMM, DD 2020'),
- classes: [{
- time: '10:00 AM',
- duration: '45 Mins',
- subject: 'Mathematics',
- teacher: {
- name: 'Mr Kashinath Kashyap',
- profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg'
- }
- }, {
- time: '11:00 AM',
- duration: '45 Mins',
- subject: 'Physics',
- teacher: {
- name: 'Dr Meghana',
- profile_image: 'https://pbs.twimg.com/profile_images/416884752377843712/MW2qg7-f.jpeg'
- }
- }, {
- time: '12:00 PM',
- duration: '45 Mins',
- subject: 'Chemistry',
- teacher: {
- name: 'Mr Kashinath Kashyap',
- profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg'
- }
- }, {
- time: '2:00 PM',
- duration: '45 Mins',
- subject: 'EVS',
- teacher: {
- name: 'Mr Kashinath Kashyap',
- profile_image: 'https://pbs.twimg.com/profile_images/3478244961/01ebfc40ecc194a2abc81e82ab877af4.jpeg'
- }
- }, {
- time: '3:00 PM',
- duration: '45 Mins',
- subject: 'Biology',
- teacher: {
- name: 'Dr Meghana',
- profile_image: 'https://pbs.twimg.com/profile_images/416884752377843712/MW2qg7-f.jpeg'
- }
- }]
- }];
+ demoTypeSubscriber: Subscription;
+ demoType: string;
- constructor() { }
+ classList = [];
+
+ constructor(
+ private demoService: DemoService
+ ) { }
ngOnInit(): void {
+ this.demoTypeSubscriber = this.demoService.demoType.subscribe((type) => {
+ this.demoType = type;
+ if (type === 'Student') {
+ this.classList = this.demoService.studentClassList;
+ }
+
+ if (type === 'Teacher') {
+ this.classList = this.demoService.teacherClassList;
+ }
+ });
}
+ ngOnDestroy() {
+ this.demoTypeSubscriber.unsubscribe();
+ }
+
}