From 5027bb30cca746913fa6a5fd456b4234b406ca3d Mon Sep 17 00:00:00 2001
From: rfhferreira <rfhferreira@inf.ufpr.br>
Date: Fri, 9 May 2025 11:20:10 -0300
Subject: [PATCH] HOTFIX: spinner on MEC page and Exit/About superposition

---
 src/app/components/InfiniteScroll.js      | 5 +++--
 src/app/components/InfiniteScrollCards.js | 7 ++++---
 src/app/components/SideBar.js             | 4 ++--
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/app/components/InfiniteScroll.js b/src/app/components/InfiniteScroll.js
index edee4e2a..a92b40dd 100644
--- a/src/app/components/InfiniteScroll.js
+++ b/src/app/components/InfiniteScroll.js
@@ -31,6 +31,7 @@ const getUrlFromFilterState = (filterState, page) => {
  */
 export default function InfiniteScroll({ filterState, setNewSize, newSize, setItems, items, abortController }) {
   const [isLoading, setIsLoading] = useState(false);
+  const [mecLoading, setMecLoading] = useState(false);
   const [page, setPage] = useState(0);
   const [isScroll, setIsScroll] = useState(false)
   const router = useRouter();
@@ -105,7 +106,7 @@ export default function InfiniteScroll({ filterState, setNewSize, newSize, setIt
       <div className={`${isScroll ? " blur-sm" : ""}`}>
         {totalCount ?
 
-          <InfiniteScrollCards setNewSize={setNewSize} newSize={newSize} data={items} searchClass={filterState?.searchClass} />
+          <InfiniteScrollCards setMecLoading={setMecLoading} setNewSize={setNewSize} newSize={newSize} data={items} searchClass={filterState?.searchClass} />
           :
           <div className="flex justify-center text-2xl font-bold text-darkGray-HC-white mt-72 text-center">
             Desculpe, não encontramos nada.
@@ -115,7 +116,7 @@ export default function InfiniteScroll({ filterState, setNewSize, newSize, setIt
 
         }
       </div>
-      {isLoading &&
+      {(isLoading || !mecLoading) &&
         <Loading  scroll={isScroll} />
       }
     </>
diff --git a/src/app/components/InfiniteScrollCards.js b/src/app/components/InfiniteScrollCards.js
index e6dc6b29..f1717290 100644
--- a/src/app/components/InfiniteScrollCards.js
+++ b/src/app/components/InfiniteScrollCards.js
@@ -16,7 +16,7 @@ import ShareButton from "./ShareButton";
  * @param {boolean} props.newSize verifica se a tela teve o tamanho alterado
  * @returns renderixa na tela o conteúdo obtido pelo InfiniteScroll.js
  */
-export default function InfiniteScrollCards({ data, searchClass, setNewSize, newSize }) {
+export default function InfiniteScrollCards({ setMecLoading, data, searchClass, setNewSize, newSize }) {
     const [cardsPerRow, setCardsPerRow] = useState(0);
     const [mecCollection, setMecCollection] = useState([]);
     /**
@@ -39,17 +39,18 @@ export default function InfiniteScrollCards({ data, searchClass, setNewSize, new
     /**
      * get das coleções Oficiais do MEC
     */
+    useEffect(() => {
     const fetchCollections = async () => {
         try {
             const { data } = await mecredApi
                 .get("/users/35342/collections");
             setMecCollection([...data].reverse());
+            setMecLoading(false);
         } catch (error) {
             console.error(error);
         }
     };
 
-    useEffect(() => {
         fetchCollections();
     }, []);
 
@@ -205,4 +206,4 @@ export default function InfiniteScrollCards({ data, searchClass, setNewSize, new
             {returnContent(searchClass)}
         </div>
     )
-};
\ No newline at end of file
+};
diff --git a/src/app/components/SideBar.js b/src/app/components/SideBar.js
index dd6aeb78..2e2265f8 100644
--- a/src/app/components/SideBar.js
+++ b/src/app/components/SideBar.js
@@ -70,8 +70,8 @@ const acessoRapido = [
   {
     title: "Sair",
     icon: LogoutRounded,
-    href: "/sobre",
-    id: "sobre",
+    href: "/entrar",
+    id: "Sair",
   }
 ];
 
-- 
GitLab