Skip to content
Snippets Groups Projects
Commit fd3cecf5 authored by smr17's avatar smr17
Browse files

requisições prontas, carrosel quebrado

parent d031c544
No related branches found
No related tags found
1 merge request!1Develop
...@@ -31,19 +31,35 @@ const areaStyle={ ...@@ -31,19 +31,35 @@ const areaStyle={
minHeight: "150px" minHeight: "150px"
} }
class SubPages extends Component{ class ReqCards extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state = {
resources: [],
};
} }
getCards(){ componentWillMount(){
axios.get(`${apiUrl}/learning_objects`+ '?limit=12&sort=["published_at", "desc"]') axios.get(`${apiUrl}/learning_objects`+ '?limit=12&sort=["published_at", "desc"]')
.then(function(response){ .then(res=> {
console.log(response.data); this.setState({resources: res.data});
}); console.log(res.data);
});
} }
render(){
return(
<Row>
{this.state.resources.map(card => <Col md={3} sm={6} key={card.id}><MediaCard name={card.name} description={card.description}/></Col>)}
</Row>
)
}
}
class SubPages extends Component{
constructor(props){
super(props);
}
areaRender(){ areaRender(){
this.getCards();
switch(this.props.banner){ switch(this.props.banner){
case "Recursos": case "Recursos":
return( return(
...@@ -62,21 +78,14 @@ class SubPages extends Component{ ...@@ -62,21 +78,14 @@ class SubPages extends Component{
Recursos mais recentes </p> Recursos mais recentes </p>
<Hidden sm xs> <Hidden sm xs>
<Carousel showThumbs={false} autoPlay infiniteLoop={true} showStatus={false}> <Carousel showThumbs={false} autoPlay infiniteLoop={true} showStatus={false}>
<ReqCards/>
</Carousel> </Carousel>
</Hidden> </Hidden>
<Visible sm xs> <Visible sm xs>
<Carousel showThumbs={false} infiniteLoop={true} showStatus={false}> <Carousel showThumbs={false} infiniteLoop={true} showStatus={false}>
<Row justify="around" style={{paddingBottom: "50px"}} > <Row justify="around" style={{paddingBottom: "50px"}} >
{rows} <ReqCards/>
{rows}
</Row>
<Row justify="around" style={{paddingBottom: "50px"}} >
{rows}
{rows}
</Row>
<Row justify="around" style={{paddingBottom: "50px"}} >
{rows}
{rows}
</Row> </Row>
</Carousel> </Carousel>
</Visible> </Visible>
...@@ -137,7 +146,6 @@ class SubPages extends Component{ ...@@ -137,7 +146,6 @@ class SubPages extends Component{
return( return(
<div> <div>
{this.areaRender()} {this.areaRender()}
</div> </div>
); );
} }
......
...@@ -18,18 +18,16 @@ import thumbnail from "../img/girassol.jpg" ...@@ -18,18 +18,16 @@ import thumbnail from "../img/girassol.jpg"
// }, // },
// }; // };
function RecipeReviewCard() { function RecipeReviewCard(props){
// const classes = useStyles;
return ( return (
<Card> <Card>
<img src={thumbnail} alt="thumbnail do recurso"/> <img src={thumbnail} alt="thumbnail do recurso"/>
<CardContent > <CardContent >
<Typography variant="title" color="textSecondary" component="p"> <Typography variant="title" color="textSecondary" component="p">
Girassol {props.name}
</Typography> </Typography>
<Typography variant="caption" color="textSecondary" component="p"> <Typography variant="caption" color="textSecondary" component="p">
This impressive paella is a perfect party dish and a fun meal to cook together with your {props.description}
guests. Add 1 cup of frozen peas along with the mussels, if you like.
</Typography> </Typography>
</CardContent> </CardContent>
<CardActions> <CardActions>
......
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