Skip to content

Commit b0d513c

Browse files
committed
update/create book screen design
1 parent 0278dcb commit b0d513c

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

src/views/BookDetailsView.vue

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="text-color-secondary text-3xl font-semibold m-5">Edit Book</div>
2+
<div class="text-color-secondary text-3xl font-semibold m-5">{{ title }}</div>
33
<Fieldset class="mx-6" legend="Godfather I">
44
<div class="mb-4">
55
<label for="id" class="block text-base font-medium mb-2">Id</label>
@@ -65,6 +65,21 @@
6565
<label for="year" class="block text-base font-medium mb-2">Year</label>
6666
<InputText id="year" type="text" class="w-full" />
6767
</div>
68+
69+
<!-- <Button label="Delete" icon="pi pi-trash" /> -->
70+
71+
<div class="grid my-6">
72+
<div class="col">
73+
<Button
74+
label="Cancel"
75+
icon="pi pi-times"
76+
class="w-full p-button-outlined"
77+
/>
78+
</div>
79+
<div class="col">
80+
<Button label="Save" icon="pi pi-check" class="w-full" />
81+
</div>
82+
</div>
6883
</Fieldset>
6984
</template>
7085

@@ -77,5 +92,13 @@ export default {
7792
default: 0,
7893
},
7994
},
95+
computed: {
96+
isAddMode() {
97+
return !this.id;
98+
},
99+
title() {
100+
return `${this.isAddMode ? "Add" : "Edit"} Book`;
101+
},
102+
},
80103
};
81104
</script>

src/views/BookListView.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
<template>
22
<div class="text-color-secondary text-3xl font-semibold m-5">
33
Books
4-
<Button
5-
icon="pi pi-plus"
6-
class="p-button-rounded p-button-secondary p-button-outlined ml-5"
7-
/>
4+
5+
<router-link
6+
:to="{ name: 'book-detail', params: { id: 0 } }"
7+
custom
8+
v-slot="{ navigate }"
9+
>
10+
<Button
11+
icon="pi pi-plus"
12+
class="p-button-rounded p-button-secondary p-button-outlined ml-5"
13+
@click="navigate"
14+
/>
15+
</router-link>
816
</div>
917

1018
<Message class="mx-5" :closable="false" :severity="messageSeverity">{{

0 commit comments

Comments
 (0)