From 845556262fcf5f70dbb4495484d56db128abf79f Mon Sep 17 00:00:00 2001
From: Vinicius Gabriel Machado <vgm18@inf.ufpr.br>
Date: Tue, 8 Jun 2021 14:54:29 -0300
Subject: [PATCH] Fixing bugs reported in the worksheet from 21/05

---
 src/Components/CollectionCardFunction.js | 6 +++---
 src/Components/MenuBar.js                | 8 ++++++++
 src/Components/MobileDrawerMenu.js       | 8 ++++++++
 src/Pages/ResourcePage.js                | 2 +-
 src/Pages/Search.js                      | 2 +-
 5 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/src/Components/CollectionCardFunction.js b/src/Components/CollectionCardFunction.js
index ccfb8783..dd4e3d07 100644
--- a/src/Components/CollectionCardFunction.js
+++ b/src/Components/CollectionCardFunction.js
@@ -207,11 +207,11 @@ export default function CollectionCardFunction(props) {
                       <span className={"col-name"}>{name}</span>
                     </UserAndTitle>
                   </UserInfo>
-                  <StyledGrid container direction="row" style={{ width: '272.5px'}}>
+                  <StyledGrid container direction="row" style={{ width: '272.5px' }}>
                     {
                       props.thumbnails.map((thumb) =>
-                        <Grid item xs={props.thumbnails <= 4 && props.thumbnails > 0 ? 12 / props.thumbnails.length : 6}>
-                          <div style={{ backgroundImage: `url(${`${apiDomain}` + thumb})`, height: "100%", width: "100%", backgroundSize: "cover", backgroundPosition: "center" }} />
+                        <Grid item xs={props.thumbnails.length <= 3 && props.thumbnails.length > 0 ? 12 / props.thumbnails.length : 6}>
+                          <div style={{ backgroundImage: `url(${`${apiDomain}` + thumb})`, height: `${props.thumbnails.length <= 3 ? '230px' : '100%'}`, width: "100%", backgroundSize: "cover", backgroundPosition: "center" }} />
                         </Grid>
                       )
                     }
diff --git a/src/Components/MenuBar.js b/src/Components/MenuBar.js
index cd5cb4d2..c79d52b6 100644
--- a/src/Components/MenuBar.js
+++ b/src/Components/MenuBar.js
@@ -127,6 +127,14 @@ export default function MenuBar(props) {
           href: "/admin/home",
           value: '6',
         })
+
+      const canUserCurator = (elem) => elem.id === 4
+      if (userRoles.some(canUserCurator))
+        minhaArea.push({
+          name: "Curadoria",
+          href: "/perfil",
+          value: '5',
+        })
     }
 
     return minhaArea;
diff --git a/src/Components/MobileDrawerMenu.js b/src/Components/MobileDrawerMenu.js
index ef63cc87..f99498f2 100644
--- a/src/Components/MobileDrawerMenu.js
+++ b/src/Components/MobileDrawerMenu.js
@@ -65,6 +65,14 @@ export default function MobileDrawerMenu(props) {
                     href: "/admin/home",
                     value: '6',
                 })
+
+            const canUserCurator = (elem) => elem.id === 4
+            if (userRoles.some(canUserCurator))
+                minhaArea.push({
+                    name: "Curadoria",
+                    href: "/perfil",
+                    value: '5',
+                })
         }
 
         return minhaArea;
diff --git a/src/Pages/ResourcePage.js b/src/Pages/ResourcePage.js
index de617c87..4fdc717e 100644
--- a/src/Pages/ResourcePage.js
+++ b/src/Pages/ResourcePage.js
@@ -291,7 +291,7 @@ export default function LearningObjectPage(props) {
                         createdAt={recurso.created_at}
                         updatedAt={recurso.updated_at}
                         license={recurso.license}
-                        followed={recurso.publisher.followed}
+                        followed={recurso.publisher ? recurso.publisher.followed : undefined}
                       />
                     </Card>
                   </Grid>
diff --git a/src/Pages/Search.js b/src/Pages/Search.js
index df731561..ae699d2a 100644
--- a/src/Pages/Search.js
+++ b/src/Pages/Search.js
@@ -143,7 +143,7 @@ export default function Search(props) {
 
   useEffect(() => {
     if (resultsPerPage > 12) {
-      setIsLoading(true);
+      //setIsLoading(true);
       collectStuff(option);
     }
   }, [resultsPerPage]);
-- 
GitLab