-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
81 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,6 +1,21 @@ | ||
# NearbyShopsFront | ||
|
||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.1.2. | ||
This is a coding challenge for Hidden founders. | ||
|
||
This is just the Front-Service using Angula 6.1.2. | ||
You can find the Back-Service [Here](https://github.com/karim88/nearby-shops-back-service). | ||
|
||
# Installation | ||
|
||
* First you need Angula CLI: `npm i @angular/cil -g` | ||
* Clone the project `git clone [email protected]:karim88/nearby-shops-front-service.git` | ||
* Navigate to the project folder `cd nearby-shops-front-service` | ||
* Install dependencies `npm i` | ||
* Now you are Ready To Go you can run `ng serve --aot` for developement or `ng seve --prod` for production. | ||
|
||
``` | ||
Note: don't forget to change the environement files. | ||
``` | ||
|
||
## Development server | ||
|
||
|
This file contains 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 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 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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
.card-columns { | ||
padding-top: 85px; | ||
.pagination-row { | ||
margin-top: 30px; | ||
} | ||
|
||
.pagination-component { | ||
display: flex; | ||
} |
This file contains 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 |
---|---|---|
@@ -1,10 +1,14 @@ | ||
<div class="card-columns"> | ||
<app-card *ngFor="let shop of data" [shop]="shop" (liked)="updateShops($event)" [is_favorite]="is_favorite"></app-card> | ||
<div class="row"> | ||
<div class="col-md-4" *ngFor="let shop of data"> | ||
<app-card [shop]="shop" (liked)="updateShops($event)" [is_favorite]="is_favorite"></app-card> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="row pagination-row"> | ||
<div class="col-xs-12 col-12"> | ||
<pagination [totalItems]="shops.total" [(ngModel)]="shops.current_page" [maxSize]="5" [boundaryLinks]="true" [itemsPerPage]="12" (pageChanged)="pageChanged($event)"></pagination> | ||
<pagination class="mx-auto pagination-component" [totalItems]="shops.total" [(ngModel)]="shops.current_page" | ||
[maxSize]="5" [boundaryLinks]="true" [itemsPerPage]="12" | ||
(pageChanged)="pageChanged($event)"></pagination> | ||
</div> | ||
</div> | ||
|
This file contains 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 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 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 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 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,3 @@ | ||
.container { | ||
margin-top: 85px; | ||
} |
9 changes: 8 additions & 1 deletion
9
src/app/modules/shops/components/favorites/favorites.component.html
This file contains 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 |
---|---|---|
@@ -1,3 +1,10 @@ | ||
<div class="container" *ngIf="data"> | ||
<div class="container" *ngIf="data && data.data.length > 0"> | ||
<app-card-list [shops]="data" (paginate)="paginated($event)" [is_favorite]="true"></app-card-list> | ||
</div> | ||
|
||
<div class="container" *ngIf="!data || data.data.length === 0"> | ||
<div class="alert alert-warning" role="alert"> | ||
You did not like any shop, why?<br> | ||
do some likes and come back ;-) | ||
</div> | ||
</div> |
This file contains 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 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,3 @@ | ||
.container { | ||
margin-top: 85px; | ||
} |
7 changes: 7 additions & 0 deletions
7
src/app/modules/shops/components/nearby/nearby.component.html
This file contains 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 |
---|---|---|
@@ -1,3 +1,10 @@ | ||
<div class="container" *ngIf="data"> | ||
<app-card-list [shops]="data" (paginate)="paginated($event)" [is_favorite]="false"></app-card-list> | ||
</div> | ||
|
||
<div class="container" *ngIf="!data || data.data.length === 0"> | ||
<div class="alert alert-warning" role="alert"> | ||
Something bad occured while fetching data<br> | ||
Please allow localisation of you position to get the list of shops ;-( | ||
</div> | ||
</div> |
This file contains 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 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 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