@@ -43,6 +43,7 @@ import { StartComponent } from './tabs/courses/test/start/start.component'; | |||||
import { EndComponent } from './tabs/courses/test/end/end.component'; | import { EndComponent } from './tabs/courses/test/end/end.component'; | ||||
import { QuestionSheetComponent } from './tabs/courses/test/question-sheet/question-sheet.component'; | import { QuestionSheetComponent } from './tabs/courses/test/question-sheet/question-sheet.component'; | ||||
import { QuestionComponent } from './tabs/courses/test/question-sheet/question/question.component'; | import { QuestionComponent } from './tabs/courses/test/question-sheet/question/question.component'; | ||||
import { AddBroadcastComponent } from './chat-page/add-broadcast/add-broadcast.component'; | |||||
@NgModule({ | @NgModule({ | ||||
declarations: [ | declarations: [ | ||||
@@ -73,6 +74,7 @@ import { QuestionComponent } from './tabs/courses/test/question-sheet/question/q | |||||
EndComponent, | EndComponent, | ||||
QuestionSheetComponent, | QuestionSheetComponent, | ||||
QuestionComponent, | QuestionComponent, | ||||
AddBroadcastComponent, | |||||
], | ], | ||||
imports: [ | imports: [ | ||||
BrowserModule, | BrowserModule, | ||||
@@ -0,0 +1 @@ | |||||
<p>add-broadcast works!</p> |
@@ -0,0 +1,25 @@ | |||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |||||
import { AddBroadcastComponent } from './add-broadcast.component'; | |||||
describe('AddBroadcastComponent', () => { | |||||
let component: AddBroadcastComponent; | |||||
let fixture: ComponentFixture<AddBroadcastComponent>; | |||||
beforeEach(async(() => { | |||||
TestBed.configureTestingModule({ | |||||
declarations: [ AddBroadcastComponent ] | |||||
}) | |||||
.compileComponents(); | |||||
})); | |||||
beforeEach(() => { | |||||
fixture = TestBed.createComponent(AddBroadcastComponent); | |||||
component = fixture.componentInstance; | |||||
fixture.detectChanges(); | |||||
}); | |||||
it('should create', () => { | |||||
expect(component).toBeTruthy(); | |||||
}); | |||||
}); |
@@ -0,0 +1,21 @@ | |||||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; | |||||
@Component({ | |||||
selector: 'app-add-broadcast', | |||||
templateUrl: './add-broadcast.component.html', | |||||
styleUrls: ['./add-broadcast.component.scss'] | |||||
}) | |||||
export class AddBroadcastComponent implements OnInit { | |||||
@Input() broadcastInfo: any; | |||||
@Output() addBroadcastEvents = new EventEmitter(); | |||||
@Input() friendList: any = []; | |||||
searchTerm: string = ''; | |||||
tempFriendList: any = []; | |||||
constructor() { } | |||||
ngOnInit(): void { | |||||
this.tempFriendList = this.friendList; | |||||
} | |||||
} |
@@ -46,7 +46,7 @@ | |||||
</div> | </div> | ||||
<div *ngIf="selectedSegment === 'broadcasts' && !showSearch"> | <div *ngIf="selectedSegment === 'broadcasts' && !showSearch"> | ||||
<ul class="chat-list"> | |||||
<ul class="chat-list" *ngIf="!showAddBroadCast"> | |||||
<li *ngFor="let chat of broadCastList; let i = index" (click)="openBroadcastChat(i)"> | <li *ngFor="let chat of broadCastList; let i = index" (click)="openBroadcastChat(i)"> | ||||
<img src="{{ chat.user.imgUrl }}"> | <img src="{{ chat.user.imgUrl }}"> | ||||
<div class="content"> | <div class="content"> | ||||
@@ -60,6 +60,13 @@ | |||||
</div> | </div> | ||||
</li> | </li> | ||||
</ul> | </ul> | ||||
<button class="add-broadcast-button" (click)="showAddBroadCast = !showAddBroadCast"> | |||||
<svg-icon [applyClass]="true" class="icon" src="assets/custom-icons/plus.svg"></svg-icon> | |||||
</button> | |||||
<app-add-broadcast *ngIf="showAddBroadCast"></app-add-broadcast> | |||||
</div> | </div> | ||||
<section class="search-list" *ngIf="showSearch"> | <section class="search-list" *ngIf="showSearch"> | ||||
@@ -84,6 +84,28 @@ | |||||
padding: 10px 5%; | padding: 10px 5%; | ||||
border-top-left-radius: 30px; | border-top-left-radius: 30px; | ||||
border-top-right-radius: 30px; | border-top-right-radius: 30px; | ||||
.add-broadcast-button { | |||||
position: fixed; | |||||
right: 20px; | |||||
bottom: 20px; | |||||
z-index: 1; | |||||
background-color: var(--teal-green); | |||||
border: 0px; | |||||
border-radius: 50%; | |||||
width: 50px; | |||||
height: 50px; | |||||
display: flex; | |||||
align-items: center; | |||||
justify-content: center; | |||||
.icon { | |||||
width: 70%; | |||||
position: relative; | |||||
top: 1px; | |||||
fill: white; | |||||
} | |||||
} | |||||
} | } | ||||
.chat-list { | .chat-list { | ||||
@@ -16,6 +16,7 @@ export class ChatPageComponent implements OnInit { | |||||
chatList: [], | chatList: [], | ||||
broadCastList: [] | broadCastList: [] | ||||
}; | }; | ||||
showAddBroadCast: boolean = false; | |||||
chatList = [{ | chatList = [{ | ||||
user: { | user: { | ||||