@@ -5,17 +5,16 @@ import {
55import { useRoute , useRouter } from ' vue-router' ;
66import { useI18n } from ' vue-i18n' ;
77import { storeToRefs } from ' pinia' ;
8- import { PrimaryButton , LinkButton } from ' @thunderbirdops/services-ui' ;
8+ import { PrimaryButton , LinkButton , NoticeBar , NoticeBarTypes , IconButton } from ' @thunderbirdops/services-ui' ;
99import { enumToObject } from ' @/utils' ;
1010import { callKey } from ' @/keys' ;
11- import { SettingsSections , AlertSchemes , ColourSchemes } from ' @/definitions' ;
11+ import { SettingsSections , ColourSchemes } from ' @/definitions' ;
1212import { Alert , SubscriberResponse } from ' @/models' ;
13- import AlertBox from ' @/elements/AlertBox.vue' ;
1413import { useUserStore } from ' @/stores/user-store' ;
1514import { useCalendarStore } from ' @/stores/calendar-store' ;
1615import { useScheduleStore } from ' @/stores/schedule-store' ;
1716import { createSettingsStore } from ' @/stores/settings-store' ;
18- import { PhCaretRight } from ' @phosphor-icons/vue' ;
17+ import { PhCaretRight , PhX } from ' @phosphor-icons/vue' ;
1918
2019// Page sections
2120import AccountSettings from ' ./components/AccountSettings.vue' ;
@@ -196,7 +195,14 @@ async function onSaveChanges() {
196195 }
197196}
198197
198+ function clearNotices() {
199+ validationError .value = null ;
200+ saveSuccess .value = null ;
201+ }
202+
199203function onRevertChanges() {
204+ clearNotices ();
205+
200206 settingsStore .revertChanges ();
201207}
202208
@@ -227,20 +233,39 @@ export default {
227233 <h2 >{{ t('label.settings') }}</h2 >
228234 </header >
229235
230- <alert-box
231- class =" alert-box "
236+ <notice-bar
237+ class =" notice-bar "
232238 v-if =" validationError"
233- :alert =" validationError"
234- @close =" validationError = null"
235- />
239+ :type =" NoticeBarTypes.Critical"
240+ >
241+ {{ validationError.title }}
242+
243+ <template #cta >
244+ <icon-button
245+ @click =" clearNotices"
246+ :title =" t('label.close')"
247+ >
248+ <ph-x />
249+ </icon-button >
250+ </template >
251+ </notice-bar >
236252
237- <alert-box
238- class =" alert-box "
253+ <notice-bar
254+ class =" notice-bar "
239255 v-else-if =" saveSuccess"
240- :alert =" saveSuccess"
241- :scheme =" AlertSchemes.Success"
242- @close =" saveSuccess = null"
243- />
256+ :type =" NoticeBarTypes.Success"
257+ >
258+ {{ saveSuccess.title }}
259+
260+ <template #cta >
261+ <icon-button
262+ @click =" clearNotices"
263+ :title =" t('label.close')"
264+ >
265+ <ph-x />
266+ </icon-button >
267+ </template >
268+ </notice-bar >
244269
245270 <div class =" main-container" >
246271 <!-- sidebar navigation -->
@@ -310,7 +335,7 @@ section {
310335 margin-block-end : 2rem ;
311336}
312337
313- .alert-box {
338+ .notice-bar {
314339 margin-block-end : 2rem ;
315340}
316341
0 commit comments