fix typings and edge config key issue

This commit is contained in:
Sara
2023-11-01 13:48:32 +01:00
committed by Mathieu Virbel
parent 2847ee177b
commit 7ca152992c
6 changed files with 58 additions and 35 deletions

View File

@@ -11,6 +11,7 @@ import About from "../(aboutAndPrivacy)/about";
import Privacy from "../(aboutAndPrivacy)/privacy";
import { get } from "@vercel/edge-config";
import { DomainContextProvider } from "./domainContext";
import { getConfig } from "../lib/edgeConfig";
const poppins = Poppins({ subsets: ["latin"], weight: ["200", "400", "600"] });
@@ -68,10 +69,8 @@ type LayoutProps = {
};
export default async function RootLayout({ children, params }: LayoutProps) {
const config = await get(params.domain);
const requireLogin = config ? config["features"]["requireLogin"] : false;
const privacy = config ? config["features"]["privacy"] : true;
const browse = config ? config["features"]["browse"] : true;
const config = await getConfig(params.domain);
const { requireLogin, privacy, browse } = config.features;
return (
<html lang="en">