-
Notifications
You must be signed in to change notification settings - Fork 13
feat(angular-ngrx-scss): Create main layout (Top repos + Gists) #319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
285d37d
feat(angular-ngrx-scss): Get gists from Github API
SDaian 27c7bb6
[fix/issue/106] - Add main page layout
SDaian 2627196
[fix/issue-106] - Create main page layout
SDaian 77234b3
Add missing changes
SDaian 6a5a3e5
Remove unnecesary params
SDaian bf00576
Update params to the topRepos call
SDaian d16ebb6
Added disabled feature for view-all
SDaian 608fa15
fix format
SDaian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
19 changes: 19 additions & 0 deletions
19
angular-ngrx-scss/src/app/home/top-repositories/top-repositories.component.html
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <div class="top-repositories-container"> | ||
| <h2>Top Repositories</h2> | ||
| <div class="repo-container"> | ||
| <ng-container *ngIf="repos$ | async as repos"> | ||
| <ng-container *ngFor="let repo of repos; last as isLast"> | ||
| <div class="repo-section"> | ||
| <app-repo-card [repo]="repo"></app-repo-card> | ||
| </div> | ||
| <div class="view-all-link" *ngIf="isLast"> | ||
| <ng-container *ngIf="username$ | async as username"> | ||
| <a routerLink="/{{ username }}" [class.disabled]="!username" | ||
| >View all repositories</a | ||
| > | ||
| </ng-container> | ||
| </div> | ||
| </ng-container> | ||
| </ng-container> | ||
| </div> | ||
| </div> | ||
35 changes: 35 additions & 0 deletions
35
angular-ngrx-scss/src/app/home/top-repositories/top-repositories.component.scss
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| @use '../../shared/styles/variables'; | ||
|
|
||
| .top-repositories-container { | ||
| padding: 3rem; | ||
| h2 { | ||
| font-size: 18px; | ||
| line-height: 28px; | ||
lindakatcodes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| font-weight: 500; | ||
| margin-bottom: 16px; | ||
| } | ||
| .repo-container { | ||
| background-color: variables.$white; | ||
| border-radius: 0.5rem; | ||
| border-width: 1px; | ||
| } | ||
| .repo-section { | ||
lindakatcodes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| padding: 2rem 0; | ||
| padding-left: 2rem; | ||
| border-bottom: 1px solid variables.$gray300; | ||
| } | ||
| .view-all-link { | ||
| padding: 1.25rem; | ||
| background-color: variables.$gray200; | ||
| display: grid; | ||
| place-items: center; | ||
| a { | ||
| color: inherit; | ||
| font-weight: 600; | ||
| &.disabled { | ||
| color: variables.$gray300; | ||
| cursor: not-allowed; | ||
| } | ||
| } | ||
| } | ||
| } | ||
15 changes: 15 additions & 0 deletions
15
angular-ngrx-scss/src/app/home/top-repositories/top-repositories.component.ts
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| import { Component } from '@angular/core'; | ||
| import { Store } from '@ngrx/store'; | ||
| import { selectTopRepos, selectUserLoginName } from 'src/app/state/user'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-top-repositories', | ||
| templateUrl: './top-repositories.component.html', | ||
| styleUrls: ['./top-repositories.component.scss'], | ||
| }) | ||
| export class TopRepositoriesComponent { | ||
| username$ = this.store.select(selectUserLoginName); | ||
| repos$ = this.store.select(selectTopRepos); | ||
|
|
||
| constructor(private store: Store) {} | ||
| } |
14 changes: 14 additions & 0 deletions
14
angular-ngrx-scss/src/app/home/user-gists/user-gists.component.html
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <div class="container"> | ||
| <h3>Gists</h3> | ||
| <ng-container *ngIf="userGists$ | async as gists"> | ||
| <ng-container *ngIf="gists.length > 0"> | ||
| <div class="list-container"> | ||
lindakatcodes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <ng-container *ngFor="let gist of gists"> | ||
| <a class="link" [href]="gist.url" target="_blank">{{ | ||
| gist.fileName | ||
| }}</a> | ||
lindakatcodes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </ng-container> | ||
| </div> | ||
| </ng-container> | ||
| </ng-container> | ||
| </div> | ||
16 changes: 16 additions & 0 deletions
16
angular-ngrx-scss/src/app/home/user-gists/user-gists.component.scss
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| @use '../../shared/styles/variables'; | ||
|
|
||
| .container { | ||
| padding: 2rem 0; | ||
| border-top: 1px solid variables.$gray300; | ||
| border-bottom: 1px solid variables.$gray300; | ||
| h3 { | ||
| font-weight: 600; | ||
| } | ||
| a.link { | ||
| color: variables.$black; | ||
| &:hover { | ||
| color: variables.$blue300; | ||
| } | ||
| } | ||
| } |
14 changes: 14 additions & 0 deletions
14
angular-ngrx-scss/src/app/home/user-gists/user-gists.component.ts
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { Component } from '@angular/core'; | ||
| import { Store } from '@ngrx/store'; | ||
| import { selectGists } from 'src/app/state/user'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-user-gists', | ||
| templateUrl: './user-gists.component.html', | ||
| styleUrls: ['./user-gists.component.scss'], | ||
| }) | ||
| export class UserGistsComponent { | ||
| userGists$ = this.store.select(selectGists); | ||
|
|
||
| constructor(private store: Store) {} | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.