-
-
Save BrightnBubbly/1b12cfeaf395372a4d13587afa88d169 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
import { Router } from '@angular/router'; | |
import { MessageResponse, Channel } from 'stream-chat'; | |
import { StreamService } from '../stream.service'; | |
import { StateService } from '../state.service'; | |
declare const feather: any; | |
@Component({ | |
selector: 'app-chat', | |
templateUrl: './chat.component.html', | |
styleUrls: ['./chat.component.scss'], | |
}) | |
export class ChatComponent implements OnInit { | |
constructor( | |
public streamService: StreamService, | |
private stateService: StateService, | |
private router: Router | |
) {} | |
messages: MessageResponse[] = []; | |
message = ''; | |
channel: Channel; | |
async sendMessage() { | |
... | |
} | |
getClasses(userId: string): { outgoing: boolean; incoming: boolean } { | |
const userIdMatches = userId === this.streamService.currentUser.me.id; | |
return { | |
outgoing: userIdMatches, | |
incoming: !userIdMatches, | |
}; | |
} | |
async ngOnInit() { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment