From 60c49f18389ff625177a57277ef8f292a31097bf Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Sat, 28 Oct 2023 17:12:58 +0200
Subject: refactor(providers,hooks): rewrite PrismThemeProvider & usePrismTheme

* reuse Theme provider logic
* move DOM mutation from provider to hook
* add a script to init theme before page load
---
 src/utils/hooks/use-query-selector-all.tsx | 22 ----------------------
 1 file changed, 22 deletions(-)
 delete mode 100644 src/utils/hooks/use-query-selector-all.tsx

(limited to 'src/utils/hooks/use-query-selector-all.tsx')

diff --git a/src/utils/hooks/use-query-selector-all.tsx b/src/utils/hooks/use-query-selector-all.tsx
deleted file mode 100644
index a3650ea..0000000
--- a/src/utils/hooks/use-query-selector-all.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import { useRouter } from 'next/router';
-import { useEffect, useState } from 'react';
-
-/**
- * Use `document.querySelectorAll`.
- *
- * @param {string} query - A query.
- * @returns {NodeListOf<HTMLElementTagNameMap[T]|undefined>} - The node list.
- */
-export const useQuerySelectorAll = <T extends keyof HTMLElementTagNameMap>(
-  query: string
-): NodeListOf<HTMLElementTagNameMap[T]> | undefined => {
-  const [elements, setElements] =
-    useState<NodeListOf<HTMLElementTagNameMap[T]>>();
-  const { asPath } = useRouter();
-
-  useEffect(() => {
-    setElements(document.querySelectorAll(query));
-  }, [asPath, query]);
-
-  return elements;
-};
-- 
cgit v1.2.3

