diff --git a/first-app/src/app/details/details.css b/first-app/src/app/details/details.css new file mode 100644 index 0000000..070f138 --- /dev/null +++ b/first-app/src/app/details/details.css @@ -0,0 +1,62 @@ +.listing-photo { + height: 600px; + width: 50%; + object-fit: cover; + border-radius: 30px; + float: right; +} +.listing-heading { + font-size: 48pt; + font-weight: bold; + margin-bottom: 15px; +} +.listing-location::before { + content: url('/assets/location-pin.svg') / ''; +} +.listing-location { + font-size: 24pt; + margin-bottom: 15px; +} +.listing-features > .section-heading { + color: var(--secondary-color); + font-size: 24pt; + margin-bottom: 15px; +} +.listing-features { + margin-bottom: 20px; +} +.listing-features li { + font-size: 14pt; +} +li { + list-style-type: none; +} +.listing-apply .section-heading { + font-size: 18pt; + margin-bottom: 15px; +} +label, input { + display: block; +} +label { + color: var(--secondary-color); + font-weight: bold; + text-transform: uppercase; + font-size: 12pt; +} +input { + font-size: 16pt; + margin-bottom: 15px; + padding: 10px; + width: 400px; + border-top: none; + border-right: none; + border-left: none; + border-bottom: solid .3px; +} +@media (max-width: 1024px) { + .listing-photo { + width: 100%; + height: 400px; + } +} \ No newline at end of file diff --git a/first-app/src/app/details/details.html b/first-app/src/app/details/details.html new file mode 100644 index 0000000..949793c --- /dev/null +++ b/first-app/src/app/details/details.html @@ -0,0 +1,13 @@ +
+ Exterior photo of {{ housingLocation?.name }} +

{{ housingLocation?.name }}

+

{{ housingLocation?.city }}, {{ housingLocation?.state }}

+

About this housing location

+ +
+
\ No newline at end of file diff --git a/first-app/src/app/details/details.ts b/first-app/src/app/details/details.ts index e53e236..45ce509 100644 --- a/first-app/src/app/details/details.ts +++ b/first-app/src/app/details/details.ts @@ -1,15 +1,39 @@ -import { Component } from '@angular/core'; - +import {Component, inject} from '@angular/core'; +import {ActivatedRoute} from '@angular/router'; +import {HousingService} from '../housing'; +import {HousingLocationInfo} from '../housinglocation'; @Component({ - selector: 'app-details', - imports: [], - template: ` -

- details works! -

+ selector: 'app-details', + template: ` +
+ Exterior photo of {{ housingLocation?.name }} +
+

{{ housingLocation?.name }}

+

{{ housingLocation?.city }}, {{ housingLocation?.state }}

+
+
+

About this housing location

+ +
+
`, - styles: `` + styleUrls: ['./details.css'], }) export class Details { - -} + route: ActivatedRoute = inject(ActivatedRoute); + housingService = inject(HousingService); + housingLocation: HousingLocationInfo | undefined; + constructor() { + const housingLocationId = Number(this.route.snapshot.params['id']); + this.housingLocation = this.housingService.getHousingLocationById(housingLocationId); + } +} \ No newline at end of file diff --git a/first-app/src/app/housing-location/housing-location.html b/first-app/src/app/housing-location/housing-location.html index 5628f54..ac7b189 100644 --- a/first-app/src/app/housing-location/housing-location.html +++ b/first-app/src/app/housing-location/housing-location.html @@ -3,4 +3,5 @@ alt="Exterior photo of {{ housingLocation().name }}" crossorigin/>

{{ housingLocation().name }}

{{ housingLocation().city }}, {{ housingLocation().state }}

+ Learn More \ No newline at end of file diff --git a/first-app/src/app/housing-location/housing-location.ts b/first-app/src/app/housing-location/housing-location.ts index 0e98a15..c835ab5 100644 --- a/first-app/src/app/housing-location/housing-location.ts +++ b/first-app/src/app/housing-location/housing-location.ts @@ -1,8 +1,10 @@ import {Component, input} from '@angular/core'; // Importation de la fonction input() et des components import {HousingLocationInfo} from '../housinglocation'; // Interface + +import {RouterModule} from '@angular/router'; // Importation du router @Component({ selector: 'app-housing-location', - imports: [], + imports: [RouterModule], templateUrl: './housing-location.html', styleUrls: ['./housing-location.css'], })