Skip to content

Commit

Permalink
Merge pull request #6 from CerealKiller97/dev
Browse files Browse the repository at this point in the history
Cleaning code up, API found
  • Loading branch information
Stefan Bogdanović authored Aug 31, 2019
2 parents 7de1441 + 956f6b1 commit 55b58b4
Show file tree
Hide file tree
Showing 17 changed files with 193 additions and 38 deletions.
73 changes: 71 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/app/modules/home/components/home/home.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<mat-grid-list cols="1" rowHeight="2:1">
<mat-grid-tile>
<h1 class="light-text">Welcome to VideoGamer</h1>
<h5>Explore gaming world.</h5>
<h5>Discover your new favorite game.</h5>
<mat-form-field>
<input matInput placeholder="label" value="value">
</mat-form-field>
Expand Down
12 changes: 5 additions & 7 deletions src/app/modules/home/components/home/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Component, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { LoadingService } from '@service/loading/loading.service';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TeamsService } from '@serviceteams/teams.service';
import { Subscription } from 'rxjs';
import { GamesService } from '@service/games/games.service';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
Expand All @@ -16,14 +16,14 @@ export class HomeComponent implements OnInit {
private readonly titleService: Title,
private readonly loadingService: LoadingService,
private readonly snackBar: MatSnackBar,
private readonly teamsService: TeamsService
private readonly gamesService: GamesService
) {}

ngOnInit(): void {
this.loadingService.setLoading(true);
this.titleService.setTitle('VideoGamer | Home');
this.openSnackBar();
this.subscription = this.teamsService.find(5).subscribe(data => {
this.subscription = this.gamesService.all().subscribe(data => {
console.log(data);
});
}
Expand All @@ -32,12 +32,10 @@ export class HomeComponent implements OnInit {
const options: MatSnackBarConfig = {
direction: 'ltr',
duration: 4000,
horizontalPosition: 'end',
panelClass: ['example-pizza-party']
horizontalPosition: 'end'
};

this.snackBar.open('Welcome to the best NBA analytics app. 👋', 'Dismiss', options);
// this.snackBar.openFromComponent(NotificationComponent, options);
this.snackBar.open('Welcome 👋', null, options);
}

onClick(): void {
Expand Down
4 changes: 2 additions & 2 deletions src/app/modules/home/home.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { MatInputModule } from '@angular/material/input';
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { NotificationComponent } from '../shared-components/components/notification/notification.component';
import { SharedModule } from '../shared/shared.module';
import { TeamsService } from '@serviceteams/teams.service';
import { GamesService } from '@service/games/games.service';

const routes: Routes = [
{
Expand Down Expand Up @@ -39,6 +39,6 @@ const routes: Routes = [
SharedModule
],
entryComponents: [NotificationComponent],
providers: [TeamsService]
providers: [GamesService]
})
export class HomeModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface Link {
export class HeaderComponent implements OnInit {
public readonly links: Link[] = [
{ name: 'Home', path: '' },
{ name: 'About', path: 'about' },
{ name: 'Gaming', path: 'gaming' },
{ name: 'Contact', path: 'contact' }
];
constructor() {}
Expand Down
6 changes: 5 additions & 1 deletion src/app/modules/shared/models/Game.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export interface Game {
import { Team } from '@model/Team';

export interface Game {
id: number;
date: Date;
homeTeam: Team;
}
11 changes: 8 additions & 3 deletions src/app/modules/shared/models/Player.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { Team } from '@model/Team';

export interface Player {
id: number;
firstName: string;
lastName: string;
position: string;
height: string;
weight: string;
club: string;
heightFeet: number;
height_inches: number;
weightPounds: string;
team: Team;
}
Loading

1 comment on commit 55b58b4

@vercel
Copy link

@vercel vercel bot commented on 55b58b4 Aug 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.