forked from RiseUP/riseup-squad23
Atualizações 01-10-25
This commit is contained in:
parent
cf11b2aaf5
commit
a0fababf69
@ -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 { BrowserRouter as Router, Routes, Route } from "react-router-dom";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
@ -13,7 +11,6 @@ import LandingPage from './pages/LandingPage';
|
|||||||
function App() {
|
function App() {
|
||||||
// O estado controla qual view mostrar: false = Landing Page, true = Dashboard
|
// O estado controla qual view mostrar: false = Landing Page, true = Dashboard
|
||||||
const [isInternalView, setIsInternalView] = useState(false);
|
const [isInternalView, setIsInternalView] = useState(false);
|
||||||
// const [isSecretaria, setIsSecretaria] = useState(false);
|
|
||||||
|
|
||||||
const handleEnterSystem = () => {
|
const handleEnterSystem = () => {
|
||||||
setIsInternalView(true);
|
setIsInternalView(true);
|
||||||
@ -22,10 +19,6 @@ function App() {
|
|||||||
const handleExitSystem = () => {
|
const handleExitSystem = () => {
|
||||||
setIsInternalView(false);
|
setIsInternalView(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
// if (isSecretaria) {
|
|
||||||
// return <PerfilSecretaria onLogout={() => setIsSecretaria(false)} />;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Se não estiver na visualização interna, retorna a LandingPage.
|
// Se não estiver na visualização interna, retorna a LandingPage.
|
||||||
if (!isInternalView) {
|
if (!isInternalView) {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import avatarPlaceholder from '../assets/images/avatar_placeholder.png';
|
import avatarPlaceholder from '../assets/images/avatar_placeholder.png';
|
||||||
|
|
||||||
const Details = ({ patientID, setCurrentPage }) => {
|
const Details = ({ patientID }) => {
|
||||||
const [paciente, setPaciente] = useState({});
|
const [paciente, setPaciente] = useState({});
|
||||||
const [anexos, setAnexos] = useState([]);
|
const [anexos, setAnexos] = useState([]);
|
||||||
const [selectedFile, setSelectedFile] = useState(null);
|
const [selectedFile, setSelectedFile] = useState(null);
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import avatarPlaceholder from '../assets/images/avatar_placeholder.png';
|
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({});
|
const [paciente, setPaciente] = useState({});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -21,7 +23,7 @@ const Details = ({ patientID, setCurrentPage }) => {
|
|||||||
<h3 className="mb-3 text-center">MediConnect</h3>
|
<h3 className="mb-3 text-center">MediConnect</h3>
|
||||||
<hr />
|
<hr />
|
||||||
<div className="d-flex justify-content-between align-items-center mb-3">
|
<div className="d-flex justify-content-between align-items-center mb-3">
|
||||||
<button className="btn btn-success me-2" onClick={() => setCurrentPage("table")}>
|
<button className="btn btn-success me-2" onClick={() => navigate("/secretaria/pacientes")}>
|
||||||
<i className="bi bi-chevron-left"></i> Voltar
|
<i className="bi bi-chevron-left"></i> Voltar
|
||||||
</button>
|
</button>
|
||||||
<div className="d-flex mb-3">
|
<div className="d-flex mb-3">
|
||||||
@ -33,7 +35,7 @@ const Details = ({ patientID, setCurrentPage }) => {
|
|||||||
<p>{paciente.cpf || "CPF"}</p>
|
<p>{paciente.cpf || "CPF"}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button className="btn btn-light" onClick={() => setCurrentPage("edit-page-doctor")}>
|
<button className="btn btn-light" onClick={() => navigate(`/secretaria/medicos/${paciente.id}/edit`)}>
|
||||||
<i className="bi bi-pencil-square"></i> Editar
|
<i className="bi bi-pencil-square"></i> Editar
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
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 [medicos, setMedicos] = useState([]);
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
const [filtroAniversariante, setFiltroAniversariante] = useState(false);
|
const [filtroAniversariante, setFiltroAniversariante] = useState(false);
|
||||||
@ -70,7 +72,7 @@ function TableDoctor({ setCurrentPage, setPatientID }) {
|
|||||||
<h4 className="card-title mb-0">Médicos Cadastrados</h4>
|
<h4 className="card-title mb-0">Médicos Cadastrados</h4>
|
||||||
<button
|
<button
|
||||||
className="btn btn-primary"
|
className="btn btn-primary"
|
||||||
onClick={() => setCurrentPage("form-layout")}
|
onClick={() => navigate("/secretaria/medicos/cadastro")}
|
||||||
>
|
>
|
||||||
<i className="bi bi-plus-circle"></i> Adicionar Médico
|
<i className="bi bi-plus-circle"></i> Adicionar Médico
|
||||||
</button>
|
</button>
|
||||||
@ -141,7 +143,7 @@ function TableDoctor({ setCurrentPage, setPatientID }) {
|
|||||||
color: "#004085",
|
color: "#004085",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCurrentPage("details-page-paciente");
|
navigate(`/secretaria/medicos/${medico.id}`);
|
||||||
setPatientID(medico.id);
|
setPatientID(medico.id);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -157,7 +159,7 @@ function TableDoctor({ setCurrentPage, setPatientID }) {
|
|||||||
color: "#856404",
|
color: "#856404",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCurrentPage("edit-page-paciente");
|
navigate(`/secretaria/medicos/${medico.id}/edit`);
|
||||||
setPatientID(medico.id);
|
setPatientID(medico.id);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -1,11 +1,10 @@
|
|||||||
import React from 'react'
|
import React from 'react';
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
import PatientForm from '../components/patients/PatientForm'
|
import PatientForm from '../components/patients/PatientForm';
|
||||||
|
import {useEffect, useState} from 'react';
|
||||||
import {useEffect, useState} from 'react'
|
|
||||||
|
|
||||||
const EditPage = ( {id, setCurrentPage}) => {
|
|
||||||
|
|
||||||
|
function EditPage({id}) {
|
||||||
|
const navigate = useNavigate();
|
||||||
const [PatientToPUT, setPatientPUT] = useState({})
|
const [PatientToPUT, setPatientPUT] = useState({})
|
||||||
|
|
||||||
var requestOptions = {
|
var requestOptions = {
|
||||||
@ -66,8 +65,7 @@ const HandlePutPatient = async () => {
|
|||||||
|
|
||||||
<PatientForm
|
<PatientForm
|
||||||
onSave={HandlePutPatient}
|
onSave={HandlePutPatient}
|
||||||
onCancel={() => {setCurrentPage('table')}}
|
onCancel={() => {navigate('/secretaria/pacientes')}}
|
||||||
setCurrentPage={setCurrentPage}
|
|
||||||
formData={PatientToPUT}
|
formData={PatientToPUT}
|
||||||
setFormData={setPatientPUT}
|
setFormData={setPatientPUT}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -1,56 +1,82 @@
|
|||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
function ForgotPassword() {
|
function ForgotPassword() {
|
||||||
return (
|
const [email, setEmail] = useState("");
|
||||||
<>
|
const [alert, setAlert] = useState("");
|
||||||
<div className="mt-3 card-position">
|
|
||||||
<div className="col-lg-5 col-12">
|
const handleChange = (e) => {
|
||||||
<div className="card shadow-sm d-flex justify-content-between align-items-center">
|
setEmail(e.target.value);
|
||||||
<div id="auth-left">
|
};
|
||||||
<div className="auth-logo">
|
|
||||||
<br />
|
const handleSubmit = (e) => {
|
||||||
<Link to="/">
|
e.preventDefault();
|
||||||
<h1 className="mb-4 text-center">MediConnect</h1>
|
if (email) {
|
||||||
</Link>
|
// Simulate sending email
|
||||||
</div>
|
setAlert("E-mail de verificação enviado!");
|
||||||
<h3 className="auth-title">Esqueci minha senha</h3>
|
// You can add your actual email logic here
|
||||||
<p className="auth-subtitle mb-5">
|
} else {
|
||||||
Informe seu e-mail e enviaremos um link para redefinir sua senha.
|
setAlert("Preencha o campo de e-mail!");
|
||||||
</p>
|
}
|
||||||
<form action="index.html">
|
};
|
||||||
<div className="form-group position-relative has-icon-left mb-4">
|
|
||||||
<input
|
return (
|
||||||
type="email"
|
<>
|
||||||
className="form-control form-control-xl"
|
<div className="mt-3 card-position">
|
||||||
placeholder="E-mail"
|
<div className="col-lg-5 col-12">
|
||||||
/>
|
<div className="card shadow-sm d-flex justify-content-between align-items-center">
|
||||||
<div className="form-control-icon">
|
<div id="auth-left">
|
||||||
<i className="bi bi-envelope" />
|
<div className="auth-logo">
|
||||||
</div>
|
<br />
|
||||||
|
<Link to="/">
|
||||||
|
<h1 className="mb-4 text-center">MediConnect</h1>
|
||||||
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
<button className="btn btn-primary btn-block btn-lg shadow-lg mt-5">
|
<h3 className="auth-title">Esqueci minha senha</h3>
|
||||||
Enviar
|
<p className="auth-subtitle mb-5">
|
||||||
</button>
|
Informe seu e-mail e enviaremos um link para redefinir sua senha.
|
||||||
</form>
|
|
||||||
<div className="text-center mt-5 text-lg fs-4">
|
|
||||||
<p className="text-gray-600">
|
|
||||||
Lembrou da sua senha?
|
|
||||||
<Link className="font-bold" to={'/login'}>
|
|
||||||
Entrar
|
|
||||||
</Link>
|
|
||||||
.
|
|
||||||
</p>
|
</p>
|
||||||
|
{alert && (
|
||||||
|
<div className="alert alert-info" role="alert">
|
||||||
|
{alert}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<form onSubmit={handleSubmit}>
|
||||||
|
<div className="form-group position-relative has-icon-left mb-4">
|
||||||
|
<input
|
||||||
|
type="email"
|
||||||
|
className="form-control form-control-xl"
|
||||||
|
placeholder="E-mail"
|
||||||
|
value={email}
|
||||||
|
onChange={handleChange}
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<div className="form-control-icon">
|
||||||
|
<i className="bi bi-envelope" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button className="btn btn-primary btn-block btn-lg shadow-lg mt-5">
|
||||||
|
Enviar
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<div className="text-center mt-5 text-lg fs-4">
|
||||||
|
<p className="text-gray-600">
|
||||||
|
Lembrou da sua senha?
|
||||||
|
<Link className="font-bold" to={'/login'}>
|
||||||
|
Entrar
|
||||||
|
</Link>
|
||||||
|
.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="col-lg-7 d-none d-lg-block">
|
||||||
|
<div id="auth-right"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div className="col-lg-7 d-none d-lg-block">
|
|
||||||
<div id="auth-right"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</>
|
||||||
</>
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ForgotPassword;
|
export default ForgotPassword;
|
||||||
@ -1,8 +1,10 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { FaUser, FaUserPlus, FaCalendarAlt, FaCalendarCheck } from 'react-icons/fa';
|
import { FaUser, FaUserPlus, FaCalendarAlt, FaCalendarCheck } from 'react-icons/fa';
|
||||||
import './style/Inicio.css';
|
import './style/Inicio.css';
|
||||||
|
|
||||||
function Inicio({ setCurrentPage }) {
|
function Inicio() {
|
||||||
|
const navigate = useNavigate();
|
||||||
const [pacientes, setPacientes] = useState([]);
|
const [pacientes, setPacientes] = useState([]);
|
||||||
const [agendamentos, setAgendamentos] = useState([]);
|
const [agendamentos, setAgendamentos] = useState([]);
|
||||||
|
|
||||||
@ -87,21 +89,21 @@ function Inicio({ setCurrentPage }) {
|
|||||||
<div className="quick-actions">
|
<div className="quick-actions">
|
||||||
<h2>Ações Rápidas</h2>
|
<h2>Ações Rápidas</h2>
|
||||||
<div className="actions-grid">
|
<div className="actions-grid">
|
||||||
<div className="action-button" onClick={() => setCurrentPage('form-layout')}>
|
<div className="action-button" onClick={() => navigate('/secretaria/pacientes/cadastro')}>
|
||||||
<FaUserPlus className="action-icon" />
|
<FaUserPlus className="action-icon" />
|
||||||
<div className="action-info">
|
<div className="action-info">
|
||||||
<span className="action-title">Novo Paciente</span>
|
<span className="action-title">Novo Paciente</span>
|
||||||
<span className="action-desc">Cadastrar um novo paciente</span>
|
<span className="action-desc">Cadastrar um novo paciente</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="action-button" onClick={() => setCurrentPage('table')}>
|
<div className="action-button" onClick={() => navigate('/secretaria/pacientes')}>
|
||||||
<FaUser className="action-icon" />
|
<FaUser className="action-icon" />
|
||||||
<div className="action-info">
|
<div className="action-info">
|
||||||
<span className="action-title">Lista de Pacientes</span>
|
<span className="action-title">Lista de Pacientes</span>
|
||||||
<span className="action-desc">Ver todos os pacientes</span>
|
<span className="action-desc">Ver todos os pacientes</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="action-button" onClick={() => setCurrentPage('agendamento')}>
|
<div className="action-button" onClick={() => navigate('/secretaria/agendamento')}>
|
||||||
<FaCalendarCheck className="action-icon" />
|
<FaCalendarCheck className="action-icon" />
|
||||||
<div className="action-info">
|
<div className="action-info">
|
||||||
<span className="action-title">Agendamentos</span>
|
<span className="action-title">Agendamentos</span>
|
||||||
@ -126,7 +128,7 @@ function Inicio({ setCurrentPage }) {
|
|||||||
<div className="no-appointments-content">
|
<div className="no-appointments-content">
|
||||||
<FaCalendarCheck className="no-appointments-icon" />
|
<FaCalendarCheck className="no-appointments-icon" />
|
||||||
<p>Nenhum agendamento para hoje</p>
|
<p>Nenhum agendamento para hoje</p>
|
||||||
<button className="manage-button" onClick={() => setCurrentPage('agendamento')}>
|
<button className="manage-button" onClick={() => navigate('/secretaria/agendamento')}>
|
||||||
Gerenciar Agendamentos
|
Gerenciar Agendamentos
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,13 +1,29 @@
|
|||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
function Login() {
|
function Login() {
|
||||||
const navigate = useNavigate();
|
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) => {
|
const handleLogin = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
// ...login logic...
|
if (form.username && form.password) {
|
||||||
navigate('/secretaria/inicio');
|
// ...login logic...
|
||||||
|
navigate('/secretaria/inicio');
|
||||||
|
} else {
|
||||||
|
setAlert("Preencha todos os campos!");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="mt-3 card-position">
|
<div className="mt-3 card-position">
|
||||||
@ -24,12 +40,21 @@ function Login() {
|
|||||||
<p className="auth-subtitle mb-5">
|
<p className="auth-subtitle mb-5">
|
||||||
Entre com os dados que você inseriu durante o registro.
|
Entre com os dados que você inseriu durante o registro.
|
||||||
</p>
|
</p>
|
||||||
<form action="index.html">
|
{alert && (
|
||||||
|
<div className="alert alert-info" role="alert">
|
||||||
|
{alert}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<form>
|
||||||
<div className="form-group position-relative has-icon-left mb-4">
|
<div className="form-group position-relative has-icon-left mb-4">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
|
name="username"
|
||||||
className="form-control form-control-xl"
|
className="form-control form-control-xl"
|
||||||
placeholder="Username"
|
placeholder="Username"
|
||||||
|
value={form.username}
|
||||||
|
onChange={handleChange}
|
||||||
|
required
|
||||||
/>
|
/>
|
||||||
<div className="form-control-icon">
|
<div className="form-control-icon">
|
||||||
<i className="bi bi-person" />
|
<i className="bi bi-person" />
|
||||||
@ -37,13 +62,26 @@ function Login() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="form-group position-relative has-icon-left mb-4">
|
<div className="form-group position-relative has-icon-left mb-4">
|
||||||
<input
|
<input
|
||||||
type="password"
|
type={showPassword ? "text" : "password"}
|
||||||
|
name="password"
|
||||||
className="form-control form-control-xl"
|
className="form-control form-control-xl"
|
||||||
placeholder="Password"
|
placeholder="Password"
|
||||||
|
value={form.password}
|
||||||
|
onChange={handleChange}
|
||||||
|
required
|
||||||
/>
|
/>
|
||||||
<div className="form-control-icon">
|
<div className="form-control-icon">
|
||||||
<i className="bi bi-shield-lock" />
|
<i className="bi bi-shield-lock" />
|
||||||
</div>
|
</div>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="btn btn-sm"
|
||||||
|
style={{ position: "absolute", right: "10px", top: "10px", background: "none", border: "none" }}
|
||||||
|
onClick={() => setShowPassword(!showPassword)}
|
||||||
|
tabIndex={-1}
|
||||||
|
>
|
||||||
|
<i className={`bi ${showPassword ? "bi-eye-slash" : "bi-eye"}`}></i>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="form-check form-check-lg d-flex align-items-end">
|
<div className="form-check form-check-lg d-flex align-items-end">
|
||||||
<input
|
<input
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
import {useState} from 'react';
|
import {useState} from 'react';
|
||||||
|
import React from 'react';
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
import PatientForm from '../components/patients/PatientForm';
|
import PatientForm from '../components/patients/PatientForm';
|
||||||
|
|
||||||
function PatientCadastroManager( {setCurrentPage} ) {
|
function PatientCadastroManager() {
|
||||||
|
const [formData, setFormData] = useState({});
|
||||||
|
const navigate = useNavigate();
|
||||||
const [formData, setFormData] = useState({})
|
|
||||||
var myHeaders = new Headers();
|
var myHeaders = new Headers();
|
||||||
myHeaders.append("Content-Type", "application/json");
|
myHeaders.append("Content-Type", "application/json");
|
||||||
|
|
||||||
@ -50,7 +51,7 @@ function PatientCadastroManager( {setCurrentPage} ) {
|
|||||||
|
|
||||||
<PatientForm
|
<PatientForm
|
||||||
onSave={handleSavePatient}
|
onSave={handleSavePatient}
|
||||||
onCancel={() => {setCurrentPage('table')}}
|
onCancel={() => {navigate('/secretaria/pacientes')}}
|
||||||
formData={formData}
|
formData={formData}
|
||||||
setFormData={setFormData}
|
setFormData={setFormData}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -1,93 +1,182 @@
|
|||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
|
|
||||||
function Register() {
|
function Register() {
|
||||||
const navigate = useNavigate();
|
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) => {
|
const handleLogin = (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
// ...login logic...
|
if (
|
||||||
navigate('/secretaria/inicio');
|
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 (
|
|
||||||
<>
|
return (
|
||||||
<div className="mt-3 card-position">
|
<>
|
||||||
<div className="col-lg-5 col-12">
|
<div className="mt-3 card-position">
|
||||||
<div className="card shadow-sm d-flex justify-content-between align-items-center">
|
<div className="col-lg-5 col-12">
|
||||||
<div id="auth-left">
|
<div className="card shadow-sm d-flex justify-content-between align-items-center">
|
||||||
<div className="auth-logo">
|
<div id="auth-left">
|
||||||
<br />
|
<div className="auth-logo">
|
||||||
<Link to="/">
|
<br />
|
||||||
<h1 className="mb-4 text-center">MediConnect</h1>
|
<Link to="/">
|
||||||
</Link>
|
<h1 className="mb-4 text-center">MediConnect</h1>
|
||||||
</div>
|
</Link>
|
||||||
<h3 className="auth-title">Cadastre-se</h3>
|
|
||||||
<p className="auth-subtitle mb-5">
|
|
||||||
Insira seus dados para se registrar em nosso site.
|
|
||||||
</p>
|
|
||||||
<form action="index.html">
|
|
||||||
<div className="form-group position-relative has-icon-left mb-4">
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
className="form-control form-control-xl"
|
|
||||||
placeholder="E-mail"
|
|
||||||
/>
|
|
||||||
<div className="form-control-icon">
|
|
||||||
<i className="bi bi-envelope" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="form-group position-relative has-icon-left mb-4">
|
<h3 className="auth-title">Cadastre-se</h3>
|
||||||
<input
|
<p className="auth-subtitle mb-5">
|
||||||
type="text"
|
Insira seus dados para se registrar em nosso site.
|
||||||
className="form-control form-control-xl"
|
|
||||||
placeholder="Nome de usuário"
|
|
||||||
/>
|
|
||||||
<div className="form-control-icon">
|
|
||||||
<i className="bi bi-person" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="form-group position-relative has-icon-left mb-4">
|
|
||||||
<input
|
|
||||||
type="password"
|
|
||||||
className="form-control form-control-xl"
|
|
||||||
placeholder="Senha"
|
|
||||||
/>
|
|
||||||
<div className="form-control-icon">
|
|
||||||
<i className="bi bi-shield-lock" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="form-group position-relative has-icon-left mb-4">
|
|
||||||
<input
|
|
||||||
type="password"
|
|
||||||
className="form-control form-control-xl"
|
|
||||||
placeholder="Confirmar senha"
|
|
||||||
/>
|
|
||||||
<div className="form-control-icon">
|
|
||||||
<i className="bi bi-shield-lock" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<button className="btn btn-primary btn-block btn-lg shadow-lg mt-5"
|
|
||||||
onClick={handleLogin}>
|
|
||||||
Cadastrar
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
<div className="text-center mt-5 text-lg fs-4">
|
|
||||||
<p className="text-gray-600">
|
|
||||||
Já tem uma conta?
|
|
||||||
<Link className="font-bold" to={'/login'}>
|
|
||||||
Entrar
|
|
||||||
</Link>
|
|
||||||
.
|
|
||||||
</p>
|
</p>
|
||||||
|
{alert && (
|
||||||
|
<div className="alert alert-info" role="alert">
|
||||||
|
{alert}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<form>
|
||||||
|
<div className="form-group position-relative has-icon-left mb-4">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="email"
|
||||||
|
className="form-control form-control-xl"
|
||||||
|
placeholder="E-mail"
|
||||||
|
value={form.email}
|
||||||
|
onChange={handleChange}
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<div className="form-control-icon">
|
||||||
|
<i className="bi bi-envelope" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="form-group position-relative has-icon-left mb-4">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="username"
|
||||||
|
className="form-control form-control-xl"
|
||||||
|
placeholder="Nome de usuário"
|
||||||
|
value={form.username}
|
||||||
|
onChange={handleChange}
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<div className="form-control-icon">
|
||||||
|
<i className="bi bi-person" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="form-group position-relative has-icon-left mb-4">
|
||||||
|
<select
|
||||||
|
name="userType"
|
||||||
|
className="form-control form-control-xl"
|
||||||
|
value={form.userType}
|
||||||
|
onChange={handleChange}
|
||||||
|
required
|
||||||
|
>
|
||||||
|
<option value="" disabled>
|
||||||
|
Selecione o tipo de usuário
|
||||||
|
</option>
|
||||||
|
<option value="paciente">Paciente</option>
|
||||||
|
<option value="secretaria">Secretaria</option>
|
||||||
|
<option value="medico">Médico</option>
|
||||||
|
<option value="admin">Admin</option>
|
||||||
|
</select>
|
||||||
|
<div className="form-control-icon">
|
||||||
|
<i className="bi bi-person" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="form-group position-relative has-icon-left mb-4">
|
||||||
|
<input
|
||||||
|
type={showPassword ? "text" : "password"}
|
||||||
|
name="password"
|
||||||
|
className="form-control form-control-xl"
|
||||||
|
placeholder="Senha"
|
||||||
|
value={form.password}
|
||||||
|
onChange={handleChange}
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<div className="form-control-icon">
|
||||||
|
<i className="bi bi-shield-lock" />
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="btn btn-sm"
|
||||||
|
style={{ position: "absolute", right: "10px", top: "10px", background: "none", border: "none" }}
|
||||||
|
onClick={() => setShowPassword(!showPassword)}
|
||||||
|
tabIndex={-1}
|
||||||
|
>
|
||||||
|
<i className={`bi ${showPassword ? "bi-eye-slash" : "bi-eye"}`}></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="form-group position-relative has-icon-left mb-4">
|
||||||
|
<input
|
||||||
|
type={showConfirmPassword ? "text" : "password"}
|
||||||
|
name="confirmPassword"
|
||||||
|
className="form-control form-control-xl"
|
||||||
|
placeholder="Confirmar senha"
|
||||||
|
value={form.confirmPassword}
|
||||||
|
onChange={handleChange}
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<div className="form-control-icon">
|
||||||
|
<i className="bi bi-shield-lock" />
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="btn btn-sm"
|
||||||
|
style={{ position: "absolute", right: "10px", top: "10px", background: "none", border: "none" }}
|
||||||
|
onClick={() => setShowConfirmPassword(!showConfirmPassword)}
|
||||||
|
tabIndex={-1}
|
||||||
|
>
|
||||||
|
<i className={`bi ${showConfirmPassword ? "bi-eye-slash" : "bi-eye"}`}></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<button className="btn btn-primary btn-block btn-lg shadow-lg mt-5"
|
||||||
|
onClick={handleLogin}>
|
||||||
|
Cadastrar
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
<div className="text-center mt-5 text-lg fs-4">
|
||||||
|
<p className="text-gray-600">
|
||||||
|
Já tem uma conta?
|
||||||
|
<Link className="font-bold" to={'/login'}>
|
||||||
|
Entrar
|
||||||
|
</Link>
|
||||||
|
.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="col-lg-7 d-none d-lg-block">
|
||||||
|
<div id="auth-right"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div className="col-lg-7 d-none d-lg-block">
|
|
||||||
<div id="auth-right"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</>
|
||||||
</>
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Register;
|
export default Register;
|
||||||
@ -1,7 +1,8 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
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 [pacientes, setPacientes] = useState([]);
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
const [filtroConvenio, setFiltroConvenio] = useState("Todos");
|
const [filtroConvenio, setFiltroConvenio] = useState("Todos");
|
||||||
@ -128,10 +129,9 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
<div className="card">
|
<div className="card">
|
||||||
<div className="card-header d-flex justify-content-between align-items-center">
|
<div className="card-header d-flex justify-content-between align-items-center">
|
||||||
<h4 className="card-title mb-0">Pacientes Cadastrados</h4>
|
<h4 className="card-title mb-0">Pacientes Cadastrados</h4>
|
||||||
<Link to={'/pacientes/cadastro'}>
|
<Link to={'/secretaria/pacientes/cadastro'}>
|
||||||
<button
|
<button
|
||||||
className="btn btn-primary"
|
className="btn btn-primary"
|
||||||
|
|
||||||
>
|
>
|
||||||
<i className="bi bi-plus-circle"></i> Adicionar Paciente
|
<i className="bi bi-plus-circle"></i> Adicionar Paciente
|
||||||
</button>
|
</button>
|
||||||
@ -245,13 +245,12 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
color: "#004085",
|
color: "#004085",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCurrentPage("details-page-paciente");
|
navigate(`/secretaria/pacientes/${paciente.id}`);
|
||||||
setPatientID(paciente.id);
|
setPatientID(paciente.id);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<i className="bi bi-eye me-1"></i> Ver Detalhes
|
<i className="bi bi-eye me-1"></i> Ver Detalhes
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
className="btn btn-sm"
|
className="btn btn-sm"
|
||||||
style={{
|
style={{
|
||||||
@ -259,7 +258,7 @@ function TablePaciente({ setCurrentPage, setPatientID }) {
|
|||||||
color: "#856404",
|
color: "#856404",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCurrentPage("edit-page-paciente");
|
navigate(`/secretaria/pacientes/${paciente.id}/edit`);
|
||||||
setPatientID(paciente.id);
|
setPatientID(paciente.id);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user