cambios
This commit is contained in:
1 parent
794a659369
commit
5f99b65611
349 files changed
+32252
-2180
No files matched your search
@@ -0,0 +1,23 @@
|
||||
'use client';
|
||||
import { createContext, useContext, useState } from 'react';
|
||||
import { ContactModal } from '@/app/(landing)/components/ContactModal';
|
||||
import { useIsDark } from '@/app/(landing)/hooks/useIsDark';
|
||||
|
||||
interface ContactCtx {
|
||||
open: () => void;
|
||||
}
|
||||
|
||||
const ContactContext = createContext<ContactCtx>({ open: () => {} });
|
||||
|
||||
export const ContactProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const isDark = useIsDark();
|
||||
return (
|
||||
<ContactContext.Provider value={{ open: () => setIsOpen(true) }}>
|
||||
{children}
|
||||
<ContactModal isOpen={isOpen} onClose={() => setIsOpen(false)} isNavyBg={isDark} />
|
||||
</ContactContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export const useContact = () => useContext(ContactContext);
|
||||
Reference in new issue
Block a user