Skip to content

Commit

Permalink
UI building card section implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
AlperMulayim committed Sep 9, 2023
1 parent 1009dbb commit c2ee185
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 17 deletions.
2 changes: 2 additions & 0 deletions leasesoft-ui/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<html>
<div class="app-root">
<app-header></app-header>
<div class="app-page-section">
<router-outlet></router-outlet>
</div>
<app-footer></app-footer>
</div>
</html>
4 changes: 3 additions & 1 deletion leasesoft-ui/src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.app-root{
margin: 15px;

.app-page-section{
min-height: 70vh;
}
}
14 changes: 7 additions & 7 deletions leasesoft-ui/src/app/building-card/building-card.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<div class="building-card-container">
<div class="img-container"> <img class="building-img" src="assets/apart.jpg"></div>
<div class="building-price">
2500 $ / Mo
{{building.priceUnit}}{{building.price}} / {{building.listingType}}
</div>
<div class="building-name">
Comfort Apart
{{building.name}}
</div>
<div class="building-adress"> West Street 1/1</div>
<div class="building-adress"> {{building.address}} </div>
<div class="building-details">
<div class="bed"> <img src="assets/bed.svg" alt=""> 3 Beds</div>
<div class="bath"> <img src="assets/bath.svg" alt=""> 2 Baths</div>
<div class="parking"><img src="assets/car.svg" alt=""> 1 Park </div>
<div class="bed"> <img src="assets/bed.svg" alt=""> {{building.beds}} Beds</div>
<div class="bath"> <img src="assets/bath.svg" alt=""> {{building.baths}} Baths</div>
<div class="parking"><img src="assets/car.svg" alt=""> {{building.carSpaces}} Park </div>
<div class="building-size">
<img src="assets/size.svg" alt=""> 120 sq
<img src="assets/size.svg" alt=""> {{building.size}} sq
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
flex-direction: column;
justify-content: center;
align-items: center;
padding: 20px;

.building-card-container {
display: flex;
Expand All @@ -17,7 +16,7 @@
background-color: #F5F1EF;
border-radius: 5px;
flex-direction: column;
padding: 10px;
padding: 20px;

.img-container {
flex: 4;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { Building } from '../modals/building';

@Component({
selector: 'app-building-card',
Expand All @@ -7,6 +8,8 @@ import { Component, OnInit } from '@angular/core';
})
export class BuildingCardComponent implements OnInit {

@Input()
public building: Building;
constructor() { }

ngOnInit() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<p>
buildings-section works!
</p>
<app-building-card></app-building-card>
<div class="building-section">
<div *ngFor="let building of buildingList" class="building-card">
<app-building-card [building]="building"></app-building-card>
</div>-
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.building-section{
display: flex;
flex-direction: row;
justify-content: space-between;
flex-wrap: wrap;
width: 100vw;
height: 100%;
.building-card{
flex: 1;
display: flex;
margin: 10px;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Building } from '../modals/building';

@Component({
selector: 'app-buildings-section',
Expand All @@ -7,6 +8,53 @@ import { Component, OnInit } from '@angular/core';
})
export class BuildingsSectionComponent implements OnInit {


public buildingList: Building[]= [
{
name: "Comfort Apt",
price: 2500,
address: "West Street",
beds:3,
baths:2,
carSpaces:1,
size:125,
listingType: 'Mo',
priceUnit: '$'
},
{
name: "Comfort Apt",
price: 2500,
address: "West Street",
beds:3,
baths:2,
carSpaces:1,
size:125,
listingType: 'Mo',
priceUnit: '$'
},
{
name: "Comfort Apt",
price: 2500,
address: "West Street",
beds:3,
baths:2,
carSpaces:1,
size:125,
listingType: 'Mo',
priceUnit: '$'
},
{
name: "Comfort Apt",
price: 2500,
address: "West Street",
beds:3,
baths:2,
carSpaces:1,
size:125,
listingType: 'Mo',
priceUnit: '$'
}
]
constructor() { }

ngOnInit() {
Expand Down
5 changes: 3 additions & 2 deletions leasesoft-ui/src/app/footer/footer.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
border-radius: 5px;
margin-top: 40px;
border-top: 2px solid #E4E4E4;
flex-wrap: wrap;
.footer-logo{
padding: 40px;
padding-top: 20px;
justify-content: center;
align-items: center;
flex:2;
Expand All @@ -19,7 +20,7 @@
}
}
.footer-message{
padding: 40px;
padding: 20px;
flex:3;
display: flex;
flex-direction: column;
Expand Down
11 changes: 11 additions & 0 deletions leasesoft-ui/src/app/modals/building.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export interface Building {
name: string;
price: number;
address: string;
beds: number;
baths: number;
carSpaces: number;
size: number;
listingType: string;
priceUnit:string;
}

0 comments on commit c2ee185

Please sign in to comment.