added Basic Status Messages to GoogleAuth

This commit is contained in:
Samuel Andert
2023-07-21 15:16:07 +02:00
parent 207b154035
commit 081d052443
6 changed files with 88 additions and 52 deletions

View File

@ -1,10 +1,23 @@
<script>
import { messages } from '$lib/services/messages';
import { messages, createMessage } from '$lib/services/messages';
createMessage({
text: 'Component loaded',
sender: '$lib/components/Messages.svelte',
type: 'SYSTEM'
});
// Since messages is a store, we can subscribe to changes and store the latest messages in a variable
let latestMessages = [];
// Subscribe to the messages store to keep track of the latest messages
$: messages.subscribe((value) => {
latestMessages = value;
});
</script>
<main class="p-4 flex flex-col-reverse overflow-y-auto h-[calc(100vh-70px)]">
<!-- Your messages, displayed in chronological order -->
{#each $messages as message}
{#each latestMessages as message}
<div class="bg-white p-3 rounded-lg shadow-lg mb-2">
<div class="flex items-center justify-between">
<p class="text-sm text-gray-600">