Fix naming and add update to site provider?

This commit is contained in:
Owen Schwartz
2024-10-19 12:48:07 -04:00
parent edde7a247a
commit 474bc7997e
10 changed files with 238 additions and 23 deletions

View File

@@ -1,7 +1,10 @@
import { SiteContext } from "@app/contexts/siteContext";
import SiteContext from "@app/contexts/siteContext";
import { useContext } from "react";
export function useSiteContext() {
const site = useContext(SiteContext);
return site;
}
const context = useContext(SiteContext);
if (context === undefined) {
throw new Error('useSiteContext must be used within a SiteProvider');
}
return context;
}