From 6b5ee202dc857d2d7fe9c491b5d38c39397429ae Mon Sep 17 00:00:00 2001
From: "Henrique V. Ehrenfried" <hvehrenfried@inf.ufpr.br>
Date: Wed, 27 Jan 2021 10:06:20 -0300
Subject: [PATCH] Fix statistics bar and iframe in AboutPage

Signed-off-by: Henrique V. Ehrenfried <hvehrenfried@inf.ufpr.br>
---
 src/Components/StatsBar.js | 23 ++++++++++++++++++++---
 src/Pages/AboutPage.js     |  2 +-
 2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/src/Components/StatsBar.js b/src/Components/StatsBar.js
index 0572d3f8..0cdde494 100644
--- a/src/Components/StatsBar.js
+++ b/src/Components/StatsBar.js
@@ -18,6 +18,8 @@ along with Plataforma Integrada MEC.  If not, see <http://www.gnu.org/licenses/>
 
 import React, {Component} from 'react';
 import {Col,Row, Container} from 'react-grid-system';
+import { apiUrl } from "../env";
+import  axios from "axios";
 import mapaBrasil from '../img/mapa-brasil-line-icon.svg';
 const brasilStyle={
   backgroundColor: "#00bcd4",
@@ -41,6 +43,21 @@ const statistcStyle={
 
 };
 class StatsBar extends Component{
+  constructor(props){
+    super(props)
+    this.state ={
+      available_resources: 0,
+      month_publications:0,
+      month_downloads:0
+    }
+  }
+  componentDidMount(){
+    // https://api.portalmec.c3sl.ufpr.br/v1/statistics
+    axios.get(`${apiUrl}/statistics`).then((res) => {
+      this.setState({available_resources:res.data.count, month_publications:res.data.month_publications, month_downloads:res.data.month_downloads})
+    })
+  }
+     
   render(){
     return(
       <div style={brasilStyle}>
@@ -50,7 +67,7 @@ class StatsBar extends Component{
           <img src={mapaBrasil} height="83px" alt="mapa do brasil"/>
           <span  style={statistcStyle}>
             <span style={numberStyle}>
-              31061
+              {this.state.available_resources}
             </span>
             <span>
               Recursos disponíveis
@@ -62,13 +79,13 @@ class StatsBar extends Component{
             ESSE MÊS:
             <span style={statistcStyle}>
             <span style={numberStyle}>
-            10
+              {this.state.month_downloads}
             </span>
             Baixados
             </span>
             <span style={statistcStyle}>
             <span style={numberStyle}>
-            1
+              {this.state.month_publications}
             </span>
             Publicados
           </span>
diff --git a/src/Pages/AboutPage.js b/src/Pages/AboutPage.js
index e8c57d2e..a69e23ff 100644
--- a/src/Pages/AboutPage.js
+++ b/src/Pages/AboutPage.js
@@ -579,7 +579,7 @@ export default function AboutPage(props) {
     <link href="https://fonts.googleapis.com/css?family=Pompiere|Roboto:300,400&display=swap" rel="stylesheet"/>
 
       <Secao1>
-        <iframe title="Vídeo página sobre" src="https://player.vimeo.com/video/231609051" width="100%" height="100%" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>
+        <iframe title="Vídeo página sobre" src="https://player.vimeo.com/video/231609051" width="100%" height="100%" frameborder="0" allow="autoplay; fullscreen" allowFullScreen></iframe>
 
       </Secao1>
 
-- 
GitLab