mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 08:23:35 +00:00
Merge branch 'main' into walletStack
# Conflicts: # AGENTS.md # package-lock.json # package.json # src/App.tsx # src/AppRouter.tsx
This commit is contained in:
commit
47492df00e
63 files changed
+12008
-1299
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { createContext, useContext, ReactNode } from 'react';
|
||||
import { useCashu as useCashuHook, type UseCashuReturn } from '@/hooks/wallet/useCashu';
|
||||
|
||||
const CashuContext = createContext<UseCashuReturn | null>(null);
|
||||
|
||||
export function CashuProvider({ children }: { children: ReactNode }) {
|
||||
const cashu = useCashuHook();
|
||||
|
||||
return (
|
||||
<CashuContext.Provider value={cashu}>
|
||||
{children}
|
||||
</CashuContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export function useCashuContext(): UseCashuReturn {
|
||||
const context = useContext(CashuContext);
|
||||
|
||||
if (!context) {
|
||||
throw new Error('useCashuContext must be used within a CashuProvider');
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
Reference in new issue
Block a user