- Upgrade Nx 22.1.1 → 22.6.3 and all patch/minor dependencies - Restructure shared libs: move business logic from utils to service - Consolidate shadcn-ui into ui lib with atomic design pattern - Fix container centering for landing app (Tailwind v4 compatibility) - Fix button styling by updating @source directive in globals.css - Fix SiCss3 → SiCss rename in react-icons 5.6 - Fix duplicate useSession export conflict - Remove dead code, comments, and unused files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
31 lines
793 B
TypeScript
31 lines
793 B
TypeScript
'use client';
|
|
|
|
import { createContext, ReactNode, useContext, useState } from 'react';
|
|
|
|
interface ModalLoginContextType {
|
|
showModalLogin: boolean;
|
|
setShowModalLogin: (value: boolean) => void;
|
|
}
|
|
|
|
const ModalLoginContext = createContext<ModalLoginContextType | undefined>(
|
|
undefined
|
|
);
|
|
|
|
export const ModalLoginProvider = ({ children }: { children: ReactNode }) => {
|
|
const [showModalLogin, setShowModalLogin] = useState(false);
|
|
|
|
return (
|
|
<ModalLoginContext.Provider value={{ showModalLogin, setShowModalLogin }}>
|
|
{children}
|
|
</ModalLoginContext.Provider>
|
|
);
|
|
};
|
|
|
|
export const useModalLogin = () => {
|
|
const context = useContext(ModalLoginContext);
|
|
if (!context) {
|
|
throw new Error('useModalLogin must be used within an ModalLoginProvider');
|
|
}
|
|
return context;
|
|
};
|