From cb2f12ae8ded4cd9a98dea94ab1f4406720d8f54 Mon Sep 17 00:00:00 2001 From: Jessica_Faro Date: Sat, 27 Sep 2025 19:08:40 -0300 Subject: [PATCH 1/3] landing page --- src/App.js | 30 ++++- src/pages/LandingPage.jsx | 47 ++++++++ src/pages/style/LandingPage.css | 103 ++++++++++++++++++ .../perfil_secretaria/PerfilSecretaria.jsx | 9 +- 4 files changed, 182 insertions(+), 7 deletions(-) create mode 100644 src/pages/LandingPage.jsx create mode 100644 src/pages/style/LandingPage.css diff --git a/src/App.js b/src/App.js index f6a3fe9a..02046c84 100644 --- a/src/App.js +++ b/src/App.js @@ -1,12 +1,34 @@ +// src/App.js +import React, { useState } from 'react'; import PerfilSecretaria from "./perfis/perfil_secretaria/PerfilSecretaria"; +import LandingPage from './pages/LandingPage'; +// Mantenha todas as importações de CSS globais aqui se houver! +// import './App.css'; +// import './index.css'; function App() { + // O estado controla qual view mostrar: false = Landing Page, true = Dashboard + const [isInternalView, setIsInternalView] = useState(false); + + const handleEnterSystem = () => { + setIsInternalView(true); + }; + + const handleExitSystem = () => { + setIsInternalView(false); + }; + + // Se não estiver na visualização interna, retorna a LandingPage. + if (!isInternalView) { + return ; + } + + // Se estiver na visualização interna, retorna o PerfilSecretaria return ( - <> - - + // Passamos a função de saída (logout) + ); } -export default App; +export default App; \ No newline at end of file diff --git a/src/pages/LandingPage.jsx b/src/pages/LandingPage.jsx new file mode 100644 index 00000000..bd3a16d8 --- /dev/null +++ b/src/pages/LandingPage.jsx @@ -0,0 +1,47 @@ +// src/pages/LandingPage.jsx + +import React from 'react'; +import './style/LandingPage.css'; + +const LandingPage = ({ onEnterSystem }) => { + return ( + // Usa a classe de isolamento CSS +
+ {/* CABEÇALHO */} +
+
+ {/* Logo da Landing Page. O CSS irá estilizá-la corretamente. */} +

MediConnect

+
+ +
+ + {/* ÁREA DE DESTAQUE (HERO SECTION) */} +
+
+ {/* Título Legível (Branco) */} +

+ Descubra o Equilíbrio Perfeito de
Cuidado e Tecnologia. +

+

+ Somos focados em oferecer a melhor experiência para pacientes e a gestão mais eficiente para a clínica. +

+ {/* Botão de ação principal: "Acessar Sistema" */} + +
+
+
+ ); +}; + +export default LandingPage; \ No newline at end of file diff --git a/src/pages/style/LandingPage.css b/src/pages/style/LandingPage.css new file mode 100644 index 00000000..31e9595d --- /dev/null +++ b/src/pages/style/LandingPage.css @@ -0,0 +1,103 @@ +/* src/pages/style/LandingPage.css */ + +/* O seletor .landing-page-public-view ajuda a isolar os estilos */ +.landing-page-public-view { + font-family: Arial, sans-serif; + min-height: 100vh; + background-color: #f0f2f5; +} + +/* --- Cabeçalho --- */ +.landing-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 15px 50px; + background-color: white; + box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05); + position: fixed; + width: 100%; + top: 0; + left: 0; + z-index: 1000; +} + +/* Estilo para a logo DENTRO do cabeçalho da Landing Page */ +.landing-header .logo h1 { + font-size: 1.8em; + color: #5b56f8; + font-weight: 700; + margin: 0; /* Remove margem que pode quebrar o layout */ + padding: 0; /* Remove padding */ +} + +.nav-menu a { + text-decoration: none; + color: #333; + margin-left: 25px; + font-size: 1em; + transition: color 0.2s; +} + +.nav-menu a:hover { + color: #5b56f8; +} + +.access-button { + background-color: #5b56f8; + color: white; + border: none; + padding: 8px 18px; + border-radius: 5px; + margin-left: 25px; + cursor: pointer; + font-weight: 600; +} + +/* --- Área de Destaque (Hero Section) --- */ +.hero-section { + display: flex; + justify-content: flex-start; + align-items: center; + padding: 100px 50px; + background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://picsum.photos/1200/600?random=4') center/cover; + color: white; + min-height: 600px; + padding-top: 100px; +} + +.hero-content { + max-width: 700px; + text-align: left; +} + +/* Título Branco e Legível */ +.hero-content .hero-title { + font-size: 3.5em; + font-weight: 700; + margin-bottom: 20px; + color: #ffffff; + text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); +} + +.hero-content p { + font-size: 1.2em; + margin-bottom: 30px; + color: #ddd; +} + +.main-action-button { + background-color: #5b56f8; + color: white; + border: none; + padding: 15px 30px; + border-radius: 5px; + font-size: 1.1em; + font-weight: 600; + cursor: pointer; + transition: background-color 0.3s; +} + +.main-action-button:hover { + background-color: #4540d6; +} \ No newline at end of file diff --git a/src/perfis/perfil_secretaria/PerfilSecretaria.jsx b/src/perfis/perfil_secretaria/PerfilSecretaria.jsx index 89aaa339..df37652c 100644 --- a/src/perfis/perfil_secretaria/PerfilSecretaria.jsx +++ b/src/perfis/perfil_secretaria/PerfilSecretaria.jsx @@ -1,3 +1,5 @@ +// src/perfis/perfil_secretaria/PerfilSecretaria.jsx + import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; import Sidebar from "../../components/Sidebar"; @@ -13,11 +15,12 @@ import EditPage from "../../pages/EditPage"; import DoctorDetails from "../../pages/DoctorDetails"; import DoctorEditPage from "../../pages/DoctorEditPage"; -function PerfilSecretaria() { +function PerfilSecretaria({ onLogout }) { return (
- + {/* Passamos onLogout para que o botão Sair funcione no menu */} +
} /> @@ -39,4 +42,4 @@ function PerfilSecretaria() { ); } -export default PerfilSecretaria; +export default PerfilSecretaria; \ No newline at end of file From cf11b2aaf5c54218c882c492cb1811f368b4eea5 Mon Sep 17 00:00:00 2001 From: Eduarda-SS <137419071+Eduarda-SS@users.noreply.github.com> Date: Sun, 28 Sep 2025 19:29:51 -0300 Subject: [PATCH 2/3] =?UTF-8?q?Atualiza=C3=A7=C3=B5es=20de=20login?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 29 +++++- src/assets/scss/components/_card.scss | 6 ++ src/data/sidebar-items.json | 14 +-- src/pages/ForgotPassword.jsx | 56 +++++++++++ src/pages/LandingPage.jsx | 10 +- src/pages/Login.jsx | 93 +++++++++++++++++++ src/pages/Register.jsx | 93 +++++++++++++++++++ src/pages/style/LandingPage.css | 6 +- .../perfil_secretaria/PerfilSecretaria.jsx | 18 ++-- 9 files changed, 296 insertions(+), 29 deletions(-) create mode 100644 src/pages/ForgotPassword.jsx create mode 100644 src/pages/Login.jsx create mode 100644 src/pages/Register.jsx diff --git a/src/App.js b/src/App.js index 02046c84..98be1dff 100644 --- a/src/App.js +++ b/src/App.js @@ -1,15 +1,19 @@ // src/App.js +//import PerfilSecretaria from "./perfis/perfil_secretaria/PerfilSecretaria"; +import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; +import { useState } from "react"; -import React, { useState } from 'react'; +import Login from "./pages/Login"; +import Register from "./pages/Register"; +import Forgot from "./pages/ForgotPassword"; import PerfilSecretaria from "./perfis/perfil_secretaria/PerfilSecretaria"; -import LandingPage from './pages/LandingPage'; +import LandingPage from './pages/LandingPage'; // Mantenha todas as importações de CSS globais aqui se houver! -// import './App.css'; -// import './index.css'; function App() { // O estado controla qual view mostrar: false = Landing Page, true = Dashboard const [isInternalView, setIsInternalView] = useState(false); + // const [isSecretaria, setIsSecretaria] = useState(false); const handleEnterSystem = () => { setIsInternalView(true); @@ -18,10 +22,25 @@ function App() { const handleExitSystem = () => { setIsInternalView(false); }; + + // if (isSecretaria) { + // return setIsSecretaria(false)} />; + // } // Se não estiver na visualização interna, retorna a LandingPage. if (!isInternalView) { - return ; + return ( + + + } /> + } /> + } /> + } /> + } /> + Página não encontrada} /> + + + ) } // Se estiver na visualização interna, retorna o PerfilSecretaria diff --git a/src/assets/scss/components/_card.scss b/src/assets/scss/components/_card.scss index 12a65154..2372c495 100644 --- a/src/assets/scss/components/_card.scss +++ b/src/assets/scss/components/_card.scss @@ -1,3 +1,9 @@ +.card-position { + padding-top: 1rem; + display: flex; + align-items: center; + justify-content: center; +} .card { margin-bottom: 2.2rem; border: none; diff --git a/src/data/sidebar-items.json b/src/data/sidebar-items.json index 81762b68..f6e15193 100644 --- a/src/data/sidebar-items.json +++ b/src/data/sidebar-items.json @@ -6,43 +6,43 @@ { "name":"Início", - "url": "/", + "url": "/secretaria/inicio", "icon": "house" }, { "name": "Cadastro de Pacientes", - "url": "/pacientes/cadastro", + "url": "/secretaria/pacientes/cadastro", "icon": "heart-pulse-fill" }, { "name": "Cadastro do Médico", - "url": "/medicos/cadastro", + "url": "/secretaria/medicos/cadastro", "icon": "capsule" }, { "name": "Lista de Pacientes", "icon": "clipboard-heart-fill", - "url": "/pacientes" + "url": "/secretaria/pacientes" }, { "name": "Lista de Médico", "icon": "hospital-fill", - "url": "/medicos" + "url": "/secretaria/medicos" }, { "name": "Agendar consulta", "icon": "calendar-plus-fill", - "url": "/agendamento" + "url": "/secretaria/agendamento" }, { "name": "Laudo do Paciente", "icon": "table", - "url": "/laudo" + "url": "/secretaria/laudo" } ] \ No newline at end of file diff --git a/src/pages/ForgotPassword.jsx b/src/pages/ForgotPassword.jsx new file mode 100644 index 00000000..aef00504 --- /dev/null +++ b/src/pages/ForgotPassword.jsx @@ -0,0 +1,56 @@ +import React from 'react'; +import { Link } from "react-router-dom"; + +function ForgotPassword() { +return ( + <> +
+
+
+
+
+
+ +

MediConnect

+ +
+

Esqueci minha senha

+

+ Informe seu e-mail e enviaremos um link para redefinir sua senha. +

+
+
+ +
+ +
+
+ + +
+

+ Lembrou da sua senha? + + Entrar + + . +

+
+
+
+
+
+
+
+
+ + ); +} + +export default ForgotPassword; \ No newline at end of file diff --git a/src/pages/LandingPage.jsx b/src/pages/LandingPage.jsx index bd3a16d8..2551aa9f 100644 --- a/src/pages/LandingPage.jsx +++ b/src/pages/LandingPage.jsx @@ -1,9 +1,9 @@ -// src/pages/LandingPage.jsx - import React from 'react'; +import { useNavigate } from "react-router-dom"; import './style/LandingPage.css'; -const LandingPage = ({ onEnterSystem }) => { +const LandingPage = () => { + const navigate = useNavigate(); return ( // Usa a classe de isolamento CSS
@@ -18,7 +18,7 @@ const LandingPage = ({ onEnterSystem }) => { Serviços Contato {/* Botão para entrar no sistema interno */} - @@ -35,7 +35,7 @@ const LandingPage = ({ onEnterSystem }) => { Somos focados em oferecer a melhor experiência para pacientes e a gestão mais eficiente para a clínica.

{/* Botão de ação principal: "Acessar Sistema" */} -
diff --git a/src/pages/Login.jsx b/src/pages/Login.jsx new file mode 100644 index 00000000..9d31b702 --- /dev/null +++ b/src/pages/Login.jsx @@ -0,0 +1,93 @@ +import React from 'react'; +import { Link, useNavigate } from "react-router-dom"; + +function Login() { + const navigate = useNavigate(); + const handleLogin = (e) => { + e.preventDefault(); + // ...login logic... + navigate('/secretaria/inicio'); + }; + return ( + <> +
+
+
+
+
+
+ +

MediConnect

+ +
+

Entrar

+

+ Entre com os dados que você inseriu durante o registro. +

+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + +
+ + +
+

+ Não tem uma conta? + + Cadastre-se + + . +

+

+ + Esqueceu a senha? + + . +

+
+
+
+
+
+
+
+
+ + ); +} + +export default Login; \ No newline at end of file diff --git a/src/pages/Register.jsx b/src/pages/Register.jsx new file mode 100644 index 00000000..004cb994 --- /dev/null +++ b/src/pages/Register.jsx @@ -0,0 +1,93 @@ +import React from 'react'; +import { Link, useNavigate } from "react-router-dom"; + +function Register() { + const navigate = useNavigate(); + const handleLogin = (e) => { + e.preventDefault(); + // ...login logic... + navigate('/secretaria/inicio'); + }; +return ( + <> +
+
+
+
+
+
+ +

MediConnect

+ +
+

Cadastre-se

+

+ Insira seus dados para se registrar em nosso site. +

+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ + +
+

+ Já tem uma conta? + + Entrar + + . +

+
+
+
+
+
+
+
+
+ + ); +} + +export default Register; \ No newline at end of file diff --git a/src/pages/style/LandingPage.css b/src/pages/style/LandingPage.css index 31e9595d..078ec5d2 100644 --- a/src/pages/style/LandingPage.css +++ b/src/pages/style/LandingPage.css @@ -2,7 +2,6 @@ /* O seletor .landing-page-public-view ajuda a isolar os estilos */ .landing-page-public-view { - font-family: Arial, sans-serif; min-height: 100vh; background-color: #f0f2f5; } @@ -25,7 +24,7 @@ /* Estilo para a logo DENTRO do cabeçalho da Landing Page */ .landing-header .logo h1 { font-size: 1.8em; - color: #5b56f8; + color: #25396f; font-weight: 700; margin: 0; /* Remove margem que pode quebrar o layout */ padding: 0; /* Remove padding */ @@ -42,6 +41,9 @@ .nav-menu a:hover { color: #5b56f8; } +.nav-menu button:hover { + background-color: #4540d6; +} .access-button { background-color: #5b56f8; diff --git a/src/perfis/perfil_secretaria/PerfilSecretaria.jsx b/src/perfis/perfil_secretaria/PerfilSecretaria.jsx index df37652c..a6f455ed 100644 --- a/src/perfis/perfil_secretaria/PerfilSecretaria.jsx +++ b/src/perfis/perfil_secretaria/PerfilSecretaria.jsx @@ -1,6 +1,5 @@ -// src/perfis/perfil_secretaria/PerfilSecretaria.jsx - -import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; +//import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; +import { Routes, Route } from "react-router-dom"; import Sidebar from "../../components/Sidebar"; import Inicio from "../../pages/Inicio"; @@ -15,15 +14,14 @@ import EditPage from "../../pages/EditPage"; import DoctorDetails from "../../pages/DoctorDetails"; import DoctorEditPage from "../../pages/DoctorEditPage"; -function PerfilSecretaria({ onLogout }) { +function PerfilSecretaria() { return ( - + //
- {/* Passamos onLogout para que o botão Sair funcione no menu */} - +
- } /> + } /> } /> } /> } /> @@ -38,8 +36,8 @@ function PerfilSecretaria({ onLogout }) {
-
+ //
); } -export default PerfilSecretaria; \ No newline at end of file +export default PerfilSecretaria; From a0fababf69e6915fb16276f355818eadd8fb0fcc Mon Sep 17 00:00:00 2001 From: Eduarda-SS <137419071+Eduarda-SS@users.noreply.github.com> Date: Wed, 1 Oct 2025 16:14:34 -0300 Subject: [PATCH 3/3] =?UTF-8?q?Atualiza=C3=A7=C3=B5es=2001-10-25?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 7 - src/pages/Details.jsx | 2 +- src/pages/DoctorDetails.jsx | 8 +- src/pages/DoctorTable.jsx | 10 +- src/pages/EditPage.jsx | 16 +- src/pages/ForgotPassword.jsx | 114 ++++++++----- src/pages/Inicio.jsx | 12 +- src/pages/Login.jsx | 48 +++++- src/pages/PatientCadastroManager.jsx | 11 +- src/pages/Register.jsx | 243 ++++++++++++++++++--------- src/pages/TablePaciente.jsx | 13 +- 11 files changed, 317 insertions(+), 167 deletions(-) diff --git a/src/App.js b/src/App.js index 98be1dff..99986677 100644 --- a/src/App.js +++ b/src/App.js @@ -1,5 +1,3 @@ -// src/App.js -//import PerfilSecretaria from "./perfis/perfil_secretaria/PerfilSecretaria"; import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; import { useState } from "react"; @@ -13,7 +11,6 @@ import LandingPage from './pages/LandingPage'; function App() { // O estado controla qual view mostrar: false = Landing Page, true = Dashboard const [isInternalView, setIsInternalView] = useState(false); - // const [isSecretaria, setIsSecretaria] = useState(false); const handleEnterSystem = () => { setIsInternalView(true); @@ -22,10 +19,6 @@ function App() { const handleExitSystem = () => { setIsInternalView(false); }; - - // if (isSecretaria) { - // return setIsSecretaria(false)} />; - // } // Se não estiver na visualização interna, retorna a LandingPage. if (!isInternalView) { diff --git a/src/pages/Details.jsx b/src/pages/Details.jsx index 1f6b317d..ef12a20f 100644 --- a/src/pages/Details.jsx +++ b/src/pages/Details.jsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from "react"; import avatarPlaceholder from '../assets/images/avatar_placeholder.png'; -const Details = ({ patientID, setCurrentPage }) => { +const Details = ({ patientID }) => { const [paciente, setPaciente] = useState({}); const [anexos, setAnexos] = useState([]); const [selectedFile, setSelectedFile] = useState(null); diff --git a/src/pages/DoctorDetails.jsx b/src/pages/DoctorDetails.jsx index c8b77268..1f14aaa1 100644 --- a/src/pages/DoctorDetails.jsx +++ b/src/pages/DoctorDetails.jsx @@ -1,7 +1,9 @@ import React, { useEffect, useState } from "react"; import avatarPlaceholder from '../assets/images/avatar_placeholder.png'; +import { useNavigate } from "react-router-dom"; -const Details = ({ patientID, setCurrentPage }) => { +const Details = ({ patientID }) => { + const navigate = useNavigate(); const [paciente, setPaciente] = useState({}); useEffect(() => { @@ -21,7 +23,7 @@ const Details = ({ patientID, setCurrentPage }) => {

MediConnect


-
@@ -33,7 +35,7 @@ const Details = ({ patientID, setCurrentPage }) => {

{paciente.cpf || "CPF"}

-
diff --git a/src/pages/DoctorTable.jsx b/src/pages/DoctorTable.jsx index 549c37e8..1b078713 100644 --- a/src/pages/DoctorTable.jsx +++ b/src/pages/DoctorTable.jsx @@ -1,6 +1,8 @@ import React, { useState, useEffect } from "react"; +import { useNavigate } from "react-router-dom"; -function TableDoctor({ setCurrentPage, setPatientID }) { +function TableDoctor({ setPatientID }) { +const navigate = useNavigate(); const [medicos, setMedicos] = useState([]); const [search, setSearch] = useState(""); const [filtroAniversariante, setFiltroAniversariante] = useState(false); @@ -70,7 +72,7 @@ function TableDoctor({ setCurrentPage, setPatientID }) {

Médicos Cadastrados

@@ -141,7 +143,7 @@ function TableDoctor({ setCurrentPage, setPatientID }) { color: "#004085", }} onClick={() => { - setCurrentPage("details-page-paciente"); + navigate(`/secretaria/medicos/${medico.id}`); setPatientID(medico.id); }} > @@ -157,7 +159,7 @@ function TableDoctor({ setCurrentPage, setPatientID }) { color: "#856404", }} onClick={() => { - setCurrentPage("edit-page-paciente"); + navigate(`/secretaria/medicos/${medico.id}/edit`); setPatientID(medico.id); }} > diff --git a/src/pages/EditPage.jsx b/src/pages/EditPage.jsx index 1b946208..7360f173 100644 --- a/src/pages/EditPage.jsx +++ b/src/pages/EditPage.jsx @@ -1,11 +1,10 @@ -import React from 'react' - -import PatientForm from '../components/patients/PatientForm' - -import {useEffect, useState} from 'react' - -const EditPage = ( {id, setCurrentPage}) => { +import React from 'react'; +import { useNavigate } from 'react-router-dom'; +import PatientForm from '../components/patients/PatientForm'; +import {useEffect, useState} from 'react'; +function EditPage({id}) { + const navigate = useNavigate(); const [PatientToPUT, setPatientPUT] = useState({}) var requestOptions = { @@ -66,8 +65,7 @@ const HandlePutPatient = async () => { {setCurrentPage('table')}} - setCurrentPage={setCurrentPage} + onCancel={() => {navigate('/secretaria/pacientes')}} formData={PatientToPUT} setFormData={setPatientPUT} /> diff --git a/src/pages/ForgotPassword.jsx b/src/pages/ForgotPassword.jsx index aef00504..787b4745 100644 --- a/src/pages/ForgotPassword.jsx +++ b/src/pages/ForgotPassword.jsx @@ -1,56 +1,82 @@ -import React from 'react'; +import React, { useState } from 'react'; import { Link } from "react-router-dom"; function ForgotPassword() { -return ( - <> -
-
-
-
-
-
- -

MediConnect

- -
-

Esqueci minha senha

-

- Informe seu e-mail e enviaremos um link para redefinir sua senha. -

-
-
- -
- -
+ const [email, setEmail] = useState(""); + const [alert, setAlert] = useState(""); + + const handleChange = (e) => { + setEmail(e.target.value); + }; + + const handleSubmit = (e) => { + e.preventDefault(); + if (email) { + // Simulate sending email + setAlert("E-mail de verificação enviado!"); + // You can add your actual email logic here + } else { + setAlert("Preencha o campo de e-mail!"); + } + }; + + return ( + <> +
+
+
+
+
+
+ +

MediConnect

+
- - -
-

- Lembrou da sua senha? - - Entrar - - . +

Esqueci minha senha

+

+ Informe seu e-mail e enviaremos um link para redefinir sua senha.

+ {alert && ( +
+ {alert} +
+ )} +
+
+ +
+ +
+
+ + +
+

+ Lembrou da sua senha? + + Entrar + + . +

+
+
+
+
-
-
-
-
- - ); + + ); } export default ForgotPassword; \ No newline at end of file diff --git a/src/pages/Inicio.jsx b/src/pages/Inicio.jsx index dc47fae1..e5988c26 100644 --- a/src/pages/Inicio.jsx +++ b/src/pages/Inicio.jsx @@ -1,8 +1,10 @@ import React, { useState, useEffect } from 'react'; +import { useNavigate } from 'react-router-dom'; import { FaUser, FaUserPlus, FaCalendarAlt, FaCalendarCheck } from 'react-icons/fa'; import './style/Inicio.css'; -function Inicio({ setCurrentPage }) { +function Inicio() { + const navigate = useNavigate(); const [pacientes, setPacientes] = useState([]); const [agendamentos, setAgendamentos] = useState([]); @@ -87,21 +89,21 @@ function Inicio({ setCurrentPage }) {

Ações Rápidas

-
setCurrentPage('form-layout')}> +
navigate('/secretaria/pacientes/cadastro')}>
Novo Paciente Cadastrar um novo paciente
-
setCurrentPage('table')}> +
navigate('/secretaria/pacientes')}>
Lista de Pacientes Ver todos os pacientes
-
setCurrentPage('agendamento')}> +
navigate('/secretaria/agendamento')}>
Agendamentos @@ -126,7 +128,7 @@ function Inicio({ setCurrentPage }) {

Nenhum agendamento para hoje

-
diff --git a/src/pages/Login.jsx b/src/pages/Login.jsx index 9d31b702..86c5ffed 100644 --- a/src/pages/Login.jsx +++ b/src/pages/Login.jsx @@ -1,13 +1,29 @@ -import React from 'react'; +import React, { useState } from 'react'; import { Link, useNavigate } from "react-router-dom"; function Login() { const navigate = useNavigate(); + const [form, setForm] = useState({ + username: "", + password: "" + }); + const [alert, setAlert] = useState(""); + const [showPassword, setShowPassword] = useState(false); + + const handleChange = (e) => { + setForm({ ...form, [e.target.name]: e.target.value }); + }; + const handleLogin = (e) => { e.preventDefault(); - // ...login logic... - navigate('/secretaria/inicio'); + if (form.username && form.password) { + // ...login logic... + navigate('/secretaria/inicio'); + } else { + setAlert("Preencha todos os campos!"); + } }; + return ( <>
@@ -24,12 +40,21 @@ function Login() {

Entre com os dados que você inseriu durante o registro.

-
+ {alert && ( +
+ {alert} +
+ )} +
@@ -37,13 +62,26 @@ function Login() {
+
{setCurrentPage('table')}} + onCancel={() => {navigate('/secretaria/pacientes')}} formData={formData} setFormData={setFormData} /> diff --git a/src/pages/Register.jsx b/src/pages/Register.jsx index 004cb994..b1a6c0f5 100644 --- a/src/pages/Register.jsx +++ b/src/pages/Register.jsx @@ -1,93 +1,182 @@ -import React from 'react'; +import React, { useState } from 'react'; import { Link, useNavigate } from "react-router-dom"; function Register() { const navigate = useNavigate(); + const [form, setForm] = useState({ + email: "", + username: "", + userType: "", + password: "", + confirmPassword: "" + }); + const [alert, setAlert] = useState(""); + const [showPassword, setShowPassword] = useState(false); + const [showConfirmPassword, setShowConfirmPassword] = useState(false); + + const handleChange = (e) => { + setForm({ ...form, [e.target.name]: e.target.value }); + }; + const handleLogin = (e) => { e.preventDefault(); - // ...login logic... - navigate('/secretaria/inicio'); + if ( + form.email && + form.username && + form.userType && + form.password && + form.confirmPassword + ) { + if (form.password !== form.confirmPassword) { + setAlert("As senhas não coincidem!"); + return; + } + // ...register logic... + navigate('/secretaria/inicio'); + } else { + setAlert("Preencha todos os campos!"); + } }; -return ( - <> -
-
-
-
-
-
- -

MediConnect

- -
-

Cadastre-se

-

- Insira seus dados para se registrar em nosso site. -

- -
- -
- -
+ + return ( + <> +
+
+
+
+
+
+ +

MediConnect

+
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
- - -
-

- Já tem uma conta? - - Entrar - - . +

Cadastre-se

+

+ Insira seus dados para se registrar em nosso site.

+ {alert && ( +
+ {alert} +
+ )} +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+ + +
+

+ Já tem uma conta? + + Entrar + + . +

+
+
+
+
-
-
-
-
- - ); + + ); } export default Register; \ No newline at end of file diff --git a/src/pages/TablePaciente.jsx b/src/pages/TablePaciente.jsx index ace66860..99352f66 100644 --- a/src/pages/TablePaciente.jsx +++ b/src/pages/TablePaciente.jsx @@ -1,7 +1,8 @@ import React, { useState, useEffect } from "react"; -import { Link } from "react-router-dom"; +import { Link, useNavigate } from "react-router-dom"; -function TablePaciente({ setCurrentPage, setPatientID }) { +function TablePaciente({ setPatientID }) { + const navigate = useNavigate(); const [pacientes, setPacientes] = useState([]); const [search, setSearch] = useState(""); const [filtroConvenio, setFiltroConvenio] = useState("Todos"); @@ -128,10 +129,9 @@ function TablePaciente({ setCurrentPage, setPatientID }) {

Pacientes Cadastrados

- + @@ -245,13 +245,12 @@ function TablePaciente({ setCurrentPage, setPatientID }) { color: "#004085", }} onClick={() => { - setCurrentPage("details-page-paciente"); + navigate(`/secretaria/pacientes/${paciente.id}`); setPatientID(paciente.id); }} > Ver Detalhes -