diff --git a/public/assets/iconePDF.png b/public/assets/iconePDF.png new file mode 100644 index 0000000..38e28b2 Binary files /dev/null and b/public/assets/iconePDF.png differ diff --git a/src/components/header/Header.tsx b/src/components/header/Header.tsx index db21a84..1fba829 100644 --- a/src/components/header/Header.tsx +++ b/src/components/header/Header.tsx @@ -45,12 +45,12 @@ export default function Header({ name, admin }: headerInterface) {
- { + {/* { !admin? : null - } + } */}

olá, {name} diff --git a/src/components/inputUplaod/inputUpload.tsx b/src/components/inputUploadImg/inputUpload.tsx similarity index 96% rename from src/components/inputUplaod/inputUpload.tsx rename to src/components/inputUploadImg/inputUpload.tsx index dad71d1..34daa86 100644 --- a/src/components/inputUplaod/inputUpload.tsx +++ b/src/components/inputUploadImg/inputUpload.tsx @@ -3,7 +3,7 @@ import React,{ useState, useEffect } from 'react' import { InputUploadView } from './inputUploadView' -export default function InputUpload() { +export default function InputUploadPdf() { const [images, setImages] = useState([] as any); const [imageURLS, setImageURLs] = useState([]); @@ -34,6 +34,7 @@ export default function InputUpload() {

+
diff --git a/src/components/inputUplaod/inputUploadView.ts b/src/components/inputUploadImg/inputUploadView.ts similarity index 100% rename from src/components/inputUplaod/inputUploadView.ts rename to src/components/inputUploadImg/inputUploadView.ts diff --git a/src/components/inputUploadPdf/inputUpload.tsx b/src/components/inputUploadPdf/inputUpload.tsx new file mode 100644 index 0000000..96866c0 --- /dev/null +++ b/src/components/inputUploadPdf/inputUpload.tsx @@ -0,0 +1,49 @@ +import React,{ useState, useEffect } from 'react' +import Image from 'next/image'; + + +import { InputUploadView } from './inputUploadView' + + +export default function InputUploadPdf() { + const [images, setImages] = useState([] as any); + const [imageURLS, setImageURLs] = useState([]); + + useEffect(() => { + if (images.length < 1) return; + const newImageUrls: any = []; + images.forEach((image:any) => newImageUrls.push(URL.createObjectURL(image))); + setImageURLs(newImageUrls); + }, [images]); + + function onImageChange(e: any) { + setImages([...e.target.files]); + // console.log(e); + } + + return ( + + +
+ + {imageURLS.map((imageSrc, index) => ( + + ))} + + + + +
+ +
+ + +
+ + +
+ +
+
+ ) +} diff --git a/src/components/inputUploadPdf/inputUploadView.ts b/src/components/inputUploadPdf/inputUploadView.ts new file mode 100644 index 0000000..fed659c --- /dev/null +++ b/src/components/inputUploadPdf/inputUploadView.ts @@ -0,0 +1,51 @@ +import styled from 'styled-components' + +export const InputUploadView = styled.div` + +border-radius: 4px; +border:1px solid gray ; +background-color: white; +width: 300px; +height: 50px; + +input[type="file"] { + display: none; + + } + +label { + width: 140px; + height: 30px; + margin-top: -30px; + border-radius: 4px; + margin-left: 69px; + background-color: #254F7F; + color: white; + font-size: 13px; + font-weight: 600; + text-transform: uppercase; + display: flex; + text-align: center; + cursor: pointer; + } + .TitleButton{ + margin-top: 4px; + margin-left: 30px; + } + + .testess{ + margin-left: 80px; + position: absolute; + + } + + .imgContainer{ + max-width: 40px; + margin-top: 9px; + margin-left: 4px; + height: 30px; +} + + + +` diff --git a/src/components/sidebar/Sidebar.tsx b/src/components/sidebar/Sidebar.tsx index 186c956..3e777ff 100644 --- a/src/components/sidebar/Sidebar.tsx +++ b/src/components/sidebar/Sidebar.tsx @@ -59,6 +59,7 @@ export default function Sidebar() {
  • {'Sobre Nós'}
  • {'FAQ >'}
  • {'Notificações >'}
  • +
  • {'Info Setorial'}
  • (function Alert( return ; }); -export default function clients({clients}) { +export default function clients({clients, userName}) { const [client, setClient] = useState({ name: String, email: String, @@ -121,23 +121,23 @@ export default function clients({clients}) { - notificação cadastrada com sucesso! + Cliente cadastrada com Sucesso! - Notificação não cadastrada! + Cliente não cadastrado! - notificação excluida com sucesso! + Cliente excluido com sucesso! - Notificação não excluida! + Cliente não excluido! @@ -196,7 +196,7 @@ export default function clients({clients}) { client_id: value.target.value }) }} variant="outlined" /> - +

    setOpen(false)} /> handleCreateClient(client)}/> @@ -218,7 +218,7 @@ export default function clients({clients}) { export const getServerSideProps: GetServerSideProps = async (ctx) => { const apiClient = getAPIClient(ctx) const { ['@smartAuth-token']: token } = parseCookies(ctx) - + const { ['user-name']: userName } = parseCookies(ctx) let clients = []; await apiClient.get('/user').then(res => { @@ -241,6 +241,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => { return { props: { clients, + userName } } } diff --git a/src/pages/administrative/industryInfo/index.tsx b/src/pages/administrative/industryInfo/index.tsx new file mode 100644 index 0000000..17d3d4d --- /dev/null +++ b/src/pages/administrative/industryInfo/index.tsx @@ -0,0 +1,49 @@ +import { GetServerSideProps } from 'next' +import Head from 'next/head' +import { parseCookies } from 'nookies' +import React from 'react' +import BasicButton from '../../../components/buttons/basicButton/BasicButton' +import Header from '../../../components/header/Header' +import PageTitle from '../../../components/pageTitle/PageTitle' +import { IndustryInfoView } from '../../../styles/layouts/industryInfo/IndustryInfoView' +import InputUploadPdf from '../../../components/inputUploadPdf/inputUpload'; + +export default function industryInfo({userName}: any) { + return ( + + + Smart Energia - Info de Setor + +
    +
    + + +
    + + + + + + ) +} + +export const getServerSideProps: GetServerSideProps = async (ctx) => { + const { ['@smartAuth-token']: token } = parseCookies(ctx) + const { ['user-name']: userName } = parseCookies(ctx) + + if (!token) { + return { + redirect: { + destination: '/', + permanent: false + } + } + } + + return { + props: { + userName + } + } +} + diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 614c0e7..e77dc36 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -74,7 +74,7 @@ export default function Home() { if (email === "" || password === ""){ setOpenSnackError(true) }else{ - await signIn({email, password}).then(res => {console.log('')}).catch(res => setOpenSnackError(true)) + await signIn({email, password}) } } @@ -89,7 +89,7 @@ export default function Home() { useEffect(() => { setValues({ - password: "", + password: null, showPassword: false, }); setEmail("")