maintenance input,header
This commit is contained in:
parent
99f51b87cc
commit
6d9c49fe5d
@ -42,7 +42,7 @@ interface headerInterface {
|
||||
profile_picture: string
|
||||
}
|
||||
|
||||
export default function Header({ name, admin, profile_picture }: headerInterface) {
|
||||
export default function Header({ name, admin, }: headerInterface) {
|
||||
return (
|
||||
<HeaderView>
|
||||
<section>
|
||||
@ -60,13 +60,6 @@ export default function Header({ name, admin, profile_picture }: headerInterface
|
||||
olá, {name}
|
||||
</p>
|
||||
</div>
|
||||
{
|
||||
!admin?
|
||||
// <Image src={profile_picture} alt='teste' height={45} width={50} />
|
||||
null
|
||||
:
|
||||
null
|
||||
}
|
||||
|
||||
</section>
|
||||
</HeaderView>
|
||||
|
||||
@ -11,9 +11,6 @@ import { api } from '../../../services/api'
|
||||
import { Viewer } from '@react-pdf-viewer/core';
|
||||
import '@react-pdf-viewer/core/lib/styles/index.css';
|
||||
import FormData from 'form-data';
|
||||
|
||||
|
||||
|
||||
import Snackbar from '@mui/material/Snackbar';
|
||||
import MuiAlert, { AlertProps } from '@mui/material/Alert';
|
||||
import { InputUploadView } from '../../../components/inputUploadPdf/inputUploadView'
|
||||
@ -25,6 +22,10 @@ const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
||||
return <MuiAlert elevation={6} ref={ref} variant="filled" {...props} />;
|
||||
});
|
||||
|
||||
const formData = new FormData()
|
||||
|
||||
|
||||
|
||||
export default function industryInfo({userName}: any) {
|
||||
const [url, setUrl] = React.useState('');
|
||||
|
||||
@ -45,16 +46,32 @@ export default function industryInfo({userName}: any) {
|
||||
setOpenSnackSuccess(false);
|
||||
};
|
||||
|
||||
function handleCreateClient() {
|
||||
function handleCreateClient({
|
||||
pdf,
|
||||
}) {
|
||||
formData.append('file', pdf)
|
||||
|
||||
api.post('/updateFile', formData).then(res => {
|
||||
setOpenSnackSuccess(true)
|
||||
}).catch(res => {
|
||||
setOpenSnackError(true)
|
||||
})
|
||||
api.post('/updateFile', formData)
|
||||
.then((res) => {
|
||||
setOpenSnackSuccess(true)
|
||||
window.location.reload()
|
||||
})
|
||||
.catch((res) => {
|
||||
setOpenSnackError(true)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// function handleCreateClient() {
|
||||
// pdf,
|
||||
// FormData.append('file', pdf)
|
||||
|
||||
// api.post('/updateFile', FormData).then(res => {
|
||||
// setOpenSnackSuccess(true)
|
||||
// }).catch(res => {
|
||||
// setOpenSnackError(true)
|
||||
// })
|
||||
// }
|
||||
|
||||
return (
|
||||
<IndustryInfoView>
|
||||
<Snackbar open={openSnackSuccess} autoHideDuration={4000} onClose={handleCloseSnack}>
|
||||
@ -73,7 +90,7 @@ export default function industryInfo({userName}: any) {
|
||||
<Header name={userName} />
|
||||
<div className='title'>
|
||||
<PageTitle title='Info Setorial' subtitle='Realize o upload da última versão de info setorial' />
|
||||
<InputUploadView>
|
||||
{/* <InputUploadView>
|
||||
<div className="update">
|
||||
<form action="">
|
||||
<div className='testess'>
|
||||
@ -83,17 +100,16 @@ export default function industryInfo({userName}: any) {
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</InputUploadView>
|
||||
</InputUploadView> */}
|
||||
{/* <InputUploadPdf/> */}
|
||||
</div>
|
||||
|
||||
<div style={{marginTop:'20px'}}>
|
||||
<div className='inputTeste'>
|
||||
<input type="file" name='arquivo' id='arquivo' onChange={onChange} />
|
||||
</div>
|
||||
|
||||
|
||||
<br />
|
||||
{/* <BasicButton onClick={() => handleCreateClient()} title='Atualizar'/> */}
|
||||
<BasicButton onClick={handleCreateClient} title='Atualizar'/>
|
||||
|
||||
</IndustryInfoView>
|
||||
)
|
||||
|
||||
@ -26,4 +26,17 @@ export const IndustryInfoView = styled.main`
|
||||
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.inputTeste{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top:-10px;
|
||||
width: 50%;
|
||||
margin-bottom: 50px;
|
||||
height: 50px;
|
||||
background: white;
|
||||
border: 3px solid #254F7F;
|
||||
border-radius:10px;
|
||||
}
|
||||
|
||||
|
||||
`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user