Compare commits

...

3 Commits

4 changed files with 10 additions and 3 deletions

View File

@ -7,6 +7,5 @@
</div>
<skirda-text>description</skirda-text>
</div>
<skirda-icon *ngIf="!collapsed" name="play" size="24" (click)="run(game)" color="var(--sk-primary-accent)"></skirda-icon>
</div>
</a>

View File

@ -1,5 +1,5 @@
<skirda-section-label *ngIf="!collapsed">
Pinned games <div class="count">{{games.length}}</div>
Games <div class="count">{{games.length}}</div>
</skirda-section-label>
<skirda-icon name="library" size="20" *ngIf="collapsed"></skirda-icon>
<div class="games">

View File

@ -47,7 +47,7 @@
<!-- 6. Вызываем в нужном месте (в html компонента) открытие попап окна и передаем в метод из ts шаблон
(название переменной popupContent должно совпадать с аттрибутом
у описанного шаблона из пункта 2 (<ng-template #popupContent>)) -->
<skirda-button size="large" appearance="primary" (click)="openPopup(popupContent)">
<skirda-button size="large" appearance="primary" (click)="run(game)">
<skirda-icon name="play" size="32"></skirda-icon>
<skirda-heading size="1">Play</skirda-heading>
</skirda-button>

View File

@ -5,6 +5,7 @@ import { PopupService } from 'projects/ui/src/lib/popup/popup.service'
import { Subscription } from 'rxjs'
import { Game } from 'src/app/interfaces/game.interface'
import { UiService } from 'src/app/services/ui.service'
import { LauncherService } from 'src/app/services/launcher.service';
@Component({
selector: 'app-game-page',
@ -43,10 +44,17 @@ export class GamePageComponent implements OnInit, OnDestroy {
constructor(
private router: Router,
private launcher: LauncherService,
// 4. Импортировать сервис для попап окон
private popup: PopupService
) {}
run(game: Game) {
//console.log('Game to run ' + game.title)
this.launcher.RunGame(game)
}
ngOnInit(): void {
this.observeNavigation()
}