an app to share curated trails sidetrail.app
1

Configure Feed

Select the types of activity you want to include in your feed.

at main 624 B View raw
1"use client"; 2 3import { createContext, useContext, ReactNode } from "react"; 4 5type AuthContextType = { 6 didPromise: Promise<string | null>; 7}; 8 9const AuthContext = createContext<AuthContextType | null>(null); 10 11export function AuthProvider({ 12 children, 13 didPromise, 14}: { 15 children: ReactNode; 16 didPromise: Promise<string | null>; 17}) { 18 return <AuthContext.Provider value={{ didPromise }}>{children}</AuthContext.Provider>; 19} 20 21export function useAuthContext() { 22 const context = useContext(AuthContext); 23 if (!context) { 24 throw new Error("useLoginModal must be used within a AuthProvider"); 25 } 26 return context; 27}