Skip to content

Commit a92bcbc

Browse files
committed
Merge branch 'master' of github.com:connorabbas/laravel-primevue-starter-kit into feature/sidebar-toggle
2 parents 4fce0d0 + fa7a9bf commit a92bcbc

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

resources/css/app.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ body {
2020
.lucide {
2121
width: 16px;
2222
height: 16px;
23+
flex-shrink: 0;
2324
}

resources/js/components/FlashMessages.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@
22
import { ref, watch } from 'vue'
33
import { usePage } from '@inertiajs/vue3'
44
import { Check, CircleX, Info, TriangleAlert, Megaphone } from 'lucide-vue-next'
5+
import { FlashProps } from '@/types'
56
67
const page = usePage()
78
const flashed = ref(0)
89
10+
const clearFlash = (type: keyof FlashProps) => {
11+
if (page.props.flash?.[type]) {
12+
page.props.flash[type] = null
13+
}
14+
}
15+
916
watch(() => page.props.flash, () => {
1017
flashed.value++
1118
}, { deep: true })
@@ -21,6 +28,7 @@ watch(() => page.props.flash, () => {
2128
class="mb-6"
2229
severity="success"
2330
closable
31+
@close="clearFlash('success')"
2432
>
2533
<template #icon>
2634
<Check />
@@ -32,6 +40,7 @@ watch(() => page.props.flash, () => {
3240
class="mb-6"
3341
severity="info"
3442
closable
43+
@close="clearFlash('info')"
3544
>
3645
<template #icon>
3746
<Info />
@@ -43,6 +52,7 @@ watch(() => page.props.flash, () => {
4352
class="mb-6"
4453
severity="warn"
4554
closable
55+
@close="clearFlash('warn')"
4656
>
4757
<template #icon>
4858
<TriangleAlert />
@@ -54,6 +64,7 @@ watch(() => page.props.flash, () => {
5464
class="mb-6"
5565
severity="error"
5666
closable
67+
@close="clearFlash('error')"
5768
>
5869
<template #icon>
5970
<CircleX />
@@ -65,6 +76,7 @@ watch(() => page.props.flash, () => {
6576
class="mb-6"
6677
severity="secondary"
6778
closable
79+
@close="clearFlash('message')"
6880
>
6981
<template #icon>
7082
<Megaphone />

0 commit comments

Comments
 (0)