@@ -3,14 +3,14 @@ import { inject, ref, useTemplateRef } from 'vue';
33import { useI18n } from ' vue-i18n' ;
44import { storeToRefs } from ' pinia' ;
55import { callKey , dayjsKey } from ' @/keys' ;
6- import { LinkButton , NoticeBar , NoticeBarTypes , PrimaryButton } from ' @thunderbirdops/services-ui' ;
6+ import { IconButton , LinkButton , NoticeBar , NoticeBarTypes , PrimaryButton } from ' @thunderbirdops/services-ui' ;
7+ import { PhX } from ' @phosphor-icons/vue' ;
78import { createAvailabilityStore } from ' @/stores/availability-store' ;
89import { createScheduleStore } from ' @/stores/schedule-store' ;
910import { useUserStore } from ' @/stores/user-store' ;
1011import { deepClone } from ' @/utils' ;
1112import { Alert , Availability } from ' @/models' ;
12- import { DateFormatStrings , AlertSchemes } from ' @/definitions' ;
13- import AlertBox from ' @/elements/AlertBox.vue' ;
13+ import { DateFormatStrings } from ' @/definitions' ;
1414
1515import AvailabilitySettings from ' ./components/AvailabilitySettings/index.vue' ;
1616import BookingPageDetails from ' ./components/BookingPageDetails/index.vue' ;
@@ -111,6 +111,9 @@ async function onSaveChanges() {
111111}
112112
113113function onRevertChanges() {
114+ validationError .value = null ;
115+ saveSuccess .value = null ;
116+
114117 availabilityStore .revertChanges ();
115118}
116119 </script >
@@ -154,20 +157,41 @@ export default {
154157 </template >
155158 </notice-bar >
156159
157- <alert-box
158- class =" alert-box"
159- v-if =" validationError"
160- :alert =" validationError"
161- @close =" validationError = null"
162- />
160+ <notice-bar
161+ v-else-if =" validationError"
162+ :type =" NoticeBarTypes.Critical"
163+ class =" notice-bar"
164+ >
165+ {{ validationError.title }}
166+
167+ <template #cta >
168+ <icon-button
169+ @click =" validationError = null"
170+ :title =" t('label.close')"
171+ class =" btn-close"
172+ >
173+ <ph-x />
174+ </icon-button >
175+ </template >
176+ </notice-bar >
163177
164- <alert-box
165- class =" alert-box"
178+ <notice-bar
166179 v-else-if =" saveSuccess"
167- :alert =" saveSuccess"
168- :scheme =" AlertSchemes.Success"
169- @close =" saveSuccess = null"
170- />
180+ :type =" NoticeBarTypes.Success"
181+ class =" notice-bar"
182+ >
183+ {{ saveSuccess.title }}
184+
185+ <template #cta >
186+ <icon-button
187+ @click =" saveSuccess = null"
188+ :title =" t('label.close')"
189+ class =" btn-close"
190+ >
191+ <ph-x />
192+ </icon-button >
193+ </template >
194+ </notice-bar >
171195
172196 <form ref =" availability-form" @submit.prevent >
173197 <div class =" page-content" >
@@ -223,6 +247,11 @@ export default {
223247 position : sticky ;
224248 top : 5rem ;
225249 z-index : 50 ;
250+
251+ .btn-close {
252+ height : 2.375rem ;
253+ width : 2.375rem ;
254+ }
226255}
227256
228257.page-content {
@@ -232,10 +261,6 @@ export default {
232261 margin-block-end : 2rem ;
233262}
234263
235- .alert-box {
236- margin-block-end : 2rem ;
237- }
238-
239264.page-content-right {
240265 display : grid ;
241266 gap : 2rem ;
0 commit comments