Skip to content

Commit

Permalink
- Mise en place de la barre d'informations
Browse files Browse the repository at this point in the history
  • Loading branch information
jvk88511334 committed Sep 3, 2024
1 parent 0542457 commit 68010f3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
<Header @logout-success="onLogout" @toggle-drawer="toggleDrawer"/>
<Navbar :drawer="drawer" @close="drawer = false"/>
<v-main>
<div class="info-stack">
<Infobar v-if="showInfoBar" :message="infoBarMessage" />
</div>
<div class="error-stack">
<v-alert
v-for="(error, index) in errorStack"
Expand Down Expand Up @@ -32,20 +35,22 @@
</template>

<script setup>
import {onBeforeMount, onMounted, ref} from 'vue';
import {onMounted, ref} from 'vue';
import Header from '@/components/Structure/Header.vue'
import Navbar from '@/components/Structure/Navbar.vue'
import Footer from '@/components/Structure/Footer.vue'
import Infobar from '@/components/Structure/Infobar.vue'
import router from '@/router/index'
import {HttpStatusCode} from 'axios'
import {useTheme} from "vuetify";
const errorStack = ref([])
const drawer = ref(false)
const theme = useTheme()
const showInfoBar = ref(true)
const infoBarMessage = ref('Bienvenue sur notre application !')
onMounted(() => {
theme.global.name.value = localStorage.getItem('theme')
})
Expand Down Expand Up @@ -127,6 +132,15 @@ function toggleDrawer() {
padding: 10px;
}
.info-stack {
position: fixed;
top: 64px; /* Ajustez cette valeur en fonction de la hauteur de votre barre de navigation */
left: 0;
right: 0;
z-index: 100;
padding: 10px;
}
.custom-alert {
background-color: #FFEBEE !important; /* Fond rouge clair */
color: #B71C1C !important; /* Texte rouge foncé */
Expand Down
27 changes: 27 additions & 0 deletions src/components/Structure/Infobar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<template>
<v-alert
color="debug"
icon="mdi-information"
:title="title"
variant="flat"
border="start"
class="mb-2 custom-infobar"
>
{{ message }}
</v-alert>
</template>

<script setup>
import {defineProps, defineEmits} from 'vue';
const props = defineProps({
message: {
type: String,
default: 'Information importante'
},
title: {
type: String,
default: 'Information importante aux utilisateurs'
}
});
</script>

0 comments on commit 68010f3

Please sign in to comment.