- add messages

This commit is contained in:
2023-07-28 14:16:58 +02:00
parent af3aa905bd
commit d47c719d13
3 changed files with 37 additions and 20 deletions

View File

@@ -1,5 +1,10 @@
<script setup>
defineProps({
messages: {
type: Object,
default: {},
}
});
</script>
<style lang="css" scoped>
@@ -27,6 +32,15 @@
</nav>
</div>
</header>
<div v-if="messages?.info" class="max-w-screen-lg mx-2 lg:mx-auto mt-2 px-2 py-3 rounded-md bg-yellow-100 text-yellow-600 text-center">
{{ messages.info }}
</div>
<div v-if="messages?.error" class="max-w-screen-lg mx-2 lg:mx-auto mt-2 px-2 py-3 rounded-md bg-red-100 text-red-600 text-center">
{{ messages.error }}
</div>
<div v-if="messages?.success" class="max-w-screen-lg mx-2 lg:mx-auto mt-2 px-2 py-3 rounded-md bg-green-100 text-green-600 text-center">
{{ messages?.success }}
</div>
<main class="max-w-screen-lg mx-2 lg:mx-auto mt-2 rounded-md bg-gray-50">
<slot />
</main>

View File

@@ -17,21 +17,20 @@ defineProps({
<li
v-for="(project, key) in projects"
:key="key"
class="flex items-center justify-between px-3 py-2 bg-white hover:bg-neutral-200"
>
<div class="flex items-center justify-between px-3 py-2 bg-white hover:bg-neutral-200">
<InertiaLink :href="`/dashboard/project/${project.id}`">{{ project.title }}</InertiaLink>
<div class="flex items-center gap-2">
<InertiaLink
as="button"
class="px-2 py-1 text-lime-600 hover:text-lime-800 border-t-2 border-b-2 border-transparent hover:border-b-lime-600"
:href="`/dashboard/project/${project.id}`"
title="Edytuj projekt"><FontAwesomeIcon :icon="['fas', 'pen-to-square']" /></InertiaLink>
<InertiaLink
as="button"
class="px-2 py-1 text-red-600 hover:text-red-800"
:href="`/dashboard/project/${project.id}/delete`"
title="Usuń projekt z listy"><FontAwesomeIcon :icon="['fas', 'trash']" /></InertiaLink>
</div>
<InertiaLink :href="`/dashboard/project/${project.id}`">{{ project.title }}</InertiaLink>
<div class="flex items-center gap-2">
<InertiaLink
as="button"
class="px-2 py-1 text-lime-600 hover:text-lime-800 border-t-2 border-b-2 border-transparent hover:border-b-lime-600"
:href="`/dashboard/project/${project.id}`"
title="Edytuj projekt"><FontAwesomeIcon :icon="['fas', 'pen-to-square']" /></InertiaLink>
<InertiaLink
as="button"
class="px-2 py-1 text-red-600 hover:text-red-800"
:href="`/dashboard/project/${project.id}/delete`"
title="Usuń projekt z listy"><FontAwesomeIcon :icon="['fas', 'trash']" /></InertiaLink>
</div>
</li>
</ul>