Commit 9408703e authored by Hamer Iboshi's avatar Hamer Iboshi

Added details from communities in modal map

parent df4545d0
......@@ -21,7 +21,7 @@ along with Portal-SMPPIR-React. If not, see <https://www.gnu.org/licenses/>.
import React, { Component, useState } from 'react';
import { Card, Row, Col, Button, Modal } from 'react-materialize';
import { Card, Row, Col, Button, Modal, Table } from 'react-materialize';
import CardFooter from '../Components/CardFooter';
import UfBar from '../Components/UfBar';
import GrayBar from '../Components/GrayBar';
......@@ -30,7 +30,7 @@ import { getStateExtendedName } from '../enviroment';
import * as data from '../JsonsAntigos/brasil-quilombola/bqe1'
import BuildLineNotFixed from '../Charts/BuildLineNotFixed'
import BuildPie from '../Charts/BuildPie'
import Table from '../Components/Table'
import CTable from '../Components/Table'
import BrasilMap from '../Components/Map';
import { Map, TileLayer, Polygon, Marker, Popup } from 'react-leaflet';
import PageTable from '../Components/PageTable'
......@@ -139,6 +139,7 @@ class Eixo1 extends Component {
return (
<div>
<Modal
className="map-modal"
open={this.state.modalOpen}
actions={
<div>
......@@ -150,7 +151,7 @@ class Eixo1 extends Component {
>
{this.state.modalOpen ?
<Row>
<Col s={12}>
<Col s={6}>
{ (this.state.clickedRow && this.state.clickedRow.lat) ?
<Map
center={this.state.clickedRow.lat ? [this.state.clickedRow.lat, this.state.clickedRow.lng] : this.shapeMap()[0][0][1]}
......@@ -168,6 +169,32 @@ class Eixo1 extends Component {
/>
</Map> : <span>Não há mapas disponíveis para está comunidade.</span>}
</Col>
<Col s={6}>
<Table className="striped">
<tbody>
<tr>
<td>Número identificador da comunidade:</td>
<td>{ this.state.clickedRow.id_territorio }</td>
</tr>
<tr>
<td>Município:</td>
<td>{ this.state.clickedRow.municipio }</td>
</tr>
<tr>
<td>Território:</td>
<td>{ this.state.clickedRow.nome_territorio }</td>
</tr>
<tr>
<td>Processo no INCRA:</td>
<td>{ this.state.clickedRow.processo_incra }</td>
</tr>
<tr>
<td>Processo na FCP:</td>
<td>{ this.state.clickedRow.processo_fcp }</td>
</tr>
</tbody>
</Table>
</Col>
</Row> : null }
</Modal>
<Row>
......@@ -213,7 +240,7 @@ class Eixo1 extends Component {
</Card>
<Card id="e1pannel-3" title="Titulações">
<Table header={["Unidade Federal", "Comunidades Tituladas"]} body={data.gete1p31()} classes="striped smallCells" />
<CTable header={["Unidade Federal", "Comunidades Tituladas"]} body={data.gete1p31()} classes="striped smallCells" />
{data.gete1p32()[getStateExtendedName(this.state.clickedInMap).currentState] ? (
<UfBar ufname={getStateExtendedName(this.state.clickedInMap).currentState} val={data.gete1p32()[getStateExtendedName(this.state.clickedInMap).currentState] + " comunidades tituladas"} />
) : (
......@@ -226,8 +253,6 @@ class Eixo1 extends Component {
<Card id="e1pannel-4" title="Lista de Comunidades Reconhecidas Oficialmente pelo estado">
<p>Clique na comunidade para ter acesso ao mapa com informações detalhadas sobre ela</p>
{/* <Table header={["ID","Comunidade","Território","Certificação","Titulação"]} body={this.jsonToArray(data.gete1p4()[getStateExtendedName(this.state.clickedInMap).currentState])} classes="striped smallCells" divClasses="scrolltable"/> */}
<PageTable columns={['ID', 'Comunidade', 'Território', 'Status INCRA', 'Etapa FCP', 'UF']}
data={this.fixData(data.gete1p4())} pageSize={15} defaultSorted={[{ id: "ID", desc: false }]}
mode='normal'
......
......@@ -147,6 +147,10 @@ along with Portal-SMPPIR-React. If not, see <https://www.gnu.org/licenses/>.
/* Map css */
.leaflet-container {
height: 51vh;
width: 50vw;
width: 40vw;
margin: 0 auto;
}
.map-modal {
width: 90%;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment