-
Notifications
You must be signed in to change notification settings - Fork 7
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 #76 from fga-eps-mds/Correções
Correções de css e code smells
- Loading branch information
Showing
42 changed files
with
904 additions
and
846 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
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
128 changes: 80 additions & 48 deletions
128
src/components/components-escolasCadastradas/ModalExcluirEscolas.tsx
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 |
---|---|---|
@@ -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; |
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
Oops, something went wrong.
ee7049e
There was a problem hiding this comment.
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
ee7049e
There was a problem hiding this comment.
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:
dnit – ./
dnit-git-main-backlogorganization.vercel.app
dnit.vercel.app
dnit-backlogorganization.vercel.app