2024-08-13 12:20:24 +02:00
parent ec0576e7b8
commit 1f8febc479
10 changed files with 105 additions and 60 deletions

View File

@@ -99,6 +99,7 @@
<div class="container mx-auto p-4">
<div class="bg-white shadow-md rounded-lg overflow-hidden">
@if(listing){
<div class="p-6 relative">
<h1 class="text-3xl font-bold mb-4">{{ listing?.title }}</h1>
<button
@@ -231,5 +232,6 @@
</div>
</div>
</div>
}
</div>
</div>

View File

@@ -88,18 +88,26 @@ export class DetailsCommercialPropertyListingComponent {
this.user = await this.userService.getByMail(this.keycloakUser.email);
this.mailinfo = createMailInfo(this.user);
}
this.listing = (await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty'))) as CommercialPropertyListing;
this.listingUser = await this.userService.getByMail(this.listing.email);
this.description = this.sanitizer.bypassSecurityTrustHtml(this.listing.description);
import('flowbite').then(flowbite => {
flowbite.initCarousels();
});
this.propertyDetails = [
{ label: 'Property Category', value: this.selectOptions.getCommercialProperty(this.listing.type) },
{ label: 'Located in', value: this.selectOptions.getState(this.listing.location.state) },
{ label: 'City', value: this.listing.location.name },
{ label: 'Asking Price:', value: `$${this.listing.price?.toLocaleString()}` },
];
try {
this.listing = (await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty'))) as CommercialPropertyListing;
this.listingUser = await this.userService.getByMail(this.listing.email);
this.description = this.sanitizer.bypassSecurityTrustHtml(this.listing.description);
import('flowbite').then(flowbite => {
flowbite.initCarousels();
});
this.propertyDetails = [
{ label: 'Property Category', value: this.selectOptions.getCommercialProperty(this.listing.type) },
{ label: 'Located in', value: this.selectOptions.getState(this.listing.location.state) },
{ label: 'City', value: this.listing.location.name },
{ label: 'Asking Price:', value: `$${this.listing.price?.toLocaleString()}` },
];
if (this.listing.draft) {
this.propertyDetails.push({ label: 'Draft', value: this.listing.draft ? 'Yes' : 'No' });
}
} catch (error) {
console.log(error);
}
//this.initFlowbite();
}
ngOnDestroy() {