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