From 3dda9266626bcbc6df6a8e5c117ddc1313ca046e Mon Sep 17 00:00:00 2001
From: Luis Felipe Risch <lfr20@inf.ufpr.br>
Date: Thu, 28 Jan 2021 10:14:51 -0300
Subject: [PATCH] Nothing changed

---
 src/Components/AreasSubPages.js | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/src/Components/AreasSubPages.js b/src/Components/AreasSubPages.js
index 9af843fa..62c00389 100644
--- a/src/Components/AreasSubPages.js
+++ b/src/Components/AreasSubPages.js
@@ -16,7 +16,7 @@ GNU Affero General Public License for more details.
 You should have received a copy of the GNU Affero General Public License
 along with Plataforma Integrada MEC.  If not, see <http://www.gnu.org/licenses/>.*/
 
-import React, { Component, useState } from "react";
+import React, { Component } from "react";
 import axios from "axios";
 import { apiUrl } from "../env";
 import "./carousel.css";
@@ -32,6 +32,8 @@ import ResourceCardFunction from "./ResourceCardFunction.js";
 import CollectionCardFunction from "./CollectionCardFunction.js";
 import colecoes_obj from './FormationMaterialsResources/formationMaterials';
 import ExpandedMaterial from './ExpandedMaterials';
+import Zoom from '@material-ui/core/Zoom';
+
 
 const materials = colecoes_obj();
 
@@ -271,14 +273,20 @@ class SubPages extends Component {
       case "Materiais":
 
         const HandleExpandMaterial = (id) => {
-          console.log(id);
-          this.setState({
-            currMaterial: {
-              open: !this.state.currMaterial.open,
-              material: { ...materials[id] }
-            }
-          })
-          console.log(this.state.currMaterial)
+          if (id !== this.state.currMaterial.material.id)
+            this.setState({
+              currMaterial: {
+                open: true,
+                material: { ...materials[id] }
+              }
+            })
+          else
+            this.setState({
+              currMaterial: {
+                open: false,
+                material: {}
+              }
+            })
         }
 
 
@@ -345,7 +353,7 @@ class SubPages extends Component {
               </Carousel>
               {
                 this.state.currMaterial.open ?
-                  <ExpandedMaterial material={this.state.currMaterial.material}/>
+                  <ExpandedMaterial material={this.state.currMaterial.material} />
                   :
                   null
               }
-- 
GitLab