diff --git a/src/app/components/repos/repos.component.html b/src/app/components/repos/repos.component.html index c234edd..0aef31b 100644 --- a/src/app/components/repos/repos.component.html +++ b/src/app/components/repos/repos.component.html @@ -1,4 +1,30 @@ -
+ + \ No newline at end of file diff --git a/src/app/components/repos/repos.component.scss b/src/app/components/repos/repos.component.scss index e69de29..6df51e8 100644 --- a/src/app/components/repos/repos.component.scss +++ b/src/app/components/repos/repos.component.scss @@ -0,0 +1,26 @@ +.carousel { + ::ng-deep .p-carousel-item { + padding-bottom: .5rem; + } + + .top-info { + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + padding: .5rem 0 1rem 0; + + p { + margin: 0; + } + + a.icon { + color: black; + + i { + font-size: larger; + } + } + + } +} \ No newline at end of file diff --git a/src/app/components/repos/repos.component.ts b/src/app/components/repos/repos.component.ts index 1bba1c7..a12f4b2 100644 --- a/src/app/components/repos/repos.component.ts +++ b/src/app/components/repos/repos.component.ts @@ -1,5 +1,6 @@ import { NgClass, NgIf } from '@angular/common'; import { Component, OnInit, inject } from '@angular/core'; +import { CarouselModule } from 'primeng/carousel'; import { DataViewModule } from 'primeng/dataview'; import { TagModule } from 'primeng/tag'; import { GithubService } from '../../services/github.service'; @@ -7,7 +8,7 @@ import { GithubService } from '../../services/github.service'; @Component({ selector: 'app-repos', standalone: true, - imports: [TagModule, DataViewModule, NgIf, NgClass], + imports: [TagModule, DataViewModule, NgIf, NgClass, CarouselModule], templateUrl: './repos.component.html', styleUrl: './repos.component.scss', providers: [GithubService] @@ -20,10 +21,24 @@ export class ReposComponent implements OnInit { card_img: false }; repos: any[] = []; + respOptions: any[] | undefined; ngOnInit(): void { + this.respOptions = [ + { breakpoint: '2559px', numVisible: 5, numScroll: 1 }, + { breakpoint: '1919px', numVisible: 5, numScroll: 1 }, + { breakpoint: '1439px', numVisible: 3, numScroll: 1 }, + { breakpoint: '1366px', numVisible: 3, numScroll: 1 }, + { breakpoint: '1199px', numVisible: 2, numScroll: 1 }, + { breakpoint: '991px', numVisible: 2, numScroll: 1 }, + { breakpoint: '599px', numVisible: 1, numScroll: 1 } - this.gitService.getAll('tauisilva').subscribe((repos) => { + ] + this.load(); + } + + load() { + this.gitService.getAll().subscribe((repos) => { if (repos) { this.repos = repos; repos.forEach(async (r: any) => { diff --git a/src/app/services/github.service.ts b/src/app/services/github.service.ts index c16b461..6f5cdf9 100644 --- a/src/app/services/github.service.ts +++ b/src/app/services/github.service.ts @@ -8,12 +8,12 @@ import { environment } from '../../env/env'; }) export class GithubService { - private api = `${environment.GIT_Api}`; + private api = `${environment.API_GITHUB}`; private http = inject(HttpClient); constructor() { } - getAll(user: string) { - return this.http.get(`${this.api}/users/${user}/repos`); + getAll() { + return this.http.get(`${this.api}/users/${environment.USER_GITHUB}/repos`); } getImg(url: string): Observable { diff --git a/src/env/env.ts b/src/env/env.ts index adde1aa..00297b0 100644 --- a/src/env/env.ts +++ b/src/env/env.ts @@ -1,4 +1,5 @@ export const environment = { production: false, - GIT_Api: 'https://api.github.com', + API_GITHUB: 'https://api.github.com', + USER_GITHUB: 'tauisilva' } \ No newline at end of file