Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions apps/website/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ import { LinksSectionDetails, LinksSections } from "@/common/pagesList";
import Link from "next/link";
import StatusBadge from "@/common/StatusBadge";
import "../global-styles.css";
import createCache from "@emotion/cache";
import createCache, { EmotionCache } from "@emotion/cache";
import { CacheProvider } from "@emotion/react";

type NextPageWithLayout = NextPage & {
getLayout?: (_page: ReactElement) => ReactNode;
};
type AppPropsWithLayout = AppProps & {
Component: NextPageWithLayout;
emotionCache?: EmotionCache;
};

const clientSideEmotionCache = createCache({ key: "css", prepend: true });

export default function App({ Component, pageProps }: AppPropsWithLayout) {
export default function App({ Component, pageProps, emotionCache = clientSideEmotionCache }: AppPropsWithLayout) {
const getLayout = Component.getLayout || ((page) => page);
const componentWithLayout = getLayout(<Component {...pageProps} />);
const [filter, setFilter] = useState("");
Expand All @@ -47,7 +48,7 @@ export default function App({ Component, pageProps }: AppPropsWithLayout) {
};

return (
<CacheProvider value={clientSideEmotionCache}>
<CacheProvider value={emotionCache}>
<Head>
<link rel="icon" type="image/png" sizes="32x32" href="/favicon.png" />
</Head>
Expand Down