From ea08864c2a68906228e428d55357a1587b9cd443 Mon Sep 17 00:00:00 2001 From: Benedek Kozma Date: Thu, 15 Feb 2024 15:34:41 +0100 Subject: [PATCH] Move custom.css linking to head to avoid FOUC --- src/components/filecontent.jsx | 10 ---------- src/pages/index.jsx | 12 ++---------- 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 src/components/filecontent.jsx diff --git a/src/components/filecontent.jsx b/src/components/filecontent.jsx deleted file mode 100644 index 1dd6266a2..000000000 --- a/src/components/filecontent.jsx +++ /dev/null @@ -1,10 +0,0 @@ -import useSWR from "swr"; - -export default function FileContent({ path, loadingValue, errorValue, emptyValue = "" }) { - const fetcher = (url) => fetch(url).then((res) => res.text()); - const { data, error, isLoading } = useSWR(`/api/config/${path}`, fetcher); - - if (error) return errorValue; - if (isLoading) return loadingValue; - return data || emptyValue; -} diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 4bf1d9a27..e283c8f85 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -11,7 +11,6 @@ import { serverSideTranslations } from "next-i18next/serverSideTranslations"; import { useRouter } from "next/router"; import Tab, { slugify } from "components/tab"; -import FileContent from "components/filecontent"; import ServicesGroup from "components/services/group"; import BookmarksGroup from "components/bookmarks/group"; import Widget from "components/widgets/widget"; @@ -391,17 +390,10 @@ function Home({ initialSettings }) { )} + + - -