Skip to content
Snippets Groups Projects
Commit 6f23caa6 authored by lfr20's avatar lfr20
Browse files

its not static informations anymore

parent ee5f5f18
No related branches found
No related tags found
6 merge requests!57Merge of develop into master,!56Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...,!39Update admin system,!32Homologa,!31Fix console error,!27Training materials
...@@ -16,7 +16,7 @@ GNU Affero General Public License for more details. ...@@ -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 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/>.*/ along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>.*/
import React, { Component } from "react"; import React, { Component, useState } from "react";
import axios from "axios"; import axios from "axios";
import { apiUrl } from "../env"; import { apiUrl } from "../env";
import "./carousel.css"; import "./carousel.css";
...@@ -30,6 +30,10 @@ import colecoes from "../img/ilustra_colecoes.png"; ...@@ -30,6 +30,10 @@ import colecoes from "../img/ilustra_colecoes.png";
import Grid from "@material-ui/core/Grid"; import Grid from "@material-ui/core/Grid";
import ResourceCardFunction from "./ResourceCardFunction.js"; import ResourceCardFunction from "./ResourceCardFunction.js";
import CollectionCardFunction from "./CollectionCardFunction.js"; import CollectionCardFunction from "./CollectionCardFunction.js";
import colecoes_obj from './FormationMaterialsResources/formationMaterials';
import ExpandedMaterial from './ExpandedMaterials';
const materials = colecoes_obj();
const areaStyle = { const areaStyle = {
paddingTop: "5px", paddingTop: "5px",
...@@ -60,6 +64,7 @@ class ReqResources extends Component { ...@@ -60,6 +64,7 @@ class ReqResources extends Component {
var row1 = this.state.resources.slice(0, 4); var row1 = this.state.resources.slice(0, 4);
var row2 = this.state.resources.slice(4, 8); var row2 = this.state.resources.slice(4, 8);
var row3 = this.state.resources.slice(8, 13); var row3 = this.state.resources.slice(8, 13);
return ( return (
<Carousel showThumbs={false} infiniteLoop={true} showStatus={false}> <Carousel showThumbs={false} infiniteLoop={true} showStatus={false}>
<Row style={{ paddingBottom: "5px" }}> <Row style={{ paddingBottom: "5px" }}>
...@@ -206,6 +211,16 @@ class ReqCollections extends Component { ...@@ -206,6 +211,16 @@ class ReqCollections extends Component {
} }
class SubPages extends Component { class SubPages extends Component {
constructor(props) {
super(props);
this.state = {
currMaterial: {
open: false,
material: {}
},
};
}
areaRender() { areaRender() {
switch (this.props.banner) { switch (this.props.banner) {
case "Recursos": case "Recursos":
...@@ -254,6 +269,19 @@ class SubPages extends Component { ...@@ -254,6 +269,19 @@ class SubPages extends Component {
</React.Fragment> </React.Fragment>
); );
case "Materiais": case "Materiais":
const HandleExpandMaterial = (id) => {
console.log(id);
this.setState({
currMaterial: {
open: !this.state.currMaterial.open,
material: { ...materials[id] }
}
})
console.log(this.state.currMaterial)
}
return ( return (
<React.Fragment> <React.Fragment>
<div style={{ backgroundColor: "#e81f4f" }}> <div style={{ backgroundColor: "#e81f4f" }}>
...@@ -297,22 +325,32 @@ class SubPages extends Component { ...@@ -297,22 +325,32 @@ class SubPages extends Component {
showStatus={false} showStatus={false}
> >
<Row> <Row>
<Col md={3}> {
<MaterialCard name="oioi" /> materials.map((material, index) => {
</Col> return (
<Col md={3}> <Col md={3} key={index}>
<MaterialCard name="oioi" /> <MaterialCard
</Col> name={material.name}
<Col md={3}> thumb={material.img}
<MaterialCard name="oioi" /> score={material.score}
</Col> modules={material.topics}
<Col md={3}> handleExpand={HandleExpandMaterial}
<MaterialCard name="oioi" /> id={index}
</Col> />
</Col>
)
})
}
</Row> </Row>
</Carousel> </Carousel>
{
this.state.currMaterial.open ?
<ExpandedMaterial material={this.state.currMaterial.material}/>
:
null
}
</Container> </Container>
</React.Fragment> </React.Fragment >
); );
case "Colecoes": case "Colecoes":
return ( return (
...@@ -362,4 +400,6 @@ class SubPages extends Component { ...@@ -362,4 +400,6 @@ class SubPages extends Component {
return <div>{this.areaRender()}</div>; return <div>{this.areaRender()}</div>;
} }
} }
export default SubPages; export default SubPages;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment