Skip to content
Snippets Groups Projects
Commit bc1e00a5 authored by henrikburmann's avatar henrikburmann
Browse files

Better design for newRent

parent 16776e38
No related branches found
No related tags found
1 merge request!81Renting
...@@ -2,21 +2,21 @@ ...@@ -2,21 +2,21 @@
<div class="confirmationBox"> <div class="confirmationBox">
<div class="rentTitle"> <div class="rentTitle">
<h1> <h1>
{{ title }} {{ title }}
</h1> </h1>
</div> </div>
<div class = "fromTime"> <div class="fromTime">
<p>Fra: {{ from_time }}</p> <p>Fra: {{ fromTime }}</p>
</div> </div>
<div class = "toTime"> <div class="toTime">
<p>Til: {{ to_time }}</p> <p>Til: {{ toTime }}</p>
</div> </div>
<div class = "message"> <div class="message">
<label <label
class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400"
id="descriptionLabel" id="descriptionLabel"
>Skriv en melding til utleier</label >Skriv en melding til utleier:</label
> >
<textarea <textarea
id="description" id="description"
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
required required
></textarea> ></textarea>
</div> </div>
<colored-button class = "cancelButton" :text="'Tilbake'"></colored-button> <button class="cancelButton">Tilbake</button>
<div class = "confirmButton"> <div class="confirmButton">
<colored-button @click="sendRent" :text="'Send'"></colored-button> <colored-button @click="sendRent" :text="'Send'"></colored-button>
</div> </div>
</div> </div>
</template> </template>
...@@ -44,8 +44,13 @@ export default { ...@@ -44,8 +44,13 @@ export default {
data() { data() {
return { return {
title: this.newRentBox.title, title: this.newRentBox.title,
fromTime: this.newRentBox.fromTime,
toTime: this.newRentBox.toTime,
fromTimeMilliseconds: new Date(this.newRentBox.fromTime).getMilliseconds,
toTimeMilliseconds: new Date(this.newRentBox.toTime).getMilliseconds,
message: "", message: "",
price: this.newRentBox.price_per_day, price: this.newRentBox.price_per_day,
}; };
}, },
props: { props: {
...@@ -57,7 +62,7 @@ export default { ...@@ -57,7 +62,7 @@ export default {
toTime: Date, toTime: Date,
pricePerDay: Number, pricePerDay: Number,
listingId: Number, listingId: Number,
isAccepted: Boolean isAccepted: Boolean,
}, },
}, },
methods: { methods: {
...@@ -70,8 +75,8 @@ export default { ...@@ -70,8 +75,8 @@ export default {
listingId: this.newRentBox.listingId, listingId: this.newRentBox.listingId,
renterId: this.newRentBox.renterId, renterId: this.newRentBox.renterId,
isAccepted: false, isAccepted: false,
toTime: this.newRentBox.toTime, toTime: this.toTimeMilliseconds,
fromTime: this.newRentBox.fromTime, fromTime: this.fromTimeMilliseconds,
}; };
await postNewRent(rent); await postNewRent(rent);
console.log(rent); console.log(rent);
...@@ -80,43 +85,50 @@ export default { ...@@ -80,43 +85,50 @@ export default {
}; };
</script> </script>
<style> <style scoped>
.confirmationBox{ .confirmationBox {
border: 1px solid silver;
margin-top: 60fr; margin-top: 60fr;
width: 70%; padding: 10%;
width: 80%;
margin: auto; margin: auto;
display: grid; display: grid;
grid-template-columns: 1fr 3fr; grid-template-columns: 1fr 3fr;
grid-template-rows: 1fr 1fr 1fr 3fr 1fr; grid-template-rows: 0.5fr 1.5fr 1fr 1fr 3fr 1fr;
max-height: 90%; /* max-height: 100%; */
margin-top: 10%;
} }
.cancelButton{ .cancelButton {
grid-column: 1/2; grid-column: 1/2;
grid-row: 1/2; grid-row: 1/2;
} }
.rentTitle{ .rentTitle {
margin-top: 10%; margin-top: 10%;
text-align: center; text-align: center;
grid-column: 2/3; grid-column: 1/3;
}
.fromTime{
grid-row: 2/3; grid-row: 2/3;
font-weight: bold;
}
.fromTime {
grid-row: 3/4;
grid-column: 1/3; grid-column: 1/3;
display: block; display: block;
} }
.toTime{ .toTime {
grid-row: 3/4; grid-row: 4/5;
grid-column: 1/3; grid-column: 1/3;
display: block; display: block;
} }
.message{ .message {
grid-column: 1/3; grid-column: 1/3;
grid-row: 4/5; grid-row: 5/6;
} }
.confirmButton{ .confirmButton {
grid-column: 1/3; grid-column: 1/3;
grid-row: 5/6; grid-row: 6/7;
align-content: center; align-content: center;
margin: auto;
margin-top: 10px;
} }
</style> </style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment