-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1742 from prefeiturasp/release/8.2.0
Release/8.2.0
- Loading branch information
Showing
67 changed files
with
1,954 additions
and
695 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
src/componentes/Globais/ModalLegendaInformacao/ModalLegendaInformacao.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import React, {Fragment, useEffect, useState} from "react"; | ||
import { getTagInformacao } from "../../../services/escolas/Despesas.service"; | ||
import { getTagInformacaoAssociacao } from "../../../services/escolas/Associacao.service" | ||
import {Button, Modal} from "react-bootstrap"; | ||
import Loading from "../../../utils/Loading"; | ||
import { TagInformacao } from "../TagInformacao" | ||
|
||
export const ModalLegendaInformacao = (propriedades) => { | ||
const [listaTagInformacao, setListaTagInformacao] = useState([]) | ||
const [loading, setLoading] = useState(true) | ||
|
||
useEffect(() => { | ||
let isMounted = true; | ||
|
||
const handleTagInformacao = async () => { | ||
setLoading(true); | ||
|
||
try { | ||
let tagsInformacao = []; | ||
|
||
if (propriedades.entidadeDasTags === "associacao") { | ||
tagsInformacao = await getTagInformacaoAssociacao(); | ||
} else { | ||
tagsInformacao = await getTagInformacao(); | ||
} | ||
|
||
if (isMounted) { | ||
setListaTagInformacao(tagsInformacao); | ||
} | ||
} catch (e) { | ||
console.error('Erro ao carregar tag informação', e); | ||
} | ||
|
||
if (isMounted) { | ||
setLoading(false); | ||
} | ||
}; | ||
|
||
handleTagInformacao(); | ||
|
||
return () => { | ||
isMounted = false; | ||
}; | ||
}, [propriedades.entidadeDasTags]); | ||
|
||
return ( | ||
<Fragment> | ||
<Modal centered size="lg" | ||
show={ | ||
propriedades.show | ||
} | ||
onHide={ | ||
propriedades.onHide | ||
}> | ||
<Modal.Header> | ||
<Modal.Title style={ | ||
{fontWeight: 'bold'} | ||
}> | ||
{ | ||
propriedades.titulo | ||
}</Modal.Title> | ||
</Modal.Header> | ||
<Modal.Body> { | ||
loading ? ( | ||
<Loading corGrafico="black" corFonte="dark" marginTop="0" marginBottom="0"/> | ||
) : listaTagInformacao?.length > 0 ? listaTagInformacao.map((tag, index) => { | ||
tag.texto = tag.nome | ||
return <React.Fragment key={index}>{<TagInformacao data={tag} localDaTag="modal-legenda-informacao"/>}</React.Fragment> | ||
}) : <span>Nenhuma informação encontrada</span> | ||
} </Modal.Body> | ||
<Modal.Footer> | ||
<Button variant={ | ||
propriedades.primeiroBotaoCss ? propriedades.primeiroBotaoCss : "info" | ||
} | ||
onClick={ | ||
propriedades.primeiroBotaoOnclick | ||
}> | ||
{ | ||
propriedades.primeiroBotaoTexto | ||
} </Button> | ||
</Modal.Footer> | ||
</Modal> | ||
</Fragment> | ||
) | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
src/componentes/Globais/ModalLegendaInformacao/ModalLegendaInformacaoAssociacao.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React, {Fragment} from "react"; | ||
import {Button, Modal} from "react-bootstrap"; | ||
import { TagInformacao } from "../../Globais/TagInformacao"; | ||
|
||
export const ModalLegendaInformacaoAssociacao = (propriedades) => { | ||
|
||
const opcoes = [ | ||
{ | ||
id: 7, | ||
class: "fundo-cor-cinza-neutral-03 texto-cor-branco", | ||
texto: "Associação encerrada", | ||
descricao: "Indica que a associação foi encerrada." | ||
} | ||
] | ||
|
||
return ( | ||
<Fragment> | ||
<Modal centered size="lg" | ||
show={ | ||
propriedades.show | ||
} | ||
onHide={ | ||
propriedades.onHide | ||
}> | ||
<Modal.Header> | ||
<Modal.Title style={ | ||
{fontWeight: 'bold'} | ||
}> | ||
{ | ||
propriedades.titulo | ||
}</Modal.Title> | ||
</Modal.Header> | ||
<Modal.Body> { | ||
opcoes.map((tag, index) => { | ||
tag.index = index; | ||
return ( | ||
<TagInformacao data={tag} localDaTag="modal-legenda-informacao"/> | ||
) | ||
}) | ||
} </Modal.Body> | ||
<Modal.Footer> | ||
<Button variant={ | ||
propriedades.primeiroBotaoCss ? propriedades.primeiroBotaoCss : "info" | ||
} | ||
onClick={ | ||
propriedades.primeiroBotaoOnclick | ||
}> | ||
{ | ||
propriedades.primeiroBotaoTexto | ||
} </Button> | ||
</Modal.Footer> | ||
</Modal> | ||
</Fragment> | ||
) | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/componentes/Globais/ModalLegendaInformacao/scss/legendaInformacoesAssociacao.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.tag-informacoes-associacao-encerrada { | ||
display: flex; | ||
flex: 1; | ||
justify-content: center; | ||
padding-left: 2px; | ||
padding-right: 2px; | ||
border-radius: 5px; | ||
align-items: center; | ||
} | ||
|
||
.fundo-cor-cinza-neutral-03 { | ||
background-color: #9B9C9C; | ||
} | ||
|
||
.texto-cor-branco { | ||
color: #fff; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from "react"; | ||
import './tag.scss'; | ||
|
||
export const Tag = ({ | ||
label = '', | ||
color = 'default' | ||
}) =>{ | ||
|
||
return( | ||
<div className={`custom-tag custom-tag-${color}`}> | ||
<span>{label}</span> | ||
</div> | ||
) | ||
}; |
Oops, something went wrong.