Skip to content

Commit

Permalink
Merge pull request #76 from fga-eps-mds/Correções
Browse files Browse the repository at this point in the history
Correções de css e code smells
  • Loading branch information
antoniotoineto authored Jul 10, 2023
2 parents 4617ad1 + eeb8581 commit ee7049e
Show file tree
Hide file tree
Showing 42 changed files with 904 additions and 846 deletions.
7 changes: 0 additions & 7 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
height: 100%;
}


.Central {
display: flex;
justify-content: center;
Expand All @@ -89,11 +88,6 @@
height: inherit;
}

.logoDnit {
width: 380px;
height: 96px;
}

.imgLateral {
width: 437px;
height: 291px;
Expand Down Expand Up @@ -209,5 +203,4 @@
width: 237px;
height: 131px;
}

}
14 changes: 5 additions & 9 deletions src/components/components-escolasCadastradas/FiltragemTabela.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import "../components-escolasCadastradas/style/FiltragemTabela.css";

export default function TabelaEscolas() {
const {
setNomeEscola,

NomePesquisado,
setNomePesquisado,

Expand All @@ -22,7 +20,6 @@ export default function TabelaEscolas() {
situacaoSelecionada,
setSituacaoSelecionada,

etapaDeEnsinoSelecionada,
setEtapaDeEnsinoSelecionada,

municipioSelecionado,
Expand Down Expand Up @@ -99,8 +96,7 @@ export default function TabelaEscolas() {
useEffect(() => {
if (opcoesSituacao.length == 0) getEtapasDeEnsino();
});
const [showOpcoesEtapasDeEnsino, setShowOpcoesEtapasDeEnsino] =
useState(false);
const [, setShowOpcoesEtapasDeEnsino] = useState(false);
const [OpcoesEtapasDeEnsino, setOpcoesEtapasDeEnsino] = useState<
{ value: number; label: string }[]
>([]);
Expand Down Expand Up @@ -214,7 +210,7 @@ export default function TabelaEscolas() {
.map((options, index) => {
return (
<div
key={index}
key={options.id}
className="options"
onClick={() => handleOptionClick(options, 1)}
>
Expand Down Expand Up @@ -269,7 +265,7 @@ export default function TabelaEscolas() {
)
.map((options, index) => (
<div
key={index}
key={options.id}
className="options"
onClick={() => handleOptionClick(options, 2)}
>
Expand Down Expand Up @@ -323,7 +319,7 @@ export default function TabelaEscolas() {
)
.map((options, index) => (
<div
key={index}
key={options.id}
className="options"
onClick={() => handleOptionClick(options, 4)}
>
Expand Down Expand Up @@ -355,4 +351,4 @@ export default function TabelaEscolas() {
</div>
</>
);
}
}
128 changes: 80 additions & 48 deletions src/components/components-escolasCadastradas/ModalExcluirEscolas.tsx
Original file line number Diff line number Diff line change
@@ -1,54 +1,86 @@
import { notification } from 'antd';
import fetchExcluirEscola from '../../service/excluirEscola';
import './style/ModalExcluirEscolas.css';
import { useState } from 'react';
import { useFiltroTabela } from '../../context/FiltroTabela';
import { notification } from "antd";
import { useFiltroTabela } from "../../context/FiltroTabela";
import fetchExcluirEscola from "../../service/excluirEscola";
import "./style/ModalExcluirEscolas.css";

interface ModalExcluirEscolaProps {
open: boolean
id: number
close: () => void
closeModalExcluirEscola: () => void
nomeEscola: string
open: boolean;
id: number;
close: () => void;
closeModalExcluirEscola: () => void;
nomeEscola: string;
}

const ModalExcluirEscolas = ({open, id, close, closeModalExcluirEscola, nomeEscola}: ModalExcluirEscolaProps) => {
const {fetchEscolasFiltradas} = useFiltroTabela()
const excluirEscola = async () => {
try {
await fetchExcluirEscola({ id_escola: id });
notification.success({ message: `Escola ${nomeEscola} excluída com sucesso!` });
close();
fetchEscolasFiltradas();
} catch (error) {
notification.error({ message: `Erro ao excluir a escola ${nomeEscola}! ` });
close();
}

const ModalExcluirEscolas = ({
open,
id,
close,
closeModalExcluirEscola,
nomeEscola,
}: ModalExcluirEscolaProps) => {
const { fetchEscolasFiltradas } = useFiltroTabela();
const excluirEscola = async () => {
try {
await fetchExcluirEscola({ id_escola: id });
notification.success({
message: `Escola ${nomeEscola} excluída com sucesso!`,
});
close();
fetchEscolasFiltradas();
} catch (error) {
notification.error({
message: `Erro ao excluir a escola ${nomeEscola}! `,
});
close();
}
if (!open) { return null }
return (
< >
<div className='overlay-modal'>
<div style={{ zIndex: 10000, position: 'absolute', top: '31%', left: '31%', right: '31%' }}>
<div className="div br-modal large" style={{ width: '80%', height: '220px' }}>
<div className="br-modal-header content-left">Confirmar Exclusão
</div>
<div className='modal-line'>
</div>
<p className='space-p'>
Deseja excluir a escola permanentemende? A ação não pode ser desfeita.
</p>
<div className="br-modal-footer content-right">
<button className="br-button secondary" type="button" onClick={closeModalExcluirEscola}>Voltar
</button>
<button className="br-button cancel-button" type="button" onClick={excluirEscola}>Excluir
</button>
</div>
</div>
</div>
};
if (!open) {
return null;
}
return (
<>
<div className="overlay-modal">
<div
style={{
zIndex: 10000,
position: "absolute",
top: "31%",
left: "31%",
right: "31%",
}}
>
<div
className="div br-modal large"
style={{ width: "80%", height: "220px" }}
>
<div className="br-modal-header content-left">
Confirmar Exclusão
</div>
</>
);
}
export default ModalExcluirEscolas;
<div className="modal-line"></div>
<p className="space-p">
Deseja excluir a escola permanentemende? A ação não pode ser
desfeita.
</p>
<div className="br-modal-footer content-right">
<button
className="br-button secondary"
type="button"
onClick={closeModalExcluirEscola}
>
Voltar
</button>
<button
className="br-button cancel-button"
type="button"
onClick={excluirEscola}
>
Excluir
</button>
</div>
</div>
</div>
</div>
</>
);
};
export default ModalExcluirEscolas;
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const ModalExibirInformacoes = ({ escola, open, close }: ModalProps) => {
});

const { selectedValue, setSelectedValue } = useSelectedValue();
const [api, contextHolder] = notification.useNotification();
const [, contextHolder] = notification.useNotification();
const { fetchEscolasFiltradas } = useFiltroTabela();

const chamarSituacao = async () => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/components-escolasCadastradas/TabelaEscola.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export default function TabelaEscola() {
const [, contextHolder] = notification.useNotification();

const [showOptionsPages, setShowOptionsPages] = useState(false);
const [showSchoolsPerPage, setShowSchoolsPerPage] = useState(false);
const [, setShowSchoolsPerPage] = useState(false);
const optionsSchoolsPerPage = ["2", "5", "10", "20"];
const [schools, setschools] = useState<EscolaData[]>([]);
const [schools] = useState<EscolaData[]>([]);
const [modalStates, setModalStates] = useState(
Array(schools.length).fill(false)
);
Expand Down Expand Up @@ -214,7 +214,7 @@ export default function TabelaEscola() {
<div className="select-options dropdown-pagina">
{optionsSchoolsPerPage.map((options, index) => (
<div
key={index}
key={options}
className="options"
onClick={() => handleOptionClick(Number(options))}
data-testid={`options-${options}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,6 @@
color: var(--color-secondary-09);
outline: none;
}
.br-select .br-list:hover::-webkit-scrollbar-thumb {
background: var(--color-secondary-07);
}
.br-select .br-list[expanded] {
display: block;
}
Expand Down
Loading

2 comments on commit ee7049e

@vercel
Copy link

@vercel vercel bot commented on ee7049e Jul 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

2023-1-dnit-front – ./

2023-1-dnit-front-dnit.vercel.app
2023-1-dnit-front-git-main-dnit.vercel.app
2023-1-dnit-front.vercel.app

@vercel
Copy link

@vercel vercel bot commented on ee7049e Jul 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.