From 3352727aa638fcfcc6461d2aaded8ef9603acc0d Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Tue, 4 Oct 2022 00:04:19 +0800
Subject: feat: Initial setup facilitating testing

---
 apps/kit/src/lib/components/switch.svelte | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'apps/kit/src/lib/components/switch.svelte')

diff --git a/apps/kit/src/lib/components/switch.svelte b/apps/kit/src/lib/components/switch.svelte
index c958b0f..16da23a 100644
--- a/apps/kit/src/lib/components/switch.svelte
+++ b/apps/kit/src/lib/components/switch.svelte
@@ -3,12 +3,17 @@
 </script>
 
 <script lang="ts">
+    import pwKey from "$actions/pwKey";
+
+
     export let enabled = false;
     export let type: SwitchType = "default";
     export let srText = "Use setting";
     export let label: string | undefined = undefined;
     export let description: string | undefined = undefined;
     export let rightAlignedLabelDescription = false;
+    export let _pwKey:string|undefined = undefined;
+
     $: colorClass = enabled
         ? "bg-teal-600 focus:ring-teal-500"
         : "bg-gray-200 focus:ring-teal-500";
@@ -41,6 +46,7 @@
             class="group relative inline-flex h-5 w-10 flex-shrink-0 cursor-pointer items-center justify-center rounded-full focus:outline-none focus:ring-2 focus:ring-offset-2"
             role="switch"
             aria-checked={enabled}
+            use:pwKey={_pwKey}
             on:click={toggle}
         >
             <span class="sr-only">{srText}</span>
@@ -63,6 +69,7 @@
             class="{colorClass} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2"
             role="switch"
             aria-checked={enabled}
+            use:pwKey={_pwKey}
             on:click={toggle}
         >
             <span class="sr-only">{srText}</span>
@@ -113,6 +120,7 @@
             class="{colorClass} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2"
             role="switch"
             aria-checked={enabled}
+            use:pwKey={_pwKey}
             on:click={toggle}
         >
             <span class="sr-only">{srText}</span>
-- 
cgit v1.3

