Build and type fixes

This commit is contained in:
Darren Clarke 2023-05-24 20:27:57 +00:00
parent d5bd58ac3e
commit 656f3fbe71
64 changed files with 1878 additions and 1501 deletions

View file

@ -17,9 +17,7 @@ import { LicenseInfo } from "@mui/x-data-grid-pro";
import { SWRConfig } from "swr";
import { GraphQLClient } from "graphql-request";
LicenseInfo.setLicenseKey(
"fd009c623acc055adb16370731be92e4T1JERVI6NDA3NTQsRVhQSVJZPTE2ODAyNTAwMTUwMDAsS0VZVkVSU0lPTj0x"
);
LicenseInfo.setLicenseKey(process.env.MUI_LICENSE_KEY);
const clientSideEmotionCache: any = createEmotionCache();
@ -28,15 +26,18 @@ interface LinkWebProps extends AppProps {
emotionCache?: EmotionCache;
}
const LinkWeb = (props: LinkWebProps) => {
export default function LinkWeb(props: LinkWebProps) {
const { Component, emotionCache = clientSideEmotionCache, pageProps } = props;
const [csrfToken, setCsrfToken] = useState("");
const origin = typeof window !== 'undefined' && window.location.origin
? window.location.origin : null;
const origin =
typeof window !== "undefined" && window.location.origin
? window.location.origin
: null;
const client = new GraphQLClient(`${origin}/graphql`, {
headers: {
"Content-Type": "application/json",
"Accept": "application/json",
Accept: "application/json",
},
});
const graphQLFetcher = async ({ document, variables }: any) => {
@ -49,7 +50,7 @@ const LinkWeb = (props: LinkWebProps) => {
requestHeaders
);
const token = headers.get('CSRF-Token');
const token = headers.get("CSRF-Token");
setCsrfToken(token);
return data;
@ -67,6 +68,4 @@ const LinkWeb = (props: LinkWebProps) => {
</CacheProvider>
</SessionProvider>
);
};
export default LinkWeb;
}