From 6efff72b8663b1bcdf09e8ab66932efcd749ffb9 Mon Sep 17 00:00:00 2001 From: JoosPerro Date: Fri, 23 Aug 2024 10:48:33 -0300 Subject: [PATCH] feat: Continuando a US03 --- riso_frontend/src/App.js | 6 +- .../src/components/addUnityModal/index.jsx | 9 + .../src/pages/AddCollaborator/index.js | 55 -- .../src/pages/AddCollaborator/styles.css | 515 ------------------ riso_frontend/src/services/unityServices.js | 17 +- .../src/services/userToUnityServices.js | 19 - 6 files changed, 16 insertions(+), 605 deletions(-) create mode 100644 riso_frontend/src/components/addUnityModal/index.jsx delete mode 100644 riso_frontend/src/pages/AddCollaborator/index.js delete mode 100644 riso_frontend/src/pages/AddCollaborator/styles.css delete mode 100644 riso_frontend/src/services/userToUnityServices.js diff --git a/riso_frontend/src/App.js b/riso_frontend/src/App.js index bb3d37dc..9fffd13b 100644 --- a/riso_frontend/src/App.js +++ b/riso_frontend/src/App.js @@ -4,15 +4,15 @@ import { BrowserRouter as Router, Route, Routes} from 'react-router-dom'; import Autentication from './pages/Autentication'; import HomePage from './pages/HomePage'; import RegisterUnit from './pages/CadastroEmpresa'; -import AddCollaborator from './pages/AddCollaborator'; +import addUnityModal from './components/addUnityModal/index'; function App() { return ( - } /> + } /> + {/*} />*/} } /> - }/> }/> diff --git a/riso_frontend/src/components/addUnityModal/index.jsx b/riso_frontend/src/components/addUnityModal/index.jsx new file mode 100644 index 00000000..546fa715 --- /dev/null +++ b/riso_frontend/src/components/addUnityModal/index.jsx @@ -0,0 +1,9 @@ +import React from "react"; + +function addUnityModal() { + return ( +

Você Logou

+ ); +} + +export default addUnityModal; \ No newline at end of file diff --git a/riso_frontend/src/pages/AddCollaborator/index.js b/riso_frontend/src/pages/AddCollaborator/index.js deleted file mode 100644 index b24d23b3..00000000 --- a/riso_frontend/src/pages/AddCollaborator/index.js +++ /dev/null @@ -1,55 +0,0 @@ -import React, { useState, useEffect } from "react"; -import "./styles.css"; -import { createUserToUnity } from "../../services/userToUnityServices"; - -function addCollaborator() { - - //Estados: - const [unityId, setUnityId] = useState(''); - const [email, setEmail] = useState(''); - - //Mudando o dado no input do código de unidade - const handleChangeUnityId = (event) => { - setUnityId(event.target.value); - } - - //Mudando o dado no input de email - const handleChangeEmail = (event) => { - setEmail(event.target.value); - } - - async function addCollab(event){ - event.preventDefault(); - try { - const response = await createUserToUnity(unityId, email); - console.log(response); - } catch (err) { - console.log(err); - } - } - - return ( -
-
-
-

Associar-se a uma Unidade

-

Torne-se colaborador de uma unidade

-
- - - - -
-
-
-
- ); -} - -export default addCollaborator; diff --git a/riso_frontend/src/pages/AddCollaborator/styles.css b/riso_frontend/src/pages/AddCollaborator/styles.css deleted file mode 100644 index c7cafdf0..00000000 --- a/riso_frontend/src/pages/AddCollaborator/styles.css +++ /dev/null @@ -1,515 +0,0 @@ -@import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,700&display=swap'); -* { - margin: 0; - padding: 0; - box-sizing: border-box; -} -body { - font-family: 'Open Sans', sans-serif; -} -.container { - display: flex; - justify-content: center; - align-items: center; - height: 100vh; - background-color: #ecf0f1; -} -.content { - background-color: #fff; - border-radius: 15px; - width: 960px; - height: 50%; - justify-content: space-between; - align-items: center; - position: relative; -} -.content::before { - content: ""; - position: absolute; - background-color: #58af9b; - width: 40%; - height: 100%; - border-top-left-radius: 15px; - border-bottom-left-radius: 15px; - - - left: 0; -} -.title { - font-size: 28px; - font-weight: bold; - text-transform: capitalize; -} -.title-primary { - color: #fff; -} -.title-second { - color: #58af9b; -} -.description { - font-size: 14px; - font-weight: 300; - line-height: 30px; -} -.description-primary { - color: #fff; -} -.description-second { - color: #7f8c8d; -} -.btn { - border-radius: 15px; - text-transform: uppercase; - color: #fff; - font-size: 10px; - padding: 10px 50px; - cursor: pointer; - font-weight: bold; - width: 150px; - align-self: center; - border: none; - margin-top: 1rem; -} -.btn-primary { - background-color: transparent; - border: 1px solid #fff; - transition: background-color .5s; -} -.btn-primary:hover { - background-color: #fff; - color: #58af9b; -} -.btn-second { - background-color: #58af9b; - border: 1px solid #58af9b; - transition: background-color .5s; -} -.btn-second:hover { - background-color: #fff; - border: 1px solid #58af9b; - color: #58af9b; -} -.first-content { - display: flex; -} -.first-content .second-column { - z-index: 11; -} -.first-column { - text-align: center; - width: 40%; - z-index: 10; -} -.second-column { - width: 60%; - display: flex; - flex-direction: column; - align-items: center; -} -.social-media { - margin: 1rem 0; -} -.link-social-media:not(:first-child){ - margin-left: 10px; -} -.link-social-media .item-social-media { - transition: background-color .5s; -} -.link-social-media:hover .item-social-media{ - background-color: #58af9b; - color: #fff; - border-color: #58af9b; -} -.list-social-media { - display: flex; - list-style-type: none; -} -.item-social-media { - border: 1px solid #bdc3c7; - border-radius: 50%; - width: 35px; - height: 35px; - line-height: 35px; - text-align: center; - color: #95a5a6; -} -.form { - display: flex; - flex-direction: column; - width: 55%; -} -.form input { - height: 45px; - width: 100%; - border: none; - background-color: #ecf0f1; -} -input:-webkit-autofill -{ - -webkit-box-shadow: 0 0 0px 1000px #ecf0f1 inset !important; - -webkit-text-fill-color: #000 !important; -} -.label-input { - background-color: #ecf0f1; - display: flex; - align-items: center; - margin: 8px; -} -.icon-modify { - color: #7f8c8d; - padding: 0 5px; -} - -/* second content*/ - -.second-content { - position: absolute; - display: flex; -} -.second-content .first-column { - order: 2; - z-index: -1; -} -.second-content .second-column { - order: 1; - z-index: -1; -} -.password { - color: #34495e; - font-size: 14px; - margin: 15px 0; - text-align: center; -} -.password::first-letter { - text-transform: capitalize; -} - - - -.sign-in-js .first-content .first-column { - z-index: -1; -} - -.sign-in-js .second-content .second-column { - z-index: 11; -} -.sign-in-js .second-content .first-column { - z-index: 13; -} - -.sign-in-js .content::before { - left: 60%; - border-top-left-radius: 0; - border-bottom-left-radius: 0; - border-top-right-radius: 15px; - border-bottom-right-radius: 15px; - animation: slidein 1.3s; /*MODIFIQUEI DE 3s PARA 1.3s*/ - - z-index: 12; -} - -.sign-up-js .content::before { - animation: slideout 1.3s; /*MODIFIQUEI DE 3s PARA 1.3s*/ - - z-index: 12; -} - -.sign-up-js .second-content .first-column, -.sign-up-js .second-content .second-column { - z-index: -1; -} - -.sign-up-js .first-content .second-column { - z-index: 11; -} - -.sign-up-js .first-content .first-column { - z-index: 13; -} - - -/* DESLOCAMENTO CONTEÚDO ATRÁS DO CONTENT:BEFORE*/ -.sign-in-js .first-content .second-column { - - z-index: -1; - position: relative; - animation: deslocamentoEsq 1.3s; /*MODIFIQUEI DE 3s PARA 1.3s*/ -} - -.sign-up-js .second-content .second-column { - position: relative; - z-index: -1; - animation: deslocamentoDir 1.3s; /*MODIFIQUEI DE 3s PARA 1.3s*/ -} - -/*ANIMAÇÃOO CSS PARA O CONTEÚDO*/ - -@keyframes deslocamentoEsq { - - from { - left: 0; - opacity: 1; - z-index: 12; - } - - 25% { - left: -80px; - opacity: .5; - /* z-index: 12; NÃO HÁ NECESSIDADE */ - } - - 50% { - left: -100px; - opacity: .2; - /* z-index: 12; NÃO HÁ NECESSIDADE */ - } - - to { - left: -110px; - opacity: 0; - z-index: -1; - } -} - - -@keyframes deslocamentoDir { - - from { - left: 0; - z-index: 12; - } - - 25% { - left: 80px; - /* z-index: 12; NÃO HÁ NECESSIDADE*/ - } - - 50% { - left: 100px; - /* z-index: 12; NÃO HÁ NECESSIDADE*/ - /* background-color: yellow; Exemplo que dei no vídeo*/ - } - - to { - left: 110px; - z-index: -1; - } -} - - -/*ANIMAÇÃO CSS*/ - -@keyframes slidein { - - from { - left: 0; - width: 40%; - } - - 25% { - left: 5%; - width: 50%; - } - - 50% { - left: 25%; - width: 60%; - } - - 75% { - left: 45%; - width: 50%; - } - - to { - left: 60%; - width: 40%; - } -} - -@keyframes slideout { - - from { - left: 60%; - width: 40%; - } - - 25% { - left: 45%; - width: 50%; - } - - 50% { - left: 25%; - width: 60%; - } - - 75% { - left: 5%; - width: 50%; - } - - to { - left: 0; - width: 40%; - } -} - -/*VERSÃO MOBILE*/ -@media screen and (max-width: 1040px) { - .content { - width: 100%; - height: 100%; - } - - .content::before { - width: 100%; - height: 40%; - top: 0; - border-radius: 0; - } - .first-content, .second-content { - flex-direction: column; - justify-content: space-around; - } - - .first-column, .second-column { - width: 100%; - } - - .sign-in-js .content::before { - top: 60%; - left: 0; - border-radius: 0; - - } - - .form { - width: 90%; - } - - /* ANIMAÇÃO MOBILE CSS*/ - - @keyframes deslocamentoEsq { - - from { - top: 0; - opacity: 1; - z-index: 12; - } - - 25% { - top: -80px; - opacity: .5; - /* z-index: 12; NÃO HÁ NECESSIDADE */ - } - - 50% { - top: -100px; - opacity: .2; - /* z-index: 12; NÃO HÁ NECESSIDADE */ - } - - to { - top: -110px; - opacity: 0; - z-index: -1; - } - } - - - @keyframes deslocamentoDir { - - from { - top: 0; - z-index: 12; - } - - 25% { - top: 80px; - /* z-index: 12; NÃO HÁ NECESSIDADE*/ - } - - 50% { - top: 100px; - /* z-index: 12; NÃO HÁ NECESSIDADE*/ - /* background-color: yellow; Exemplo que dei no vídeo*/ - } - - to { - top: 110px; - z-index: -1; - } - } - - - - @keyframes slidein { - - from { - top: 0; - height: 40%; - } - - 25% { - top: 5%; - height: 50%; - } - - 50% { - top: 25%; - height: 60%; - } - - 75% { - top: 45%; - height: 50%; - } - - to { - top: 60%; - height: 40%; - } - } - - @keyframes slideout { - - from { - top: 60%; - height: 40%; - } - - 25% { - top: 45%; - height: 50%; - } - - 50% { - top: 25%; - height: 60%; - } - - 75% { - top: 5%; - height: 50%; - } - - to { - top: 0; - height: 40%; - } - } - -} - -@media screen and (max-width: 740px) { - .form { - width: 50%; - } -} - -@media screen and (max-width: 425px) { - .form { - width: 100%; - } -} \ No newline at end of file diff --git a/riso_frontend/src/services/unityServices.js b/riso_frontend/src/services/unityServices.js index c4f684b6..5a2eb0d2 100644 --- a/riso_frontend/src/services/unityServices.js +++ b/riso_frontend/src/services/unityServices.js @@ -2,17 +2,8 @@ import axios from 'axios'; const baseURL = 'http://localhost:3000'; -export function createUnity(unityIdData) { - const body = { - unityId: unityIdData, - }; +export function findOne (code) { + const response = axios.get(`${baseURL}/unidadeEmpresa/findOneUnity`, { params: { code }}); - const response = axios.post(`${baseURL}/unity/linkUser`, body); - - return response; -}; - -export function findOne(unityId){ - const response = axios.get(`${baseURL}/unity/findUnity`, { params: { unityId }}); - return response; -}; \ No newline at end of file + return response; +} \ No newline at end of file diff --git a/riso_frontend/src/services/userToUnityServices.js b/riso_frontend/src/services/userToUnityServices.js deleted file mode 100644 index 98211f55..00000000 --- a/riso_frontend/src/services/userToUnityServices.js +++ /dev/null @@ -1,19 +0,0 @@ -import axios from 'axios'; - -const baseURL = 'http://localhost:3000'; - -export function createUserToUnity(unityIdData, emailData) { - const body = { - unityId: unityIdData, - email: emailData, - }; - - const response = axios.post(`${baseURL}/userToUnity/createUserToUnity`, body); - - return response; -}; - -export function findOne(unityId, email){ - const response = axios.get(`${baseURL}/userToUnity/findUserAndUnity`, { params: { unityId, email }}); - return response; -}; \ No newline at end of file