File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1313 import CreditCard from ' @lucide/svelte/icons/credit-card' ;
1414 import LogOut from ' @lucide/svelte/icons/log-out' ;
1515 import Sparkles from ' @lucide/svelte/icons/sparkles' ;
16+ import { useClerkContext } from ' svelte-clerk' ;
1617
1718 type Props = {
1819 user: NavUser ;
1920 };
2021
2122 let { user }: Props = $props ();
23+ const { clerk } = useClerkContext ();
2224 const sidebar = useSidebar ();
25+
26+ const logout = () => {
27+ if (! clerk ) return ;
28+ clerk .signOut ();
29+ };
2330 </script >
2431
2532<Sidebar .Menu >
8693 </DropdownMenu .Group >
8794 <DropdownMenu .Separator />
8895 <DropdownMenu .Item >
89- <LogOut />
90- Log out
96+ <button onclick ={logout } class =" flex items-center gap-2" >
97+ <LogOut />
98+ Log out
99+ </button >
91100 </DropdownMenu .Item >
92101 </DropdownMenu .Content >
93102 </DropdownMenu .Root >
You can’t perform that action at this time.
0 commit comments