forked from RiseUP/riseup-squad23
Criacao manager e erro login
This commit is contained in:
parent
95054bb9c1
commit
a8fc3eb397
17
src/components/utils/fetchErros/CabecalhoError.jsx
Normal file
17
src/components/utils/fetchErros/CabecalhoError.jsx
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import './style.css';
|
||||||
|
|
||||||
|
const CabecalhoError = ({ showCabecalho, message, errorCode }) => {
|
||||||
|
if (!showCabecalho) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="cabecalho-error-wrapper">
|
||||||
|
<div className="cabecalho-error">
|
||||||
|
|
||||||
|
<p className='cabecalho-error-text'>{message}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default CabecalhoError;
|
||||||
16
src/components/utils/fetchErros/ManagerFunction.js
Normal file
16
src/components/utils/fetchErros/ManagerFunction.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
function manager (setShowModal, RefreshingToken, setErrorInfo,errorData) {
|
||||||
|
|
||||||
|
console.log((errorData, "MANAGER"))
|
||||||
|
|
||||||
|
|
||||||
|
if(errorData.httpStatus === 401){
|
||||||
|
RefreshingToken()
|
||||||
|
}else{
|
||||||
|
|
||||||
|
// setErrorInfo(errorData)
|
||||||
|
setShowModal("modal");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export default manager
|
||||||
26
src/components/utils/fetchErros/style.css
Normal file
26
src/components/utils/fetchErros/style.css
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
.cabecalho-error {
|
||||||
|
background-color: #f3616d; /* vermelho forte */
|
||||||
|
color: white;
|
||||||
|
display: flex;
|
||||||
|
align-items: center; /* centraliza verticalmente */
|
||||||
|
justify-content: center; /* centraliza horizontalmente */
|
||||||
|
padding: 12px 20px;
|
||||||
|
margin: 10px;
|
||||||
|
border-radius: 8px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 16px;
|
||||||
|
width: calc(100% - 20px); /* ocupa quase toda a largura da div pai */
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cabecalho-error-text {
|
||||||
|
margin: 0;
|
||||||
|
padding-left: 30px; /* espaço para "Erro 404" */
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cabecalho-error-code {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user