Skip to content

Commit

Permalink
created a new function for the search of hotels in the hotels page, a…
Browse files Browse the repository at this point in the history
…dded new images of the project screenshots
  • Loading branch information
aline-borges committed Sep 17, 2020
1 parent 500129a commit ddcc9fd
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/app/components/form/form.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1 class="page-title">
<section class="header-form ">
<i class="fas fa-map-marker-alt"></i>
<input
id="searchInput"
id="input-home"
(change)="getLocation($event)"
(keyup.enter)="getHotels()"
class="search-input"
Expand All @@ -31,17 +31,17 @@ <h1 class="page-title">
</div>

<div class="container-hotel" id="hotel-page">
<app-header (sendTypeSearch)="onSendTypeSearch($event)"></app-header>
<app-header (sendTypeSearchHotel)="onSendTypeSearchHotel($event)"></app-header>
<div id="form-hotel-page" class="search-form">
<div class="header-form ">
<i class="fas fa-map-marker-alt"></i>
<input
(change)="getLocation($event)"
id="input-hotel"
(change)="getLocationHotelPage($event)"
(keyup.enter)="getHotels()"
class="search-input"
placeholder="Vai pra onde?"
#campoInput
(load)="clearInput()"
>
</div>

Expand Down Expand Up @@ -191,7 +191,7 @@ <h1 class="page-title">
<div *ngIf="hotels" class="ordenation" id="ordenation">
<div class="slider" id="slider">
<p class="rangeText">Valor até: R$ {{ this.value ? this.value : '1500' }}</p>
<input type="range" id="range" [min]="minPrice" [max]="1500" [value]="1500" (click)="limitedByPrice()" (change)="rangeValue()">
<input type="range" id="range" [min]="minPrice" [max]="1500" [value]="this.value" (click)="limitedByPrice()" (change)="rangeValue()">
</div>
</div>
<div class="hotel-list">
Expand Down
16 changes: 11 additions & 5 deletions src/app/components/form/form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,25 @@ export class FormComponent implements OnInit {
this.location = value;
}

this.location = (<HTMLInputElement>document.querySelector('.search-input')).value;
this.location = (<HTMLInputElement>document.getElementById('input-home')).value;
}

clearInput() {
const input = (<HTMLInputElement>document.querySelector('.search-input'));

input.value=''
getLocationHotelPage(evento: KeyboardEvent, value: string) {
if(value !== null) {
this.location = value;
}

this.location = (<HTMLInputElement>document.getElementById('input-hotel')).value;
}

onSendTypeSearch(event) {
this.typeSearchOption = event;
}

onSendTypeSearchHotel(event) {
this.typeSearchOptionHotel = event;
}

getHotels(page = 1, typeSearchOption, order: string, limited: string, quantityStars: Array<any>) {
this.hurbService.getData(this.location, this.typeSearchOption, page, order, limited, quantityStars).subscribe((data) => {
this.hotels = data.results;
Expand Down
Binary file modified src/assets/images/hurb-project-screen-home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/hurb-project-screen-hotel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/hurb-project-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ddcc9fd

Please sign in to comment.