Skip to content

Commit f96b674

Browse files
committed
Fix Settings NoticeBar styles
1 parent f9e57e8 commit f96b674

File tree

2 files changed

+47
-19
lines changed

2 files changed

+47
-19
lines changed

frontend/src/views/AvailabilityView/index.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,13 @@ async function onSaveChanges() {
110110
})
111111
}
112112
113-
function onRevertChanges() {
113+
function clearNotices() {
114114
validationError.value = null;
115115
saveSuccess.value = null;
116+
}
116117
118+
function onRevertChanges() {
119+
clearNotices();
117120
availabilityStore.revertChanges();
118121
}
119122
</script>
@@ -166,7 +169,7 @@ export default {
166169

167170
<template #cta>
168171
<icon-button
169-
@click="validationError = null"
172+
@click="clearNotices"
170173
:title="t('label.close')"
171174
class="btn-close"
172175
>
@@ -184,7 +187,7 @@ export default {
184187

185188
<template #cta>
186189
<icon-button
187-
@click="saveSuccess = null"
190+
@click="clearNotices"
188191
:title="t('label.close')"
189192
class="btn-close"
190193
>

frontend/src/views/SettingsView/index.vue

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@ import {
55
import { useRoute, useRouter } from 'vue-router';
66
import { useI18n } from 'vue-i18n';
77
import { storeToRefs } from 'pinia';
8-
import { PrimaryButton, LinkButton } from '@thunderbirdops/services-ui';
8+
import { PrimaryButton, LinkButton, NoticeBar, NoticeBarTypes, IconButton } from '@thunderbirdops/services-ui';
99
import { enumToObject } from '@/utils';
1010
import { callKey } from '@/keys';
11-
import { SettingsSections, AlertSchemes, ColourSchemes } from '@/definitions';
11+
import { SettingsSections, ColourSchemes } from '@/definitions';
1212
import { Alert, SubscriberResponse } from '@/models';
13-
import AlertBox from '@/elements/AlertBox.vue';
1413
import { useUserStore } from '@/stores/user-store';
1514
import { useCalendarStore } from '@/stores/calendar-store';
1615
import { useScheduleStore } from '@/stores/schedule-store';
1716
import { createSettingsStore } from '@/stores/settings-store';
18-
import { PhCaretRight } from '@phosphor-icons/vue';
17+
import { PhCaretRight, PhX } from '@phosphor-icons/vue';
1918
2019
// Page sections
2120
import 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+
199203
function 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

Comments
 (0)