From 6d9c49fe5d293d8540efd4a9041b43eec938f9fd Mon Sep 17 00:00:00 2001
From: Alex Santos
Date: Mon, 27 Jun 2022 21:03:10 -0300
Subject: [PATCH] maintenance input,header
---
src/components/header/Header.tsx | 9 +---
.../administrative/industryInfo/index.tsx | 46 +++++++++++++------
.../layouts/industryInfo/IndustryInfoView.ts | 13 ++++++
3 files changed, 45 insertions(+), 23 deletions(-)
diff --git a/src/components/header/Header.tsx b/src/components/header/Header.tsx
index 7ac5ad2..aadb528 100644
--- a/src/components/header/Header.tsx
+++ b/src/components/header/Header.tsx
@@ -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 (
@@ -60,13 +60,6 @@ export default function Header({ name, admin, profile_picture }: headerInterface
olá, {name}
- {
- !admin?
- //
- null
- :
- null
- }
diff --git a/src/pages/administrative/industryInfo/index.tsx b/src/pages/administrative/industryInfo/index.tsx
index 9d0f5b7..18a4297 100644
--- a/src/pages/administrative/industryInfo/index.tsx
+++ b/src/pages/administrative/industryInfo/index.tsx
@@ -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(function Alert(
return ;
});
+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 (
@@ -73,7 +90,7 @@ export default function industryInfo({userName}: any) {
-
+
-
- {/*
handleCreateClient()} title='Atualizar'/> */}
+
)
diff --git a/src/styles/layouts/industryInfo/IndustryInfoView.ts b/src/styles/layouts/industryInfo/IndustryInfoView.ts
index 811d516..805dd85 100644
--- a/src/styles/layouts/industryInfo/IndustryInfoView.ts
+++ b/src/styles/layouts/industryInfo/IndustryInfoView.ts
@@ -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;
+ }
+
+
`