diff --git a/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-card.component.html b/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-card.component.html new file mode 100644 index 0000000..6da9613 --- /dev/null +++ b/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-card.component.html @@ -0,0 +1,32 @@ +
+ + +
+ + Telegram + + +
+ + + + + @{{ telegram.username }} + + + + + +
+
diff --git a/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-card.component.scss b/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-card.component.scss new file mode 100644 index 0000000..734c848 --- /dev/null +++ b/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-card.component.scss @@ -0,0 +1,11 @@ +.telegram { + background-image: url("../../../../assets/telegram.png"); + background-size: cover; +} + +.platform-title { + display: grid; + grid-template-columns: 1fr 40px; + width: 100%; + align-items: center; +} diff --git a/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-card.component.spec.ts b/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-card.component.spec.ts new file mode 100644 index 0000000..dd06b03 --- /dev/null +++ b/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-card.component.spec.ts @@ -0,0 +1,24 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TelegramBotCardComponent } from './telegram-bot-card.component'; + +describe('TelegramBotCardComponent', () => { + let component: TelegramBotCardComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [TelegramBotCardComponent], + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(TelegramBotCardComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-card.component.ts b/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-card.component.ts new file mode 100644 index 0000000..4e4718e --- /dev/null +++ b/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-card.component.ts @@ -0,0 +1,27 @@ +import { Component, OnInit, Input } from '@angular/core'; +import { TelegramService } from 'src/app/core/api'; +import { TelegramBotInfoDialogComponent } from './telegram-bot-info-dialog/telegram-bot-info-dialog.component'; +import { MatDialog } from '@angular/material/dialog'; + +@Component({ + selector: 'app-telegram-bot-card', + templateUrl: './telegram-bot-card.component.html', + styleUrls: ['./telegram-bot-card.component.scss'], +}) +export class TelegramBotCardComponent implements OnInit { + @Input() hoodId; + telegrams$; + + constructor( + private telegramService: TelegramService, + private dialog: MatDialog + ) {} + + ngOnInit(): void { + this.telegrams$ = this.telegramService.getTelegramsPublic(this.hoodId); + } + + onInfoClick() { + this.dialog.open(TelegramBotInfoDialogComponent); + } +} diff --git a/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-info-dialog/telegram-bot-info-dialog.component.html b/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-info-dialog/telegram-bot-info-dialog.component.html new file mode 100644 index 0000000..0d62043 --- /dev/null +++ b/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-info-dialog/telegram-bot-info-dialog.component.html @@ -0,0 +1 @@ +

telegram-bot-info-dialog works!

diff --git a/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-info-dialog/telegram-bot-info-dialog.component.scss b/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-info-dialog/telegram-bot-info-dialog.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-info-dialog/telegram-bot-info-dialog.component.ts b/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-info-dialog/telegram-bot-info-dialog.component.ts new file mode 100644 index 0000000..63ffe8a --- /dev/null +++ b/kibicara-frontend/src/app/platforms/telegram/telegram-bot-card/telegram-bot-info-dialog/telegram-bot-info-dialog.component.ts @@ -0,0 +1,12 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-telegram-bot-info-dialog', + templateUrl: './telegram-bot-info-dialog.component.html', + styleUrls: ['./telegram-bot-info-dialog.component.scss'], +}) +export class TelegramBotInfoDialogComponent implements OnInit { + constructor() {} + + ngOnInit(): void {} +} diff --git a/kibicara-frontend/src/assets/telegram.png b/kibicara-frontend/src/assets/telegram.png new file mode 100644 index 0000000..773c782 Binary files /dev/null and b/kibicara-frontend/src/assets/telegram.png differ