Add selectedDate to test2 page

This commit is contained in:
qowevisa 2024-11-14 20:35:45 +02:00
parent a790150536
commit 9cd5286163

View File

@ -1,7 +1,11 @@
<script> <script lang="ts">
import ColorPicker from "$lib/components/ColorPicker.svelte";
import { addSuccessToast } from "$lib/components/store"; import { addSuccessToast } from "$lib/components/store";
import Toasts from "$lib/components/Toasts.svelte"; import Toasts from "$lib/components/Toasts.svelte";
import { selectedDate } from "$lib/stores/dateStore";
let { data } = $props(); let { data } = $props();
let selectedColor = $state("#ff0000");
function testNotification() { function testNotification() {
console.log("Tested!"); console.log("Tested!");
@ -20,6 +24,10 @@
async function test3() { async function test3() {
console.log(data); console.log(data);
} }
function handleColorChange(event: CustomEvent) {
selectedColor = event.detail;
}
</script> </script>
<Toasts /> <Toasts />
@ -43,4 +51,8 @@
> >
Click Me3! Click Me3!
</button> </button>
<ColorPicker on:change={handleColorChange} borderRadius="50%" />
<p>Selected color: {selectedColor}</p>
<h1>Selected Date</h1>
<p>The date you selected in the navbar is: {$selectedDate}</p>
</div> </div>