Add flight search button

This commit is contained in:
Patrick Gebhardt 2020-06-22 12:15:34 +02:00
parent 71bbb1a3f1
commit a5f102f99d
2 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,10 @@
<span class="region-name">{{region.name}}</span>
</div>
<app-bookmark-button [region]="region"></app-bookmark-button>
<a href="https://www.google.com/flights?q=flight+to+{{uriRegionName}}" mat-icon-button matTooltip="Search flights"
rel="noopener" target="_blank">
<mat-icon>flight_takeoff</mat-icon>
</a>
<app-share-button [region]="region"></app-share-button>
</div>
<p *ngIf="region.description" class="region-decsription">

View File

@ -31,6 +31,8 @@ export class RegionDetailsComponent implements AfterViewInit {
/** Current region */
region: Region;
/** URI encoded region name */
uriRegionName: string;
/** Extend the description text */
isDescExtended = false;
@ -42,6 +44,7 @@ export class RegionDetailsComponent implements AfterViewInit {
switchMap((params: ParamMap) => this.ds.getRegion(parseInt(params.get('id'), 10)))
).subscribe((region: Region) => {
this.region = region;
this.uriRegionName = encodeURI(this.region.name.toLowerCase());
setTimeout(() => {
if (this.container) {
this.container.nativeElement.scrollIntoView();